sas >> CONTRAST STATEMENT IN PROC LOGISTIC

by Kevin.F.Spratt » Fri, 15 Oct 2004 02:04:05 GMT

I am running proc logistic with a class statement that generates the
following design variables:

BASEDEF A
-11+ 1 0 0 0 0 0 0 0 0 0
B
-10 0 1 0 0 0 0 0 0 0 0
C
-9 0 0 1 0 0 0 0 0 0 0
D
-8 0 0 0 1 0 0 0 0 0 0
E
-7 0 0 0 0 1 0 0 0 0 0
F
-6 0 0 0 0 0 1 0 0 0 0
G
-5 0 0 0 0 0 0 1 0 0 0
H
-4 0 0 0 0 0 0 0 1 0 0
I
-3 0 0 0 0 0 0 0 0 1 0
J
NO 0 0 0 0 0 0 0 0 0 1
K
NONE -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

Contrast 'A VS B' BASEDEF 1 -1 0 0 0 0 0 0 0 0 / ESTIMATE=EXP ; * GENERATES
THE ODDS RATIO BETWEEN THE A and B levels as expected.

However, to compare A-J combined with K I estimate the contrast as

(1 1 1 1 1 1 1 1 1 1) - 10*(-1 -1 -1 -1 -1 -1 -1 -1 -1 -1) = (11 11
11 11 11 11 11 11 11 11)

or alternatively:

1/10*(1 1 1 1 1 1 1 1 1 1) - (-1 -1 -1 -1 -1 -1 -1 -1 -1 -1) = (1.1
1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.1 1.1)

Contrast 'A-J vs K' BASEDEF 11 11 11 11 11 11 11 11 11 11 / ESTIMATE=EXP;

The overall chi-square tests are the same for the two constrasts but the
parameter estimates are not.

All of the pairwise contrasts, including J vs K generate the expected
results, but when i run
the two versions of the 'A-J vs K' contrasts I get different answers and
neither answer is
consistency with the 2 x 2 table OR generated by collapsing the cells.



I can't seem to remember the method to weight this type of contrast so that
the resultant OR is consistent with the 2 x 2 table.

Any suggestions appreciated.



______________________________________________________________________

Kevin F. Spratt, Ph.D.
Department of Orthopaedic Surgery
Rubin 561
One Medical Center Drive
Lebanon, NH 03756-0001

(603) 653-6012 (voice)
(603) 653-6013 (fax)
XXXX@XXXXX.COM (e-mail)
_______________________________________________________________________


sas >> CONTRAST STATEMENT IN PROC LOGISTIC

by stringplayer_2 » Fri, 15 Oct 2004 03:27:00 GMT


evin,

I believe that if you change from the effects coding to GLM
type coding of the design matrix, you will find that you can
obtain results for the combined A-J effect vs K which are
consistent with results that you obtain from PROC FREQ, although
the results will not be exactly the same. Thus, you would code

proc logistic data=mydata;
class basedef / param=glm;
model <response> = basedef;
contrast "Combined A-J vs K"
basedef .1 .1 .1 .1 .1 .1 .1 .1 .1 .1 -1 / estimate=exp;
run;


For a smaller model, code like the above worked for me. I
don't see right off hand how to obtain the correct results when
using effects coding.

Dale


--- "Kevin F. Spratt" < XXXX@XXXXX.COM > wrote:

______________________________________________________________________
_______________________________________________________________________


=====
---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: XXXX@XXXXX.COM
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------



_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com



sas >> Contrast Statement in PROC LOGISTIC

by JEarley » Thu, 11 Jan 2007 07:34:37 GMT

Is anyone familiar with the coding for the CONTRAST option in PROC
LOGISTIC?

=20

We are estimating Y =3D f( X1, X2, X3) then adding X4 which is a 0/1
dummy.

=20

The task is to make sure that we have the correct coding for the
CONTRAST statement to perform the LR test for

=20

The two models:

=20

y =3D f( x1, x2 and x3) versus Y =3D f( x1, x2, x3 and x4).

