I have a binary dependent variable (casenum) and five binary independent variables (1 or 0) with no interactions. I am running a logistic regression model and I want to determine the odds ratios. I am confused by which odds ratio is the correct one. Do I use the odds ratio calculated using a dummy/indicator or the exponentiated estimate from the default effects coding?
You should use the results in the default Odds Ratio Estimates table. The EXPB option should rarely be used and will not generally give the desired results, particularly when the default effects coding is used for CLASS variables.
Proc logistic data=study.qs;
class '28cat01'n "11ayn"n "18yn"n "66acatyn"n '32yn'n / param=REF;
model casenum= '28cat01'n "11ayn"n "18yn"n "66acatyn"n '32yn'n/ expb;
oddsratio '28cat01'n;
oddsratio "11ayn"n;
oddsratio "18yn"n;
....
run;
I'd highly recommend changing those variable names to something easier to type - put the YN first for example. It'll save you a lot of typing.
EDIT: You need to add PARAM=REF to the CLASS statement to ensure the parameterization of your categorical variables is correct. Assuming you want dummy coding, PARAM=REF is the specification you want.
You can use EXPB but the ODDSRATIO statement is clearer and easier to interpret. See the example above.
@mihhghjl wrote:
I have a binary dependent variable (casenum) and five binary independent variables (1 or 0) with no interactions. I am running a logistic regression model and I want to determine the odds ratios. I am confused by which odds ratio is the correct one. Do I use the odds ratio calculated using a dummy/indicator or the exponentiated estimate from the default effects coding?
Below is my code and output (PDF) using the default effects coding:Proc logistic data=study.qs;class '28cat01'n "11ayn"n "18yn"n "66acatyn"n '32yn'n;model casenum= '28cat01'n "11ayn"n "18yn"n "66acatyn"n '32yn'n/ expb;run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.