BookmarkSubscribeRSS Feed
webart999ARM
Quartz | Level 8

!!!URGENT!!!

Hi People,

I have an error: Invalid reference value for FLAG  after running the below code.
One of my input datasets has only value 0, I think that brings an issue.
How can I handle that?
If anybody has any idea please tell me.

 

ods output parameterestimates = hzd&trtn.;
proc phreg data=hazard;
  class flag(ref="1");
  model aval*cnsr1(1)=flag / rl;
run;
ods output close;
 

0e9e998e-d5eb-4e80-97e3-360930651dd6.jpg

Kind Regards
Artur
-------------------

UPDATE

 

I removed the error.
Now I have only following warning

Output 'parameterestimates' was not created.  Make sure that the output object name, label, or path is spelled correctly.  Also, verify that the
         appropriate procedure options are used to produce the requested output object.  For example, verify that the NOPRINT option is not used.
 

 

5 REPLIES 5
PaigeMiller
Diamond | Level 26

If one of your data sets only has a value of 0 for FLAG, then that is the problem.

 

How can you handle this? How do you want to handle this?

--
Paige Miller
webart999ARM
Quartz | Level 8

I have no idea.
For example, why it couldn't be ignored by phreg, I need to consider only 1.

ballardw
Super User

Please post log entries by copy from the log and paste into a code box opened on the forum with the </>. Include the code for the procedure with any notes from the log.

If you are running this in the body of a macro then set Options MPRINT so the generated code can appear with the messages.

 

If your variable does not have the specified value as ref on the class statement, yes that will be a problem.

Solution: make sure the value exists in the data.

OR

Use a reference value that does exist in the data.

 

If your only independent variable has only one value you aren't going to get much of a useable model anyway.

webart999ARM
Quartz | Level 8
Here is the problem,
A macro that is generated pull to preg procedure multiple datasets, one of them has a flag variable with only 0 values.
Maybe somehow I can dynamically check and use the datasets with only 1 value? Or just ignore that one dataset which as value 0 only?
PaigeMiller
Diamond | Level 26

@webart999ARM wrote:
Here is the problem,
A macro that is generated pull to preg procedure multiple datasets, one of them has a flag variable with only 0 values.
Maybe somehow I can dynamically check and use the datasets with only 1 value? Or just ignore that one dataset which as value 0 only?

So clearly, you have some macro language in use, looking to perform PROC PHREG on data set hzd&trtn. Thus, in your macro, before PROC PHREG, you need to check to see that there are at least two distinct levels of FLAG. One way to do this is to use the NLEVELS option of PROC FREQ, and if there is only one level, then don't perform PROC PHREG.

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2171 views
  • 0 likes
  • 3 in conversation