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

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- PROC GLM vs. PROC REG

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-27-2014 11:05 AM

I want to do Multivariate Multiple Regression test that simultaneously tests all regression parameters to be zero.

I can do this in PROC REG, but I can't figure out if it is possible to do perform the calculation using PROC GLM.

Below is a minimial working example. I want an invocation of GLM which gives me Wilks test:

` Statistic Value F Value Num DF Den DF Pr > F `

Wilks' Lambda 0.86889685 3.49 4 192 0.0088

The actual value will depend on the simulation.L

Can this be done?

`data thedata(keep=x1 x2 x3 x4);`

retain seed 0;

do i=1 to 100;

x1 = rannor(seed);

x2 = rannor(seed);

x3 = rannor(seed);

x4 = rannor(seed);

output;

end;

run;

PROC REG DATA=thedata;

MODEL x1 x2 = x3 x4;

MTEST x3,x4;

RUN;

Accepted Solutions

Solution

03-27-2014
12:49 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-27-2014 12:49 PM

I believe that in PROC GLM you need to use a CONTRAST statement before the MANOVA statement, something like

CONTRAST 'All Zero' x3 1,x4 1;

All Replies

Solution

03-27-2014
12:49 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-27-2014 12:49 PM

I believe that in PROC GLM you need to use a CONTRAST statement before the MANOVA statement, something like

CONTRAST 'All Zero' x3 1,x4 1;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-27-2014 03:28 PM

This does exactly what I wanted. Thanks a lot.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-27-2014 01:47 PM

Another option is Proc CALIS with a path analysis model.

If don't want to restrict the paths to be equal for X1 and X2,

use different path names.

ods html path="c:\temp"; ods graphics on;

proc calis data=thedata method=ml kurtosis modification plots=residuals effpart;

path

X3 X4 ---> X1= P_X3_X1N2 P_X4_X1N2 ,

X3 X4 ---> X2= P_X3_X1N2 P_X4_X1N2;

var X1-X4;

TestPath=P_X3_X1N2 - P_X4_X1N2;

testfunc TestPath;

run;

ods graphics off; ods html close;

I think the test statistic will be a Wald statistic.

Hope this helps.

Brandy

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-27-2014 03:31 PM

I'm not familiar with PROC CALIS, so I at the moment so I can't tell if it performs the test I'm looking for - but

this is definitely helpful and worth looking into.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-27-2014 04:01 PM

I'm not all that familiar with PROC CALIS either, but I have two concerns

- For those of us who have a background of fitting linear models via regression and ANOVA, the use of PROC GLM and PROC REG seems as natural as waking up in the morning. The use of PROC CALIS to do the same seems as natural to us as trying to chop vegetables with a power saw. Of course, I do know that PROC CALIS does allow you to fit a linear regression and perform these tests, I'm simply saying it doesn't flow smoothly to my brain, and it would probably take me 2 hours to figure out how to get PROC CALIS to give me what I could get in 5 minutes from PROC REG or PROC GLM.
- The proposed test in PROC CALIS appears to be the difference between the two coefficients, and this is not the same as testing whether or not the two coefficients are both zero.