- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;