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
Content-Type: text/plain; format=flowed
>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_FR cty_GB cty_JP cty_OTR ;
>proc glm data=popp2;
> class asscode ;
> model lnglag = NCL creceive cty_CA cty_DE cty_EPO cty_FR cty_GB
>Any help would be appreciated.
I see that you have already received some excellent advice. I just thought
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
levels as it does for 7 0/1 dummy variables. You should still get the same
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
for asscode, and then to do the same for asscode1-asscode7.
David L. Cassell
3115 NW Norwood Pl.
Corvallis OR 97330
Express yourself instantly with MSN Messenger! Download today - it's FREE!