Date: Thu, 22 Dec 2005 11:08:15 -0800
Reply-To: David L Cassell <davidlcassell@MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: David L Cassell <davidlcassell@MSN.COM>
Subject: Re: Proc GLM - OLS help
In-Reply-To: <200512212218.jBLMASd5015239@mailgw.cc.uga.edu>
Content-Type: text/plain; format=flowed
chriske2@UFL.EDU wrote:
>I'm trying to run an OLS regression using PROC GLM with category variables.
>Since I usually do my analyses in STATA I've been using PROC REG as a
>baseline check to make sure I'm doing things correctly. My problem is that
>the results do not match when I compare PROC REG with dummy variables and
>PROC GLM with the CLASS option. My code is as follows:
>
>proc reg data=popp2;
> model lnglag = asscode_1-asscode_7 NCL creceive cty_CA cty_DE
>cty_EPO
>cty_FR cty_GB cty_JP cty_OTR ;
>run ;
>
>proc glm data=popp2;
> class asscode ;
> model lnglag = NCL creceive cty_CA cty_DE cty_EPO cty_FR cty_GB
>cty_JP
>cty_OTR ;
>run ;
>
>Any help would be appreciated.
I see that you have already received some excellent advice. I just thought
I would
cough up a little point.
(I am assuming you have fixed that problem with the categorical dummies not
being treated as categorical but as continuous variables.)
SAS doesn't set up its design matrix the same way for a categorical variable
of 7
levels as it does for 7 0/1 dummy variables. You should still get the same
R-squared
and overall F test and such. But you should see differences in the
estimates for the
levels of your categorical variable.
If you want to see this in detail, use PROC GLMMOD to spit out the design
matrix
for asscode, and then to do the same for asscode1-asscode7.
HTH,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/