Greetings community,
am trying to do multiple imputation and I which to have pooled estimates through the function MIANALYZE by region, but I don't how to include that in my code
proc mi nimpute=2 data=Work.query seed=45 out=want_imp1; class age7 sgp region province ghq12 sex; fcs regression (lnbmi) logistic (sgp) discrim (province) ; var id hh wfin age7 lnbmi ghq12 province region sgp sex; run ; proc mixed data= want_imp1; title 'PROC MIXED weighted + clustered GP after MI'; by _imputation_ regionch; weight wfin; class hh age7 sex sgp ; model lnbmi = GHQ12 sgp sex*age7 / solution covb; random intercept / subject=hh; ods output SolutionF = mixed_GP_parms covb = mixed_GP_cov; run; proc mianalyze parms=mixed_gp_parms ; title 'MIANALYZE of MIXED with GP as covariate'; class sgp sex age7 ; modeleffects intercept sgp age7*sex;
by region run;
Thanks very much.
It looks like the data is not properly sorted. Try sorting it first and see if that takes care of the issue.
proc sort data=mixed_gp_parms;
by region _imputation_;
run;
proc mianalyze parms=mixed_gp_parms ;
title 'MIANALYZE of MIXED with GP as covariate';
class sgp sex age7 ;
modeleffects intercept sgp age7*sex;
by region;
run;
That code should work, assuming you have a typo in the MIXED code on the BY statement with the variable regionch instead of region. Can you post the LOG so we can see exactly what is going wrong?
It looks like the data is not properly sorted. Try sorting it first and see if that takes care of the issue.
proc sort data=mixed_gp_parms;
by region _imputation_;
run;
proc mianalyze parms=mixed_gp_parms ;
title 'MIANALYZE of MIXED with GP as covariate';
class sgp sex age7 ;
modeleffects intercept sgp age7*sex;
by region;
run;
Thanks very much. It worked for me.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.