=20

Thanks for any code example.

=20

joe


Contrast Statement in PROC LOGISTIC

by robinh » Thu, 11 Jan 2007 08:10:48 GMT

> Is anyone familiar with the coding for the CONTRAST option in PROC

Joe,

You don't need a contrast statement for this test. Just run the model once
with the type3 option with PROC GENMOD

proc genmod data =test ;
model y =x1 x2 x3 x4 / dist=binomial link=log type3;
run;

The output table below is the LR (likelihood ratio) test for adding x4,
given x1-x3 are already in the model

LR Statistics For Type 3 Analysis

Chi-
Source DF Square Pr > ChiSq

x1 1 2.36 0.124572
x2 1 1.36
x3 1 0.62
x4 1 2.96 0.085399 = pvalue
^^^^ ^^^^^^^^


Robin High


Contrast Statement in PROC LOGISTIC

by stringplayer_2 » Thu, 11 Jan 2007 08:12:34 GMT





Joe,

A likelihood ratio test cannot be obtained employing a CONTRAST
statement. If M1 is the model with predictors x1, x2, and x3 and
M2 adds the variable x4 (and x4 is not missing for any observations
which were used in model M1), then the likelihood ratio test is
obtained as

LR = -2(LL(M1) - LL(M2))

where LL(M?) is the log-likelihood of model M?. The value LL(M?) is
reported in a table of Fit Statistics. Under the null hypothesis, LR
is distributed as chi-square with k degrees of freedom, where k is
the number of unconstrained parameters in M2 which are not in M1.

The likelihood ratio test can only be computed if the following
conditions hold: 1) model M1 is nested in model M2 (that is, you
could get model M1 from model M2 simply by fixing some parameters
of M2 to zero); 2) the same response variable set is employed to
fit both model M1 and M2. If there are any observations lost
from the analysis when variable x4 is added to get model M2 from
model M1, then you need to refit model M1 constrained to the same
set of observations which are used to fit model M2. That is easily
accomplished by restricting model M1 to the set of observations
which have nonmissing x4 as shown below:

/* Fit model M2 */
proc logistic data=mydata;
class <x1 x2 x3> x4;
model y = x1 - x4;
run;

/* Fit model M1 constrained to the set of obs used for M2 */
proc logistic data=mydata(where=(missing(x4)=0));
class <x1 x2 x3>;
model y = x1 - x3;
run;


HTH,

Dale

---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: XXXX@XXXXX.COM
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------



____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com


Contrast Statement in PROC LOGISTIC

by kviel » Thu, 11 Jan 2007 10:30:31 GMT

n Wed, 10 Jan 2007, Dale McLerran wrote:


I am glad to be reading your post again, Dale. In fact, I am glad to be
reading *any* post at the moment :)

Being weak on the whole issue of CONTRAST, ESTIMATE, and LSMEANS, I'd like
to disagree with the assertion that a LRT cannot be obtained employing a
CONTRAST statement. The honory member of my committee, Mitch Klein,
directed me to the following use of the CONTRAST statement:

data one ;
do a = 1 to 10 ;
do b = 1 to 10 ;
do c = 1 to 10 ;
d = round( uniform( 1 ) * 10 , 1 ) ;
y = 3 * a + 2 * b + c + rannor( 1 ) ;
output ;
end ;
end ;
end ;
run ;

ods listing close ;
ods output ModelFit = Reduced ;
proc genmod data = one ;
model y = a b c ;
run ;
ods output close ;
ods listing ;

ods output ModelFit = Full ;
proc genmod data = one ;
model y = a b c d ;
contrast "LRT d" d 1 ;
run ;
ods output close ;

data LRT ( drop = Criterion ) ;
merge Reduced ( where = ( Criterion = "Log Likelihood" )
keep = Criterion Value
rename = ( Value = Log_Likelihood_Reduced ))
Full ( where = ( Criterion = "Log Likelihood" )
keep = Criterion Value
rename = ( Value = Log_Likelihood_Full )) ;
chi_squared = -2 * ( Log_Likelihood_Reduced - Log_Likelihood_Full ) ;
p = 1 - probchi( chi_squared , 1 ) ;
run ;

