Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Re: Testing simultaneous effect in PROC MIXED

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

☑ This topic is **solved**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 02-29-2024 03:18 AM
(508 views)

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.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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;
```

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

The Type III tests of fixed effects do, in fact, test the association

of *different

*variables with the dependent variable. If you wanted to test differences

between the levels of the *same* categorical variable, you would use a

CONTRAST or ESTIMATE statement.

of *different

*variables with the dependent variable. If you wanted to test differences

between the levels of the *same* categorical variable, you would use a

CONTRAST or ESTIMATE statement.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

So then maybe MIXED will not supply what is needed as I think the Type I,

II, and III tests are not able to accommodate tests of "simultaneous"

effects of two or more variables.

II, and III tests are not able to accommodate tests of "simultaneous"

effects of two or more variables.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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;
```

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

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.