Help using Base SAS procedures

PROC GLM vs. PROC REG

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

PROC GLM vs. PROC REG

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
Trusted Advisor
Posts: 1,615

Re: PROC GLM vs. PROC REG

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;

View solution in original post


All Replies
Solution
‎03-27-2014 12:49 PM
Trusted Advisor
Posts: 1,615

Re: PROC GLM vs. PROC REG

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;

New Contributor
Posts: 3

Re: PROC GLM vs. PROC REG

This does exactly what I wanted. Thanks a lot.

Occasional Contributor
Posts: 7

Re: PROC GLM vs. PROC REG

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   

New Contributor
Posts: 3

Re: PROC GLM vs. PROC REG

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.

Trusted Advisor
Posts: 1,615

Re: PROC GLM vs. PROC REG

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

  1. 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.
  2. 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.
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 927 views
  • 3 likes
  • 3 in conversation