BookmarkSubscribeRSS Feed
dikshar
Calcite | Level 5

I am pretty new to multiple imputations and I truly don't know how to troubleshoot the code. This is what I have so far. 

 

PROC MI data= have
out = impute10 
nimpute =10 
seed =8842 
round=1 
simple
minimum= 0 0 0
maximum= 1 1 1;
var catvar1 catvar2  catvar3;
run;

 

proc logistic descending data = impute10 out =logistimp10;
class catvar1(ref = "1") catvar2(ref = "1") catvar3(ref = "0") catvar4(ref = "1") catvar5(ref = "1") catvar16(ref = "1")/ param = ref;
model result= var1 num var2 catvar4 catvar5 catvar6
bmi catvar1 catvar2 age catvar3/covb;
by _imputation_;
ods output ParameterEstimates=lgsparms CovB=lgscovb;
run;

 

proc mianalyze parms=lgsparms covb(effectvar=stacking)=lgscovb;
class catvar1 catvar2 catvar3 catvar4 catvar5 catvar6;
modeleffects var1 num var2 catvar4 catvar5 catvar6
bmi catvar1 catvar2 age catvar3;
run;

 

The issue is with proc mianalyze. I don't know how to handle categorical variables here besides having a class statement. I tried adding parms(classvar=level)=lgsparms but I get an error saying that level1 is not in the parms= dataset. 

 

How should I recode this to properly include categorical variables?

I eventually also want to stratify by a categorical variable, will that be an issue?

1 REPLY 1
Norman21
Lapis Lazuli | Level 10

You might find this page useful:

 

https://stats.idre.ucla.edu/sas/seminars/multiple-imputation-in-sas/mi_new_1/

Norman.
SAS 9.4 (TS1M6) X64_10PRO WIN 10.0.17763 Workstation

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 699 views
  • 0 likes
  • 2 in conversation