options formdlim = " " ;

proc print data = LRT noobs ;
run ;

ods listing close ;
ods output ModelFit = Reduced ;
proc genmod data = one ;
model y = a b ;
run ;
ods output close ;
ods listing ;

ods output ModelFit = Full ;
proc genmod data = one ;
model y = a b c d ;
contrast "LRT c, d" c 1 , d 1 ;
run ;
ods output close ;


data LRT ( drop = Criterion ) ;
merge Reduced ( where = ( Criterion = "Log Likelihood" )
keep = Criterion Value
rename = ( Value = Log_Likelihood_Reduced ))
Full ( where = ( Criterion = "Log Likelihood" )
keep = Criterion Value
rename = ( Value = Log_Likelihood_Full )) ;
chi_squared = -2 * ( Log_Likelihood_Reduced - Log_Likelihood_Full ) ;
p = 1 - probchi( chi_squared , 2 ) ;
run ;

proc print data = LRT noobs ;
run ;


I could be wrong, but I think that missing values for c and d become less
of an issue than the "manual" version.

Kind regards,

Kevin

Kevin Viel
PhD Candidate
Department of Epidemiology
Rollins School of Public Health
Emory University
Atlanta, GA 30322


Contrast Statement in PROC LOGISTIC

by stringplayer_2 » Fri, 12 Jan 2007 04:11:26 GMT

-- Kevin Roland Viel < XXXX@XXXXX.COM > wrote:


I have not been very active on SAS-L of late, have I. I simply
have not had much time to devote to the list the past 6 months or
so. When I do get time, I am usually too tired to even feel like
corresponding. Sounds like you might be going through a difficult
time right now, too!


Yes, Robin also noted that GENMOD CONTRAST statements produce
likelihood ratio tests. I had not paid attention to that detail,
and am glad to know of it. Of all the procedures in SAS which
have a CONTRAST statement, GENMOD is the only one which actually
constructs a likelihood ratio test. Of course, constructing
LRTs has both an upside and a downside. It can take considerable
extra time to fit the models necessary to obtain likelihood
ratio tests. If you have large data sets and many CONTRAST
statements, your CONTRAST statements could be very time consuming.
Moreover, you may not see much benefit from a LRT compared with
a Wald test when the data volume is large.

There is one other aspect of the GENMOD CONTRAST statement results
which we need to examine. For simple contrasts, the LRT that is
reported by the GENMOD procedure appears to be correct. However,
for more complex contrasts, I cannot state that the GENMOD CONTRAST
statement produces a correct likelihood ratio test. Consider the
code below where we have a normal response and a single predictor
variable A which takes on 5 levels. Suppose that the first level
of A is a control group and the other four levels are all some
experimental conditions. We might want to compare the control
group mean value against the mean value for the four experimental
conditions. The CONTRAST statement which we would employ for this
test would be

contrast "A1 vs all others"
a 4 -1 -1 -1 -1;

The test, then, is of a full model in which we estimate a mean
value for the control group and all four experimental conditions
are restricted to have the same mean value versus a reduced model
in which the mean is identical for all groups including the
control group. The code below generates data and constructs
likelihood ratio tests employing a) PROC GENMOD using the CONTRAST
statement, and b) PROC MIXED fitting full and reduced models. These
two different forms produce different likelihood ratio test values.

/* Generate data */
data test;
do a=1 to 5;
do i=1 to 30;
y=rannor(1234579);
output;
end;
end;
run;


/* Fit model in GENMOD where mean is estimated for all 5 levels */
/* of A and CONTRAST statement compares 1 vs all others */
proc genmod data=test;
class a;
model y = a;
contrast "A1 vs all others"
a 4 -1 -1 -1 -1;
run;


