BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
smoore3790
Fluorite | Level 6
 

I am using SAS to do a multiple imputation, and I am having trouble figuring out proc MI. I am looking at a comparison of a control with 126 observations to the cases with 63 observations. The missing data is specifically only in the PercentUsed variable. This is what I have so far. Really appreciate any help.

proc mi data=FinalMod nimpute=126 seed=12345 out=imputed;
var days case sleep exercise age PercentUsed  ;  
run;

PROC PHREG data= FinalMod;
MODEL days*case(0) =  sleep exercise age PercentUsed/ RISKLIMITS=BOTH
TYPE3(ALL);
RUN;

proc mianalyze data=imputed;
  modeleffects est=phreg;
run;

I am expecting results that look similar to the original proc phreg, but slightly different for the PercentUsed variable

1 ACCEPTED SOLUTION

Accepted Solutions
SAS_Rob
SAS Employee

It isn't clear exactly what your question is.  You will not get any output from the code you sent, at least with respect to the multiple imputation modeling and combining of estimates.

The PHREG step is on the wrong data set and needs to be done BY _IMPUTATION_ and the syntax in the MIANALYZE step is not valid.  You should run this instead:

 

PROC PHREG data= imputed;
by _imputation_; MODEL days*case(0) = sleep exercise age PercentUsed/ RISKLIMITS=BOTH TYPE3(ALL);
ods output ParameterEstimates=phreg_parms: RUN; proc mianalyze parms=phreg_parms: modeleffects sleep exercise age PercentUsed;
run;

 

View solution in original post

2 REPLIES 2
SAS_Rob
SAS Employee

It isn't clear exactly what your question is.  You will not get any output from the code you sent, at least with respect to the multiple imputation modeling and combining of estimates.

The PHREG step is on the wrong data set and needs to be done BY _IMPUTATION_ and the syntax in the MIANALYZE step is not valid.  You should run this instead:

 

PROC PHREG data= imputed;
by _imputation_; MODEL days*case(0) = sleep exercise age PercentUsed/ RISKLIMITS=BOTH TYPE3(ALL);
ods output ParameterEstimates=phreg_parms: RUN; proc mianalyze parms=phreg_parms: modeleffects sleep exercise age PercentUsed;
run;

 

smoore3790
Fluorite | Level 6

Thanks so much for the help, I really appreciate it. This worked perfectly and completely fixed my issue!!!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1200 views
  • 2 likes
  • 2 in conversation