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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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