Programming the statistical procedures from SAS

How can I get odds ratio estimates and confidence intervals for multiple levels with a variable

Reply
Occasional Learner
Posts: 1

How can I get odds ratio estimates and confidence intervals for multiple levels with a variable

Hi all, 

 

I am using SAS Studio. I'm trying to compute the odds ratios and confidence intervals for all of the levels within a variable. For example, I am looking at how maltreatment exposure predicts chronic pain. Maltreatment exposure has four levels: 1, 2, 3, and 4, to indicate frequency of occurrence. I want to see what the odds are for developing chronic pain if someone has a maltreatment frequency of 1, a maltreatment frequency of 2, and so on. I have tried both PROC LOGISTIC and PROC GLIMMIX, but I only get one odds ratio, instead of an odds ratio for each level of the variable. 

 

My predictors include age (8-19 years), gender (0 or 1), placement type (1 or 1), and maltreatment exposure (1,2,3,and 4). My outcome is chronic pain (0 or 1). I would like to look at the odds of chronic pain for all of the levels of all of my variables. 

 

TITLE1 "Single-Level Logistic Model Predicting Chronic Pain";
PROC GLIMMIX DATA=work.pain NOCLPRINT NAMELEN=100 METHOD=QUAD (QPOINTS=15) GRADIENT;
CLASS PID; * Descending makes us predict the 1 instead of the default-predicted 0;
MODEL chronicpain (DESCENDING) = age_c Gender GroupHome RndChron_c / SOLUTION LINK=LOGIT DIST=BINARY DDFM=Satterthwaite ODDSRATIO;
ESTIMATE "Intercept" intercept 1 / ILINK; * ILINK is inverse link (to un-logit);
ESTIMATE "Chronic Pain if Age=9" intercept 1 age_c 1 / ILINK;
ESTIMATE "Chronic Pain if Age=10" intercept 1 age_c 2 / ILINK;
RUN;

 

Thanks for your help!

 

Lindsay 

Esteemed Advisor
Posts: 5,523

Re: How can I get odds ratio estimates and confidence intervals for multiple levels with a variable

Posted in reply to lindsaypaige

Your code doesn't include any reference to maltreatment and your model doesn't include any reference to PID...

 

Assuming that all your independent variables are classes, you could start with:

 

TITLE1 "Single-Level Logistic Model Predicting Chronic Pain";

PROC GLIMMIX DATA=work.pain NOCLPRINT NAMELEN=100 METHOD=QUAD (QPOINTS=15) GRADIENT;
CLASS age_c Gender GroupHome RndChron_c; 
MODEL chronicPain (event="1") = age_c Gender GroupHome RndChron_c / SOLUTION LINK=LOGIT DIST=BINARY DDFM=Satterthwaite;
lsmeans age_c / oddsratio;
lsmeans gender / oddsratio;
lsmeans groupHome / oddsratio;
lsmeans RndChron_c / oddsratio;
RUN;

(untested)

 

PG
Ask a Question
Discussion stats
  • 1 reply
  • 124 views
  • 0 likes
  • 2 in conversation