Tuesday, January 6, 2015

Modifying the units of change in the dependent variable in SAS' logistic regression

I often forget how to do this so, I’m making a note to myself, really, through my blog. I’m often interested in running a logistic regression model and am interested in asking the question, for a 10 unit change in my independent variable, what is the expected change in the odds of event y? By default, every statistical package will only provide estimates and odds ratios for a 1 unit change in the independent variable. So here’s a quick example code:

proc logistic data=work.temp6;
model death(event='0') = x1;
units x1=10;
oddsratio x1;
run;

The key is using the “units” statement, along with the “oddsratio” statement. This will produce both the estimated odds ratio and the 95% confidence interval for a 10 unit increase in x1.