/* Fit CONTRAST full model employing PROC MIXED. A format is used */
/* to convert the 5 level class variable to a 2 level variable. */
proc format;
value a_comb
1 = '1'
2-5 = '2';
run;

ods listing close;
ods output FitStatistics = full ;
proc mixed data=test method=ml;
class a;
model y = a;
format a a_comb.;
run;


/* Fit CONTRAST reduced model */
ods output FitStatistics = reduced ;
proc mixed data=test method=ml;
model y = ;
run;


/* Construct likelihood ratio test from PROC MIXED */
/* and attach at the end of the GENMOD listing */
data LRT;
merge Reduced ( where = ( descr = "-2 Log Likelihood" )
rename = ( Value = N2Log_Likelihood_Reduced ))


Contrast Statement in PROC LOGISTIC

by tanwan » Fri, 12 Jan 2007 08:58:33 GMT

Example No. 4 at http://support.sas.com/faq/044/FAQ04460.html #ex4
suggests that you can use the contrast statement, BUT this leads to a
Wald test, not a LR test. In any case, in large samples the two tests
are equivalent. Before that you will need to be able to write the
<contrast> statement, which I confess I do not know how to.

There are alternative approaches though, as Example No. 4 ably
demonstrates.

Tanwan



Contrast Statement in PROC LOGISTIC

by robinh » Sat, 13 Jan 2007 04:47:48 GMT

his is a followup note to the recent thread on computing the likelihood
ratio tests with a CONTRAST statement. It also corrects a typo I made a
couple of days ago in my first comment.

The approach uses the idea of computing F-tests in an ANOVA table with
continuous data. The same F-test results can be achieved with CONTRAST
statements for main effects (and also interactions) when you structure the
CONTRAST statement with a set of independent contrasts.

For example, with a 3-level categorical variable and y continuous:

proc mixed data=test2 ;
class a;
model y = a ;

* enter 3 independent contrasts for factor A;
contrast "A"
a 1 -1 0 0,
a 1 0 -1 0,
a 1 0 0 -1;
run;

PRODUCES:

Type 3 Tests of Fixed Effects

Num Den
Effect DF DF F Value Pr > F
a 3 116 2.89 0.038630

Contrasts

Num Den
Label DF DF F Value Pr > F
A 3 116 2.89 0.038630



Returning to an example of logistic regression (y=0/1):

/* Fit logistic regr model in GENMOD where mean is estimated
for all 4 levels of A and CONTRAST statement compares
all independent pairwise contrasts */

PROC GENMOD data=test;
CLASS a;
MODEL y = a x1 x2 / dist=binomial link=logit type3;
* ^^^^^^^^^^
* NOTE: in a previous note, I mistakenly entered LINK=log ! :

* since factor A has 4 levels, enter three independent contrasts;

contrast "A: LR"
a 1 -1 0 0,
a 1 0 -1 0,
a 1 0 0 -1;

* for continuous data the CONTRAST statement by default
provides a LR test that the observed coefficient = 0;

contrast 'x1' x1 1;
contrast 'x2' x2 1;

* to get WALD tests of the same contrasts, add the wald option;

contrast "A: wald"
a 1 -1 0 0,
a 1 0 -1 0,
a 1 0 0 -1 / wald ;
contrast 'x1' x1 1 / wald;
contrast 'x2' x2 1 / wald ;
run;


This gives the following output from TYPE3 option on MODEL statement;

LR Statistics For Type 3 Analysis

Chi-
Source DF Square Pr > ChiSq

a 3 9.28 0.025830
x1 1 0.01 0.920241
x2 1 1.62 0.202783


You'll see the type3 results match the CONTRAST statements for the LR type
below:

Contrast Results
Chi-
Contrast DF Square Pr > ChiSq Type

A: LR 3 9.28 0.025830 LR
x1 1 0.01 0.920241 LR
x2 1 1.62 0.202783 LR

A: wald 3 8.68 0.033789 Wald
x1 1 0.01 0.920257 Wald
x2 1 1.58 0.209182 Wald


The Contrasts with the WALD option match the output from PROC LOGISTIC


