BookmarkSubscribeRSS Feed
wbaker0621
Fluorite | Level 6

Greetings All, I am a non-statistician and have only been using SAS for a few months. I am working with a medical registry to conduct survival analysis and have observed missing data at random. I have run Proc MI to create 5 imputation data sets, but am getting stuck on the 2nd step when I analyze the set using Proc PHREG. Examples I have seen call for outputing the parameter estimates using the ODS Output statement (see below). When I then attempt to sort that new dataset prior to using Proc MIANALYZE it does not seem to exist. I would appreciate any advise on this code and examples of successful code for these 3 steps (Proc MI, Proc PHREG, Proc MIANALYZE). Thank you so much for your help in advance. 

Cheers

Bill

 

/* Use multiple imputation for missing data values */
proc mi data=SRTR.BLACK_TX2 round=0.001 nimpute=5 seed=123456 out=SRTR.BLACK_MI noprint;
	class &VARLIST_CAT;
	var &VARLIST_CAT &VARLIST_CONT;
	fcs;
run;

/* Run Cox regression of multiply imputed data */
proc phreg data=SRTR.BLACK_MI;
	by _Imputation_;
	class Group &varlist_cat;
	model TTE_10 * Death_10(0) = Group &varlist_cat &varlist_cont
		/ ties=efron rl;
	ods output ParameterEstimates=SRTR_BLACK_ES;
run;
4 REPLIES 4
SteveDenham
Jade | Level 19

What does it say in the log? Is SRTR_BLACK_ES created, or does something else happen? Without the log, it is very hard to tell what might be happening.

 

SteveDenham

wbaker0621
Fluorite | Level 6

Great point. This newbie still hasn't gotten used to looking at the log. The datafile was created, but was put in the work folder. 

SAS_Rob
SAS Employee

It would be helpful to see what exactly isn't working in the MIANALYZE step with the LOG.

 

But the MIANALYZE code should just be something like this:

 

proc mianalyze parms(classvar=classval)=SRTR_BLACK_ES;

class Group &varlist_cat;
modeleffects Group &varlist_cat &varlist_cont;

run;

wbaker0621
Fluorite | Level 6

Thanks all. This combination of code worked, once I payed attention to the log and knew where the output files were headed.

 

/* Run Cox regression of multiply imputed data */
proc phreg data=SRTR.BLACK_MI;
	by _Imputation_;
	class Group(ref='WHITE_WOMAN') &varlist_cat;
	model TTE_10 * Death_10(0) = Group &varlist_cat &varlist_cont
		/ ties=efron rl;
	ods output ParameterEstimates=SRTR_BLACK_ES;
run;

/* Combine model coefficients */
proc sort data=work.srtr_black_es;
	by Parameter ClassVal0 _Imputation_;
run;

proc mianalyze data=work.srtr_black_es;
	by Parameter ClassVal0;
	modeleffects Estimate;
	stderr StdErr;
	ods output ParameterEstimates = SRTR_Black_es_mianal;
run;

/* Exponentiate in order to obtain hazard ratio estimates and confidence intervals */
data srtr.black_HR; set work.srtr_black_es_mianal;
	Log_HR_comb=Estimate;
	HR_comb=exp(Estimate);
	HR_LCL_comb=exp(LCLMean);
	HR_UCL_comb=exp(UCLMean);
	keep Parameter ClassVal0 HR_comb HR_LCL_comb HR_UCL_comb Probt;
	rename Probt=HR_pval_comb;
run;

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 4 replies
  • 2553 views
  • 2 likes
  • 3 in conversation