Certainly!
Dear SAS Community,
I have a question about testing the simultaneous effect of two covariates in PROC MIXED, specifically under the null hypothesis: H0: B1=B2=0. Is there a method to perform this test in SAS? It appears that neither the estimate statement nor the contrast statement provides a straightforward solution for this scenario. It's worth noting that these covariates are distinct variables, not different levels of the same categorical variable.
Additionally, I'm curious if it's feasible to aggregate the results of this hypothesis test across multiple imputed datasets using PROC MIANALYZE.
Use the STORE statement to output your model results to a SAS Item Store. Then read those results into PROC PLM and use the JOINT option on the ESTIMATE statement to produce a joint F test on the hypothesis you are looking for. The code below shows how to do this for 2 covariates. The output from the ESTIMATE statement in PLM will give you the single df test of both estimates (matching the results from the two individual single df ESTIMATE statements) and give you a joint 2 df test that X1=0 and X2=0.
data test;
call streaminit(264737);
do a=1 to 3;
do rep=1 to 10;
x1=rand("normal");
x2=rand("normal");
y=3 + a + .5*x1 + .1*x2 + rand("normal");
output;
end; end;
run;
proc mixed data=test;
class a;
model y=a x1 x2;
store out=mymodel;
run;
proc plm restore=mymodel;
estimate 'x1' x1 1;
estimate 'x2' x2 1;
estimate 'x1 and x2' x1 1, x2 1 / joint;
run;
The test of their effects would be in the "Type III Tests of Fixed Effects" that is part of the standard output of the MIXED procedure. The test of each covariate is after all of the other predictors are included in the model. That is where you'd find your test of B1=B2=0.
This would indeed be the case if it were different levels of the same categorical variable, but the my mean structure is E(Y_{ij})=a+bx+cx^2, and I want to test whether b=c=0.
I think I have to disagree here. SAS only tests whether there is no effect of the independent variables on the dependent variables separately. Note that for a continuous variable, the p-value equals the p-value of the solution of the fixed effects, while for a categorical variable the p-value differs, since it tests whether there is no effect of the categorical variable as a whole.
For clarity, you can find the Type III test table for my analysis below.
Use the STORE statement to output your model results to a SAS Item Store. Then read those results into PROC PLM and use the JOINT option on the ESTIMATE statement to produce a joint F test on the hypothesis you are looking for. The code below shows how to do this for 2 covariates. The output from the ESTIMATE statement in PLM will give you the single df test of both estimates (matching the results from the two individual single df ESTIMATE statements) and give you a joint 2 df test that X1=0 and X2=0.
data test;
call streaminit(264737);
do a=1 to 3;
do rep=1 to 10;
x1=rand("normal");
x2=rand("normal");
y=3 + a + .5*x1 + .1*x2 + rand("normal");
output;
end; end;
run;
proc mixed data=test;
class a;
model y=a x1 x2;
store out=mymodel;
run;
proc plm restore=mymodel;
estimate 'x1' x1 1;
estimate 'x2' x2 1;
estimate 'x1 and x2' x1 1, x2 1 / joint;
run;
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.