PROC LOGISTIC data=test;
CLASS a / param=glm;
MODEL y = a x1 x2;

* ENTER the same contrasts from GENMOD;

contrast 'x1' x1 1;
contrast 'x2' x2 1;
contrast "A"
a 1 -1 0 0,
a 1 0 -1 0,
a 1 0 0 -1;
run;


Type 3 Analysis of Effects

Wald
Effect DF Chi-Square Pr > ChiSq

a 3 8.6845 0.033794
x1 1 0.0100 0.920260
x2 1 1.5769 0.209202


Contrast Test Results
Wald
Contrast DF Chi-Square Pr > ChiSq

contrast statement in proc logistic

by Jerry » Wed, 10 Jun 2009 04:32:47 GMT

Dear SAS-L,

I have struggled to find the correct contrast statement since after
submitting the following code,I have many warnings like ' WARNING:
More coefficients than levels specified for effect area. Some
coefficients will be ignored'.

PROC LOGISTIC DATA=GAST.CAT(where=(not missing(state))) DESC;
FREQ count;
class region PRACTICE area ;
model disease= region PRACTICE area practice*area /CL CLODDS=BOTH ;
format region regn. area area. practice acad.;
CONTRAST 'AREA Rural vs urb' area 1 0 /ESTIMATE=both;
CONTRAST 'AREA Sub vs Urb' area 0 1 -1/ESTIMATE=both;
CONTRAST 'AREA Rural vs urb' area 1 0 -1/ESTIMATE=both;
contrast 'Area Rural vs Sub' area 1 -1 0/ESTIMATE=both;
contrast 'practice' practice 1 -1/ESTIMATE=both;
contrast 'urb vs rurual in academy ' area 1 0 -1 practice*area 1 0 -1
0 0 0/ESTIMATE=both;
contrast 'Sub vs rurual in academy ' area 1 -1 0 practice*area 1 -1
0 0 0 0/ESTIMATE=both;
run;

The categorical variables are:
region: 9 levels;
practice: academy and private 2 level;
area: rural, suburban and urban 3 levels;

Any suggestion or reference?

Thanks!








contrast statement in proc logistic

by rhigh » Wed, 10 Jun 2009 04:44:51 GMT

Jerry,

You could try adding an option on the CLASS statement which calls for GLM
like coding:

class region PRACTICE area / param=glm;

since by default, LOGISTIC applies effect coding, implying the
coefficients add to 0, and the number of placeholders entered on CONTRAST
statements is one less than the actual number of levels.

Robin High
UNMC




Jerry < XXXX@XXXXX.COM >
Sent by: "SAS(r) Discussion" < XXXX@XXXXX.COM >
06/09/2009 03:37 PM
Please respond to
Jerry < XXXX@XXXXX.COM >


To
XXXX@XXXXX.COM
cc

Subject
contrast statement in proc logistic






Dear SAS-L,

I have struggled to find the correct contrast statement since after
submitting the following code,I have many warnings like ' WARNING:
More coefficients than levels specified for effect area. Some
coefficients will be ignored'.

PROC LOGISTIC DATA=GAST.CAT(where=(not missing(state))) DESC;
FREQ count;
class region PRACTICE area ;
model disease= region PRACTICE area practice*area /CL CLODDS=BOTH ;
format region regn. area area. practice acad.;
CONTRAST 'AREA Rural vs urb' area 1 0 /ESTIMATE=both;
CONTRAST 'AREA Sub vs Urb' area 0 1 -1/ESTIMATE=both;
CONTRAST 'AREA Rural vs urb' area 1 0 -1/ESTIMATE=both;
contrast 'Area Rural vs Sub' area 1 -1 0/ESTIMATE=both;
contrast 'practice' practice 1 -1/ESTIMATE=both;
contrast 'urb vs rurual in academy ' area 1 0 -1 practice*area 1 0 -1
0 0 0/ESTIMATE=both;
contrast 'Sub vs rurual in academy ' area 1 -1 0 practice*area 1 -1
0 0 0 0/ESTIMATE=both;
run;

