BookmarkSubscribeRSS Feed
undercover_247
Fluorite | Level 6

I am using proc mianalyze and it won't finish running. It just freezes but I'm not sure what's going wrong. I tried different numbers of imputations to see if that was the issue but no luck

 

Here is the code. Any advice?


proc mi data= spite.MIaim1 nimpute=5 /*20*/ out=mi_fcs ;
class race_collapsed alcohol_use breastfeed rural year_diagnosis sexuality_dich smoking;
fcs plots=trace(mean std);
var race_collapsed BMI sexuality_dich age2 agediagnosed diagnosticdelay smoking alcohol_use rural age_firstperiod preg3 breastfeed year_diagnosis;
fcs discrim(race_collapsed sexuality_dich alcohol_use breastfeed rural year_diagnosis /classeffects=include) nbiter =100 ;
run;

 

proc genmod data=mi_fcs;
class race_collapsed (ref = 'White') sexuality_dich (ref = 'Straight') smoking (ref = "Never Smoker") alcohol_use (ref = "Non-drinker") rural (ref = "Never rural")
income2 (ref = "60k +") employment2 (ref = "Employed FT") education2 (ref = "Undergrad and higher")
breastfeed (ref = "Ever Breastfed")
;
model factor1 = race_collapsed BMI sexuality_dich age2 agediagnosed diagnosticdelay income2 employment2 education2
smoking alcohol_use rural age_firstperiod preg3 breastfeed num_comorbidities year_diagnosis/dist=normal ;
by _imputation_;
ods output ParameterEstimates=gm_fcs;
run;


PROC MIANALYZE parms(classvar=level)=gm_fcs;
class race_collapsed alcohol_use breastfeed rural year_diagnosis sexuality_dich smoking;
MODELEFFECTS INTERCEPT factor1 race_collapsed BMI sexuality_dich age2 agediagnosed diagnosticdelay income2 employment2 education2
smoking alcohol_use rural age_firstperiod preg3 breastfeed num_comorbidities year_diagnosis;
RUN;

 

10 REPLIES 10
Ksharp
Super User
I am not sure. Try to remove CLASS in PROC MIANALYZE .
Rick_SAS
SAS Super FREQ

Have you looked at the example in the PROC MIANALYZE documentation, in the section, "Reading Generalized Linear Model Results"?

It uses a CLASS statement and a GENMOD example. The example uses the COVB option on the MODEL statement and captures three ODS tables, which are used by PROC MIANALYZE. I suggest you try to mimic that example.

undercover_247
Fluorite | Level 6

I'm trying this and for some reason I get this error: ERROR: The parameter Prm5 in the PARMINFO= data set is not in the COVB= data set. 

 

It just seems to skip over 5 and I can't figure out why yet

SAS_Rob
SAS Employee

When you have a CLASS statement in MIANALYZE you do not need to use either the PARMINFO or COVB= data sets.  You only need the PARMS= data set.

undercover_247
Fluorite | Level 6

I have made the following edits and still can't get it to run. I removed the (classvar=level) and it ran but I don't believe I should take that out. What do you think? @Rick_SAS 

 

proc mi data= spite.MIaim1 nimpute=5 out=mi_fcs ;
class race_collapsed alcohol_use breastfeed rural year_diagnosis sexuality_dich smoking;
fcs plots=trace(mean std);
var race_collapsed BMI sexuality_dich age2 agediagnosed diagnosticdelay smoking alcohol_use rural age_firstperiod preg3 breastfeed year_diagnosis;
fcs discrim(race_collapsed sexuality_dich alcohol_use breastfeed rural year_diagnosis smoking/classeffects=include) nbiter =100 ;
run;

proc freq data = spite.miaim1;
table income2 race_collapsed BMI sexuality_dich age2 agediagnosed diagnosticdelay employment2 education2 smoking alcohol_use rural age_firstperiod preg3 breastfeed num_comorbidities year_diagnosis;
run;


proc genmod data=mi_fcs;
class race_collapsed (ref = 'White') sexuality_dich (ref = 'Straight') smoking (ref = "Never Smoker") alcohol_use (ref = "Non-drinker") rural (ref = "Never rural")
income2 (ref = "60k +") employment2 (ref = "Employed FT") education2 (ref = "Undergrad and higher")
breastfeed (ref = "Ever Breastfed")
;
model factor1 = race_collapsed BMI sexuality_dich age2 agediagnosed diagnosticdelay income2 employment2 education2
smoking alcohol_use rural age_firstperiod preg3 breastfeed num_comorbidities year_diagnosis/dist=normal ;
by _imputation_;
ods output ParameterEstimates=gm_fcs;
run;

PROC MIANALYZE parms(classvar=level)=gm_fcs;
class race_collapsed alcohol_use breastfeed rural year_diagnosis sexuality_dich smoking;
MODELEFFECTS INTERCEPT factor1 race_collapsed BMI sexuality_dich age2 agediagnosed diagnosticdelay income2 employment2 education2
smoking alcohol_use rural age_firstperiod preg3 breastfeed num_comorbidities year_diagnosis;
RUN;

SAS_Rob
SAS Employee
Try taking the response variable(factor1) off the MODELEFFECTS statement. It should not be there.
undercover_247
Fluorite | Level 6

I took it out and it is still freezing unfortunately. 

SAS_Rob
SAS Employee

If you can post the PARMS= data set then we can see exactly what is going on.

undercover_247
Fluorite | Level 6

Thank you! Please see attached for the gm_fcs dataset created by the parameter estimates command and used in the mianalyze 

SAS_Rob
SAS Employee

It looks like you have added variables to the CLASS statement in MIANALYZE that are not CLASS variables in the actual model (like year_diagnosis).  When I fix that, the MIANALYZE step runs without any errors.

 

PROC MIANALYZE parms(classvar=level)=gm_fcs;
class race_collapsed sexuality_dich smoking alcohol_use rural income2 employment2 education2 breastfeed;
MODELEFFECTS INTERCEPT race_collapsed BMI sexuality_dich age2 agediagnosed diagnosticdelay income2 employment2 education2
smoking alcohol_use rural age_firstperiod preg3 breastfeed num_comorbidities year_diagnosis;

run;

 

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
  • 10 replies
  • 2232 views
  • 10 likes
  • 4 in conversation