I spent many hours trying to understand why my contrast statement gives a different OR compared to the proc sort statement. I just cannot figure it out by myself. I would appreciate your help. Two interaction terms: age (YOUNG/ADULT/OLD) *migraine(Y/N) sex (M/F) *migraine Codes: male=0 female=1 young=0 adult=1 old=2 CONTRAST STATEMENT: proc logistic descending; class migraine(ref='0') age(ref='0') sex(ref='0') race(ref='0') osa(ref='0') income (ref='1')/param=ref; model htn(event="1")=migraine age sex race osa income migraine*age migraine*sex/risklimits; contrast 'migraine vs no migraine in young' migraine 1 0 migraine*age 0 0 /estimate=both; contrast 'migraine vs no migraine in menopause' migraine 1 0 migraine*age 1 0 /estimate=both; contrast 'migraine vs no migraine in old' migraine 1 0 migraine*age 0 0 /estimate=both; contrast 'migraine vs no migraine in female' migraine 1 0 migraine*sex 1 0 /estimate=both; contrast 'migraine vs no migraine in male' migraine 1 0 migraine*sex 0 0 /estimate=both; run; PROC SORT STATEMENT: proc logistic descending; class migraine(ref='0') sex (ref='0') race(ref='0') osa(ref='0') income (ref='1')/param=ref; model htn=migraine age sex race osa income/risklimits; by age; run; proc logistic descending; class migraine(ref='0') age(ref'0') race(ref='0') osa(ref='0') income (ref='1')/param=ref; model htn=migraine age sex race osa income/risklimits; by sex; run; In my contrast statement code, I am able to put the 2 interaction terms together, but I am not able to do the same with proc sort. I appreciate your advice. Please, if you know how to solve it, contact me: simone_derzi@hotmail.com
... View more