Hi,
So I'm running a logistic regression for a categorical outcome variable (cv) and a main exposure (sun) which is also continuous. I have several covariates which have various levels, and I'm trying to use the first level as the reference.
However, SAS keeps on using the second level as reference.
Here's the code:
PROC logistic DATA=finald descending;
CLASS site(REF=FIRST);
MODEL cv= sun age site/ clPARM=both;
run;
Thanks.
Specify PARAM=REF as well, and if it persists please post a proc freq result of the variable SITE or the PROC LOGISTIC results.
@MerAgSo wrote:
Hi,
So I'm running a logistic regression for a categorical outcome variable (cv) and a main exposure (sun) which is also continuous. I have several covariates which have various levels, and I'm trying to use the first level as the reference.
However, SAS keeps on using the second level as reference.
Here's the code:
PROC logistic DATA=finald descending;
CLASS site(REF=FIRST);
MODEL cv= sun age site/ clPARM=both;
run;
Thanks.
If the variable is character with numerals as values the sort order for "first" may be different than you expect.
Can you show us the values you 1) expect to be reference and 2) is actually be used as reference?
It's best to explicitly specify the reference level in the REF= option. Specify the value you want as the reference in quotes - for example, REF="MyRefLevel". Quotes should be used regardless of whether the variable or it's values are numeric or character. Also, if the variable has an associated format, you must specify it's formatted value rather than it's internal, unformatted value.
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 16. 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.