BookmarkSubscribeRSS Feed
Birdsong32
Calcite | Level 5
/* Unadjusted OR from logistic regression HOSP*/
PROC LOGISTIC DATA= MB2;
CLASS VAR4(PARAM = REF REF = '1') VAR2 (PARAM = REF REF = '1')
VAR6 (PARAM = REF REF = '1') VAR10(PARAM = REF REF = '3');
MODEL VAR7(EVENT = '1') = VAR4;
RUN;

this is the unadjusted odds ratio code im running

 

its saying invalid reference value for VAR4  

4 REPLIES 4
Reeza
Super User
VAR4(PARAM = REF REF = '1')

It means you don't have a value of 1 for your Var4.

Run the following to see the values. I can't recall if it should be the formatted or unformatted value you include in the REF - the documentation does state which though.

proc freq data=mb2;
table var4;
run;

 


@Birdsong32 wrote:
/* Unadjusted OR from logistic regression HOSP*/
PROC LOGISTIC DATA= MB2;
CLASS VAR4(PARAM = REF REF = '1') VAR2 (PARAM = REF REF = '1')
VAR6 (PARAM = REF REF = '1') VAR10(PARAM = REF REF = '3');
MODEL VAR7(EVENT = '1') = VAR4;
RUN;

this is the unadjusted odds ratio code im running

 

its saying invalid reference value for VAR4  


 

Birdsong32
Calcite | Level 5

Should i change my variable name?

 

if so, how do i go by doing so?

Reeza
Super User
No, it's the value of '1' SAS that's the issue. SAS doesn't find any values that are 1 to be the reference. This could be either because you have no 1s in your data set or because you have a format applied to the VAR4 variable that displays the 1s as "Yes" for example. If the variable has a format, REF expects the formatted value, not the unformatted value.

But we're guessing a bit. The log and the results from the code I included would allow us to definitively answer your question.
StatDave
SAS Super FREQ

If VAR4 has an associated format, then you need to specify the formatted value. And I strongly advise against including variables in the CLASS statement that are not also used in the MODEL statement. Any observation with a missing value on any of those unused variables will be omitted from the model fitting process, so you could end up using fewer observations than possible.

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
  • 4 replies
  • 2525 views
  • 2 likes
  • 3 in conversation