<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error with PROC MIANALYZE after regression in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Error-with-PROC-MIANALYZE-after-regression/m-p/941546#M47020</link>
    <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;**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**


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Would you please offer any support or guidance to resolve this issue? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2024 19:56:04 GMT</pubDate>
    <dc:creator>ronaldo7</dc:creator>
    <dc:date>2024-08-28T19:56:04Z</dc:date>
    <item>
      <title>Error with PROC MIANALYZE after regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-with-PROC-MIANALYZE-after-regression/m-p/941546#M47020</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;**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**


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Would you please offer any support or guidance to resolve this issue? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 19:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-with-PROC-MIANALYZE-after-regression/m-p/941546#M47020</guid>
      <dc:creator>ronaldo7</dc:creator>
      <dc:date>2024-08-28T19:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error with PROC MIANALYZE after regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-with-PROC-MIANALYZE-after-regression/m-p/941820#M47021</link>
      <description>&lt;P&gt;There are two issues that need to be addressed in addition to the ERROR message.&amp;nbsp; Your MODELEFFECTS statement should list the parameters on it and there should not be a STDERR statement when you use the PARMS= data set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Secondly, you should use a BY statement for the _IMPUTATION_ and only list RaceEthnicity on the DOMAIN statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding the ERROR message, because of the way that SURVEYREG codes CLASS variables it is necessary to&lt;BR /&gt;remove all blanks from the variable Parameter before feeding it into MIANALYZE.&amp;nbsp; &amp;nbsp;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 .&amp;nbsp; You will also need to sort the output data set since you will need to run MIANALYZE by the domain variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your goal is to also combine your ESTIMATE statement, then you will need another call to MIANALYZE (with another Proc SORT).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*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;&lt;BR /&gt;run;&lt;BR /&gt;
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;&lt;BR /&gt;
/*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;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Aug 2024 18:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-with-PROC-MIANALYZE-after-regression/m-p/941820#M47021</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2024-08-29T18:07:24Z</dc:date>
    </item>
  </channel>
</rss>

