BookmarkSubscribeRSS Feed
Thuva
Calcite | Level 5

Hello,

 

I've tried to use the following link to run logistic regression on my imputed data to obtain the final odds ratios and 95%CIs:

 https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_mianalyze_s...

 

I am interested in a model with 2 categorical variables (location and treatment). This is my code:

 

Step 1:
proc logistic data=outmi;
class satis_analg location treatment (ref='Morphine');
model satis_analg(event='Yes')=treatment location/ covb;
by _Imputation_;
ods output ParameterEstimates=lgsparms
CovB=lgscovb;
run;

When I run this step, I get the following NOTES. Also, I have tried this entire process with adding the outcome 'satis_analg' to the CLASS statement, it still doesn't fix the issue. 

NOTE: Option EVENT= is ignored since LINK=CLOGIT.
NOTE: PROC LOGISTIC is fitting the cumulative logit model. The probabilities modeled are summed
over the responses having the lower Ordered Values in the Response Profile table. Use the
response variable option DESCENDING if you want to reverse the assignment of Ordered Values
to the response levels.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.

 

STEP 2: 
proc mianalyze parms=lgsparms
covb(effectvar=stacking)=lgscovb;
modeleffects treatment location;
run;

When I run this step I get the following ERROR:

ERROR: Variable treatment is not in the COVB= data set

 

This is what my lgsparm dataset looks like. I'm not sure why there are 2 intercepts:

proc print data=lgsparms (obs=10); run;

Obs _Imputation_ Variable ClassVal0 DF Estimate StdErr WaldChiSq ProbChiSq _ESTTYPE_
1 1 Intercept 1 1 -6.3562 1.0228 38.6215 <.0001 MLE
2 1 Intercept No 1 -2.1939 0.2511 76.3405 <.0001 MLE
3 1 treatment Hydromorphone 1 0.0155 0.1458 0.0113 0.9155 MLE
4 1 location JH 1 -0.5374 0.4260 1.5915 0.2071 MLE
5 1 location MUMC 1 0.0318 0.3537 0.0081 0.9284 MLE
6 2 Intercept .95 1 -6.3562 1.0228 38.6215 <.0001 MLE
7 2 Intercept No 1 -2.1939 0.2511 76.3405 <.0001 MLE
8 2 treatment Hydromorphone 1 0.0155 0.1458 0.0113 0.9155 MLE
9 2 location JH 1 -0.5374 0.4260 1.5915 0.2071 MLE
10 2 location MUMC 1 0.0318 0.3537 0.0081 0.9284 MLE

 

Any help on how to obtain the final overall odds ratios and corresponding 95% CIs and pvalues would be much appreciated.

1 REPLY 1
Thuva
Calcite | Level 5

I just wanted to add what my dataset 'lgscovb' looked like as well. For some reason I am getting so many intercepts.

proc print data=lgscovb ; run;

SAS Output

Obs _Imputation_ Parameter Intercept_1 Intercept_No treatmentHydromorphone locationJH locationMUMC Intercept__95 Intercept_0_9 Intercept_1_5 Intercept__87
1 1 Intercept_1 1.046096 0.060924 -0.00073 0.056477 -0.0008 . . . .
2 1 Intercept_No 0.060924 0.063049 -0.00067 0.055415 -0.00096 . . . .
3 1 treatmentHydromorphone -0.00073 -0.00067 0.021264 -0.00005 -0.00032 . . . .
4 1 locationJH 0.056477 0.055415 -0.00005 0.181463 -0.11747 . . . .
5 1 locationMUMC -0.0008 -0.00096 -0.00032 -0.11747 0.125081 . . . .
6 2 Intercept__95 . 0.060924 -0.00073 0.056477 -0.0008 1.046096 . . .
7 2 Intercept_No . 0.063049 -0.00067 0.055415 -0.00096 0.060924 . . .
8 2 treatmentHydromorphone . -0.00067 0.021264 -0.00005 -0.00032 -0.00073 . . .
9 2 locationJH . 0.055415 -0.00005 0.181463 -0.11747 0.056477 . . .
10 2 locationMUMC . -0.00096 -0.00032 -0.11747 0.125081 -0.0008 . . .
11 3 Intercept_0_9 . 0.060924 -0.00073 0.056477 -0.0008 . 1.046096 . .
12 3 Intercept_No . 0.063049 -0.00067 0.055415 -0.00096 . 0.060924 . .
13 3 treatmentHydromorphone . -0.00067 0.021264 -0.00005 -0.00032 . -0.00073 . .
14 3 locationJH . 0.055415 -0.00005 0.181463 -0.11747 . 0.056477 . .
15 3 locationMUMC . -0.00096 -0.00032 -0.11747 0.125081 . -0.0008 . .
16 4 Intercept_1_5 . 0.060924 -0.00073 0.056477 -0.0008 . . 1.046096 .
17 4 Intercept_No . 0.063049 -0.00067 0.055415 -0.00096 . . 0.060924 .
18 4 treatmentHydromorphone . -0.00067 0.021264 -0.00005 -0.00032 . . -0.00073 .
19 4 locationJH . 0.055415 -0.00005 0.181463 -0.11747 . . 0.056477 .
20 4 locationMUMC . -0.00096 -0.00032 -0.11747 0.125081 . . -0.0008 .
21 5 Intercept__87 . 0.060924 -0.00073 0.056477 -0.0008 . . . 1.046096
22 5 Intercept_No . 0.063049 -0.00067 0.055415 -0.00096 . . . 0.060924
23 5 treatmentHydromorphone . -0.00067 0.021264 -0.00005 -0.00032 . . . -0.00073
24 5 locationJH . 0.055415 -0.00005 0.181463 -0.11747 . . . 0.056477
25 5 locationMUMC . -0.00096 -0.00032 -0.11747 0.125081 . . . -0.0008

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1884 views
  • 0 likes
  • 1 in conversation