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

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";
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 "Chronic Pain if Age=9" intercept 1 age_c 1 / ILINK;
ESTIMATE "Chronic Pain if Age=10" intercept 1 age_c 2 / ILINK;
RUN;

Lindsay

Posts: 5,523

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

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

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

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
Discussion stats