The categorical variables are:
region: 9 levels;
practice: academy and private 2 level;
area: rural, suburban and urban 3 levels;

Any suggestion or reference?

Thanks!


contrast statement in proc logistic

by Jerry » Wed, 10 Jun 2009 21:12:28 GMT



> ONTRAST 'AREA Sub vs Urb' area 0 1 -1/ESTIMATE=bot>;
> ONTRAST 'AREA Rural vs urb' area 1 0 -1/ESTIMATE=bot>;
> ontrast 'Area Rural vs Sub' area 1 -1 0/ESTIMATE=bot>;
> ontrast 'practice' practice 1 -1/ESTIMATE=bot>;
> ontrast 'urb vs rurual in academy ' area 1 0 -1 practice*area 1 0 >1
> 0 0 0/ESTIMATE=bot>;
> contrast 'Sub vs rurual in academy ' area 1 -1 0 practice*area 1>-1
> 0 0 0 0/ESTIMATE=bo>h;
> r>n;> >
> The categorical variables a>e:
> region: 9 leve>s;
> practice: academy and private 2 lev>l;
> area: rural, suburban and urban 3 leve>s;> >
> Any suggestion or referen>e?> >
> Thanks!

Robin,

Thanks for your detail explanation. It works.

Best,
Jerry



Similar Threads

1. PROC LOGISTIC Contrast statements

Hello,

I do not know how to use the contrast statement of the proc logistic.

I have a study with 3 groups of treatments: Placebo, Drug_100mg and
Drug_200mg (so I compare the study drug at 2 doses and the placebo).

I want to compare the drug (100mg and 200mg) versus placebo and I use
the Placebo as the reference in the contrast.
So I code my treatment variable called TRT like this:
   1: Drug_100mg
   2: Drug_200mg
   3: Placebo

I propose 3 choices:
  1) CONTRAST "Treatment" TRT 0 1,
                                          TRT 1 0;

  2) CONTRAST "Treatment" TRT 3 3;

  3) Other possibility ?

Thanks for your help.


2. Proc Logistic- Contrast statements

3. FW: Proc logistic contrast statement

> I am having trouble constructing the correct contrast statement.  The
> code is below.  The response variable is POST_REG_ICH.  There are
> several main effects and two interaction effects.  One of the
> interaction effects is PFOPHY X HIV_POS.  I want a contrast statement
> that will generate the O.R. for the effect of PROPHY on POST_REG_ICH
> when HIV_POS=3D1,  controlling or adjusting for all other predictors,
> and another contrast statement for when HIV_POS=3D0.
>=20
> The second interaction term is PROPHY X INHIBITOR.  INHIBITOR has
> three levels.  I want a contrast statement that will generate the O.R.
> for the effect of PROPHY on POST_REG_ICH,  controlling or adjusting
> for all other predictors,   for each of the three levels of INHIBITOR.
>=20
>=20
> See code below.  Are the contrast statements giving me what I want? =20
>=20
> Thanks for your help and insight.
>=20
> Rodney
>=20
> proc logistic data=3Dlogreg desc simple ;
>       class prophy home_infusion home_infusion
>               pre_reg_ich htype hlevel(ref=3D'Mild') hiv_pos hepab_pos
>               hepac_pos alcohol elevated_pt
>               inhibitor(ref=3D'None') race_g(ref=3D'White (non-Hispanic)')
>               penultimate_age_group(ref=3D'10--15') / desc param=3Dref ;
>       model post_reg_ich=3Dprophy home_infusion pre_reg_ich htype hlevel
> inhibitor=20
>                       hiv_pos hepab_pos hepac_pos alcohol elevated_pt
> race_g=20
>                       penultimate_age_group  prophy*inhibitor
>                       prophy*hiv_pos=20
>                       / /*include=3D13 selection=3Dstepwise */ lackfit
> scale=3Dnone aggregate ;=09
>               contrast 'Prophy X HIV_pos' prophy 1 hiv_pos 1
> prophy*hiv_pos 1 0
>               contrast 'Prophy X HIV_negative' prophy 1 hiv_pos 0 /
> estimate=3Dboth;
>               contrast 'Prophy X High Inhibitor' prophy 1 inhibitor 0
> 1 / estimate=3Dboth;
>               contrast 'Prophy X Low inhibitor' prophy 1 inhibitor 1 0
> / estimate=3Dboth;
>               contrast 'Prophy X No inhibitor'  prophy 1 inhibitor 0 0
> / estimate=3Dboth;
> run;=20
>=20
>=20
>=20
> Rodney J. Presley, PhD
> Division of Hereditary Blood Disorders
> National Center on Birth Defects and Developmental Disabilities
> Centers for Disease Control and Prevention
> 1600 Clifton Road, MS E 64
> Atlanta, GA 30333
> Work Phone: 404-718-8630
> Main Number: 404-718-8600
> Fax: 404-718-8650
> Email:  XXXX@XXXXX.COM 
>=20
>=20

