BookmarkSubscribeRSS Feed
Caetreviop543
Obsidian | Level 7

Hi everyone,

 

I am trying to use contrast statements in proc logistic to show estimates at different levels of X, and that the linear relationship between my dependent and independent variable isn’t constant.

 

I was able to find documentation here:

 

http://support.sas.com/kb/35/189.html

 

I just have a few questions:

 

  1. How does SAS calculate the estimates at different levels of X with control variables in the model? The example seems to use the formula B0+B1x+B2x2, but when I add control variables to my model the output and results based on the formula don’t match.

 

  1. What does the ‘intercept 1’ statement refer to? I assumed it meant setting B0=1 when obtaining the estimates (based on B0+B1x+B2x2), but that doesn’t produce the correct answer.

 

  1. Where exactly does the formula B1+B2(2x+1) tie in? I thought it corresponds to the unit change difference between two estimates, where a one unit difference would be B1+B2(2x+1), a two unit difference B1+B2(2x+2), etc. It also seems that way, because in the contrast 'logOdds@11-logOdds10' statement you plug in the final value for (2X+1), although I don’t understand why you then double that for a two-unit increase. The author explains that the difference between the two estimates is simply estimate two minus estimate one, so why then are the final values for (2x+1) incorporated in the code?

 

Help on any of the questions is greatly appreciated!

 

Emily 

4 REPLIES 4
Reeza
Super User

1. Can you show your calculations? Control variables cancel each other out because that's not the unit you're increasing or checking for a change so when you subtract the two, they 'disappear'.

 

log(Oddsx+1/Oddsx) = LogOddsx+1 - LogOddsx

 

2. I believe it means that its the intercept*1 which is just the intercept

 

3. Don't know

 

TBH I wouldn't bother with Estimate statements. 

As it states this is much easier with the ODDSRATIO statement and I'd use that instead.

 

 

Beginning in SAS/STAT 9.22 in SAS 9.2 TS2M3, you can do this more easily with the ODDSRATIO statement. Use the AT option to specify the starting value of the range over which the odds ratio should be computed. Include the UNITS statement to specify the amount of change over which the odds ratio should be computed. Without the UNITS statement, the odds ratio estimates the change in odds for a 1 unit increase in the variable. The following statements estimate the change in odds for a change in X from X=3 to X=4. The UNITS statement could be omitted in this case since a 1 unit change is requested.

 

I'll move this to the Stats forum so someone with better answers can help 🙂

Caetreviop543
Obsidian | Level 7

Hi Reeza,

 

I figured out what was wrong with my calculations...I was dividing the log odds and then exponentiating, rather than exponentiating the log odds to get the odds, and then dividing by the odds to get the odds ratios. 

 

Yea, I think your right...the odds ratio statements are easier. I'm not really sure the utility or advantage of using the estimate statements. 

 

Thanks for your help!

 

Emily 

Reeza
Super User

Estimate existed before the ODDSRATIO statement, I think they leave it in for backwards compatibility and it can do some complex estimates that you can't do in others. 

 

I've moved this post to the Stats forum so hopefully that helps. It's under Analytics, SAS Statistical Procedures.

Caetreviop543
Obsidian | Level 7

Also, where can I find the stats forum? Is it under "Find a Community?"

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1924 views
  • 2 likes
  • 2 in conversation