BookmarkSubscribeRSS Feed
MerAgSo
Calcite | Level 5

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. 

3 REPLIES 3
Reeza
Super User

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. 


 

ballardw
Super User

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?

StatDave
SAS Super FREQ

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.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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