Hello,
I am currently working on this multiple imputation procedure, and all went well except for Proc Mianalyze for Type 3 tests of fixed effects. I have attached my log and code below. Thank you in advance!
proc mixed data=longyr0;
class id tert_meddiet0(ref='0') diabetes0(ref='0') education0(ref='0') smoke0(ref='0') sex(ref='1') center(ref='1') ;
model wm= tert_meddiet0 icv age0 bmi0 glucose0 hdl0 ldl0 pact0 trig0 dbp0 sbp0 diabetes0 education0 smoke0 sex center tert_meddiet0*time/
s chisq ;
repeated/ type=un subject=id;
by _imputation_;
ods output solutionf=mixedyr0 tests3=pvalyr0 ;
run; quit;
proc mianalyze data=pvalyr0;
class effect;
modeleffects effect;
run;
705 proc mianalyze data=pvalyr0;
706 class effect;
707 modeleffects effect;
708 run;
ERROR: The input TYPE= data set is not a valid data set without specifying variables for standard
errors in the STDERR statement.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE MIANALYZE used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
You need specify STDERR statement.
proc mianalyze data=pvalyr0;
class effect;
modeleffects effect;
stderr stderr ;
run;
Hello,
It didn't work because it says that stderr is not in the dataset. Is there another way to go about this without the stderr option?
Thank you.
75 proc mianalyze data=pvalyr0; 76 class effect; 77 modeleffects effect; 78 stderr; 79 run; ERROR: The input TYPE= data set is not a valid data set without specifying variables for standard errors in the STDERR statement. NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE MIANALYZE used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
You missed a STDERR variable named stderr . or you could open your dataset and see which variable stands for stderr .
proc mianalyze data=pvalyr0; class effect; modeleffects effect; stderr stderr ; run;
BTW, if there are no stderr variable in dataset, you can not play it with proc mianalyze.
I checked your test3= dataset, there is no stderr ,so you can't do it with proc mianalyze .
Have you tried passing the parameter estimates to MIANALYZE?
That would look like see this example: :
proc mianalyze parms(classvar=full)=mixedyr0;
class id tert_meddiet0(ref='0') diabetes0(ref='0') education0(ref='0') smoke0(ref='0') sex(ref='1') center(ref='1');
modeleffects intercept tert_meddiet0 icv age0 bmi0 glucose0 hdl0 ldl0 pact0 trig0 dbp0 sbp0 diabetes0 education0 smoke0 sex center tert_meddiet0*time;
run;
This follows the example at https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/statug/statug_mianalyze_examples08.htm
SteveDenham
As far as the Type3 test is concerned, unfortunately, there is no way currently to combine Type3 or CONTRAST tests from MIXED. I have not come across any papers presenting a general methodology on how this could be done. If you happen to find a reference, I would appreciate you passing it along.
From a syntax point of view, you could dummy code the CLASS variable prior to running Proc MIXED and then use the TEST statement in Proc MIANALYZE to get an overall test. Something like the example below would at least show you how it would be coded. But this approach assumes that doing so would be statistically valid, which no one to my knowledge has verified. It essentially treats them as it would any other joint test for parameters and applies the multivariate approach of joint tests using multiply imputed data.
/*Creating Sample Data--Assume that the imputation has already been performed*/
data test;
do _imputation_=1 to 5;
do rep=1 to 100;
do x=1 to 3;
do z=1 to 2;
y=-2+.2*x-.2*z+1.6*x*z+rannor(123);
output;
end;
end;
end;
end;
run;
/*Create the Dummy variables and interactions for X and Z*/
data test;
set test;
x1=(x=1);
x2=(x=2);
z1=(z=1);
x1z1=x1*z1;
x2z1=x2*z1;
run;
proc mixed data=test;
by _imputation_;
model y=x1 x2 z1 x1z1 x2z1/ solution covb;
ods output SolutionF=parms covb=covb;
run;
proc mianalyze parms=parms covb(effectvar=rowcol)=covb;
modeleffects Intercept x1 x2 z1 x1z1 x2z1;
interaxntest:test x1z1=0, x2z1=0/mult;
run;
Hi,
OP want combine Type 3 ANOVA table as following, As far as I know it is impossible since there is no stderr for F value ,right ?
Correct. You would have to create the joint tests for the Type 3 hypotheses by using the Parameter Estimates and the TEST statement in MIANALYZE.
@Ksharp --see my reply above. There isn't a way to combine the F-statistics. What I was proposing was a way to get combined tests based on Type3 hypotheses, but there is not a widely accepted way in the literature to combine the actual F-statistics the way there is to combine Chi-Squares.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.