4. Contrast statements for interaction effects in Proc Logistic

5. Contrast statments in Proc Logistic

I running a model in Proc Logistic with a class variable that has three
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 a
warning in the log that said ome rows of the L matrix for the CONTRAST
statement 'habitat' are linearly dependent. These rows will be ignored.
What does this mean?  Can I trust the results in the output?
Ie tried doing this using different coding schemes (specifying param=glm
and param=effect in the class statement) and get the same warning both
times.  Any advice?  Thanks!

6. polynomial contrast in proc logistic

7. contrast statements and proc GLM code problem

person is not on SAS L

is there any good references on proc GLM and how to set up contrast statements?
I've sent info on archives, but that and the manual is not real clear.

thanks.
-----Original Message-----
From: Kraft, Ottalee (UMC-Student) 
Sent: Monday, August 11, 2003 5:46 PM
Subject: SAS Contrast Statements


After working with Ron today I have solved some of my SAS problems but I am still stuck on the contrast statements to get the comparisons I want.  My class variable, Type represents 4 conditions.  I want to be able to compare Type 1 to Types 2, 3, and 4 combined; to compare Type 2 to Types 3 and 4 combined; to compare Type 3 to Type 4.   Ron initially helped me set up some IF statements to break my data by type and then run the proc glm.  However, as I understand statistical comparisions, this partitioning of my data will result in incorrect analyses.  I have a couple of questions I need help with:
     1. How do I set up the contrast statements in SAS to do the comparisions I need?
     2. Is the repeated measures ANOVA or the MANOVA preferable for any reason?  I seem to get comparable results.
     3. I will need to add some additional covariates to these models ( age,  gender, and a couple of yes/no type responses).  Does this change your responses to questions 1 & 2?

The code I have set up so far is:
____________________________
**REPEATED MEASURES ANOVA**
____________________________
proc glm data=diss;
class Type;
model RatingMHCX
      RatingMHCY
      RatingMHCZ = Type / nouni;
repeated rating 3 contrast (1) / summary;
lsmeans Type / stderr pdiff cov out=adjmeans;
title1 'results of repeated measures glm';
quit;
run;

__________________________
**         MANOVA       **
__________________________
proc glm data=diss;
class Type;
model RatingMHCX
      RatingMHCY
      RatingMHCZ = Type;
means Type / Tukey;
means Type;
manova H = Type;
title1 'results of glm -- manova';
quit;
run;


**********************************************************************
This electronic communication is from the Missouri Department of Health and Senior Services and is confidential, privileged and intended only for the use of the recipient named above.  If you are not the intended recipient or the employee or agent responsible for delivering this information to the intended recipient, unauthorized disclosure, copying, distribution or use of the contents of this transmission is strictly prohibited.  If you have received this message in error, please notify the sender immediately at the following email address:  XXXX@XXXXX.COM  or by calling (573) 751-6400..  Thank you.
**********************************************************************

8. Contrast/Estimate statement PROC MIXED