Date: Thu, 13 Apr 2006 11:52:14 -0700
Reply-To: Dale McLerran <stringplayer_2@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dale McLerran <stringplayer_2@YAHOO.COM>
Subject: Re: Proc Logistic- Contrast statements
Content-Type: text/plain; charset=iso-8859-1
--- Laurie Bensen <tiggs03@HOTMAIL.COM> wrote:
> I’m running a model in Proc Logistic with a class variable that has
> levels. I used the contrast statement to compare each pair of levels
> (i.e., 1 vs 2, 2 vs 3, 1 vs. 3). However, when I did this there was
> warning in the log that said “Some rows of the L matrix for the
> statement 'habitat' are linearly dependent. These rows will be
> What does this mean? Can I trust the results in the output?
> I’ve tried doing this using different coding schemes (specifying
> and param=effect in the class statement) and get the same warning
> times. Any advice? Thanks!
It sounds as if you are not looking at each pair of levels of
habitat. To look at each pair of levels of habitat, you would use
code such as
contrast "Habitat 1 vs habitat 2"
habitat 1 -1 0;
contrast "Habitat 1 vs habitat 3"
habitat 1 0 -1;
contrast "Habitat 2 vs habitat 3"
habitat 0 1 -1;
Rather, it sounds as if you are constructing code like
contrast "Compare all habitat pairs"
habitat 1 -1 0,
habitat 1 0 -1,
habitat 0 1 -1;
Note that only a single test statistic is coded here. That
test statistic is actually a test for the main effect of CLASSVAR.
As such, it will have 2 degrees of freedom. A 2 df test requires
2 linearly independent rows in the contrast coefficient matrix L.
But you specify three rows for L. Note that any one row of L can
be obtained by adding together the other 2 rows. This is exactly
what the note “Some rows of the L matrix for the CONTRAST statement
'habitat' are linearly dependent. These rows will be ignored.”
is telling you. You can add the first two rows of L and get the
third row. Thus, you do cannot construct a 3 df test - which is
what your code would seem to request since you have three rows
in your L matrix.
Note that SAS does the right thing and ignores one of the rows
of L and then reports the 2 df test for habitat. It also gives you
the warning to let you know that the contrast that you constructed
may not be what you intended. Since you apparently want three
separate pairwise tests and not a test for the main effect of
habitat, you need three separate contrast statements as I first
Fred Hutchinson Cancer Research Center
Ph: (206) 667-2926
Fax: (206) 667-5977
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around