!!!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;
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.
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?
I have no idea.
For example, why it couldn't be ignored by phreg, I need to consider only 1.
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 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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.