BookmarkSubscribeRSS Feed
ronaldo7
Calcite | Level 5

I am using the National Health Interview Survey to look at cardiovascular disease rates by various demographic groups. I have multiply imputed my data by FCS method through PROC MI without any issue. Next, I would like to calculate age-adjusted prevalence rates for cardiovascular disease by various demographic groups. I have been using PROC SURVEYREG with ESTIMATE statements. When I use PROC MIANALYZE, I obtain an error message that reads, "ERROR: The model effect estimate is not in the PARMS= data set" even though it clearly is. I have added my SAS code below.

 

**MULTIPLE IMPUTATION**;
*Check how much data is missing*;
proc mi data=nhis nimpute=0 ;
	var CVD AGEP_A Sex RaceEthnicity Education IncomePovertyRatio BMICategory HealthInsurance
		URBRRL REGION;
	ods select misspattern;
run;

*Imputation phase*;
proc mi data=nhis nimpute=5 out=mi_fcs ;
	class CVD Sex RaceEthnicity Education IncomePovertyRatio BMICategory HealthInsurance URBRRL REGION;
	fcs plots=trace(mean std); 
	var CVD AGEP_A Sex RaceEthnicity Education IncomePovertyRatio BMICategory HealthInsurance URBRRL REGION;
	fcs discrim(CVD Sex RaceEthnicity Education IncomePovertyRatio BMICategory HealthInsurance URBRRL REGION /classeffects=include) nbiter =10 ; 
run;

**Analysis phase for age-adjusted prevalence**;
proc surveyreg data=work.mi_fcs;
	strata PSTRAT; 
	cluster PPSU;
	weight WTFA_A; 
	class AgeCat;
	domain _imputation_*RaceEthnicity;
	model CVD2 = AgeCat / noint solution clparm;
	estimate 'Total                     ' AgeCat 0.2015  0.1733  0.1568  0.1566  0.1551  0.1566;
	ods output ParameterEstimates=estimates (where=(_imputation_ ne . ));
run;

proc mianalyze parms(classvar=classval)=estimates;
	by RaceEthnicity;
	modeleffects estimate ;
	stderr StdErr;
run;
**In this last step with proc mianalyze, I encounter the error message that the model effect estimate is not in the parms= data set**


Would you please offer any support or guidance to resolve this issue? Thank you!

 

1 REPLY 1
SAS_Rob
SAS Employee

There are two issues that need to be addressed in addition to the ERROR message.  Your MODELEFFECTS statement should list the parameters on it and there should not be a STDERR statement when you use the PARMS= data set. 

 

Secondly, you should use a BY statement for the _IMPUTATION_ and only list RaceEthnicity on the DOMAIN statement.

 

Regarding the ERROR message, because of the way that SURVEYREG codes CLASS variables it is necessary to
remove all blanks from the variable Parameter before feeding it into MIANALYZE.   You will then need to check the names of the effects in that data set (using a Proc PRINT) by placing them on the MODELEFFECTS statement .  You will also need to sort the output data set since you will need to run MIANALYZE by the domain variable.

 

If your goal is to also combine your ESTIMATE statement, then you will need another call to MIANALYZE (with another Proc SORT).

 

Below is an example that shows all of the steps for combining both the Parameter Estimates and Estimate statements when you use a DOMAIN statement in SURVEYREG.

/*This assumes that the imputation has already been done*/
data farms;
do _imputation_=1 to 3;
do domainvar=1 to 3;
do state=1 to 2;
do region=1 to 3;
do rep=1 to 5;
farmarea=ceil(ranuni(323)*100);
cornyield=.66+.95*state+.65*farmarea+rannor(3214);
weight=ceil(ranuni(0)*10);
output;
end;
end;
end;
end;
end;
run;
proc surveyreg data=Farms; by _imputation_; domain domainvar; class region; strata State ; model CornYield = region FarmArea /solution; weight Weight; estimate 'Region 1 vs Region 2' region 1 -1; estimate 'Region 1 vs Region 3' region 1 0 -1; ods output parameterestimates=parms estimates=estimate_ds;; run;
/*Because of the way that SURVEYREG codes CLASS variables it is necessary to remove all blanks from the variable Parameter*/ data parms; set parms; parameter=compress(parameter); run; /*This shows how the Parameters are now labeled for the MODELEFFECTS statement*/ proc print data=parms(obs=5); var parameter; run; proc sort data=parms; by domainvar _imputation_; run; proc mianalyze parms=parms; by domainvar; modeleffects intercept region1 region2 farmarea; run; proc sort data=estimate_ds; by label domain _imputation_; run; proc mianalyze data=estimate_ds; by label domain; modeleffects estimate; stderr stderr; 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
  • 1 reply
  • 442 views
  • 1 like
  • 2 in conversation