| Date: | Wed, 24 May 2006 13:24:31 -0700 |
| 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: Problems using PROC GLM to fit a covariate model |
| In-Reply-To: | <200605241319.k4OAkK3u007615@malibu.cc.uga.edu> |
| Content-Type: | text/plain; format=flowed |
|---|
Chris.Howden@CBR.COM.AU wrote:
>Hi all,
>
>SAS is having some computational problems when fitting a covariate model
>and I'm a little unsure as to wether it's a algorthmic problem or a
>statistical problem.
>
>It's a simple covariate model with 1 covariate and 1 factor with 7
>levels (2 reps in each level).
>
>The covariate varies between levels but NOT within levels...and this
>appears to be the problem. SAS cannot fit this model. However if I
>introduce within level variation of the covariate then SAS can fit the
>model.
>
>This confuses me since I can think of no theoretical reason why a
>covariate needs to have within level variation for the model to be
>valid....hence I'm concluding its an algorithimic problem with SAS.
>
>Any suggestions as to the cause of this error would be greatly
>appreciated.
>
>
>My data set follows (ignore the non-consecutive obs numbers, these
>weren't used in the model)
>
> Obs Factor Covariate
>Response
>
> 1 111 4.4
>1.8181818182
> 3 111 4.4
>2.7272727273
> 7 197 6.0
>2.5454545455
> 8 197 6.0
>2.3636363636
> 9 356 4.7
>1.8
> 10 356 4.7
>2.4
> 11 435 7.4
>1.4
> 12 435 7.4
>1.8
> 13 542 5.7
>2.1818181818
> 14 542 5.7
>1.7272727273
> 15 761 4.7
>2.9090909091
> 16 761 4.7
>2.6363636364
> 17 843 4.9
>2.1818181818
> 18 843 4.9
>2.0909090909
>
What is happening is simple. You are giving SAS two categorical
variables as regressors. If you think about SAS building dummy variables
for each level of FACTOR, then you'll see the problem. Those 0/1
dummy variables are *identical* to the ones that would be built for your
covariate if you turned it into dummy variables too. In other words,
the dummy variables for FACTOR provide a perfect multicollinearity with
your covariate variable. Your design matrix is now singular.
If your covariate does not vary at all within levels of FACTOR, then you
don't have a covariate model. You still have a one-way ANOVA.
HTH,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330
_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
|