Date: Tue, 31 Mar 2009 14:47:22 -0500
Reply-To: Robin R High <rhigh@UNMC.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Robin R High <rhigh@UNMC.EDU>
Subject: Re: non-estimable contrast
In-Reply-To: <200903311858.n2VGT1df031901@malibu.cc.uga.edu>
Content-Type: text/plain; charset="US-ASCII"
Jen,
It oftens helps to write out complete statements with all the model
parameters (with relevant covariate values) and then subtract the first
two lines to get the contrast of interest:
contrast "alcuse 2 at nondaily_7=0" intercept 1 adol 5 sex 1 smkgt1yr
1 quand 2 alcuse 0 1 0 0 nondaily_7 1 0 nondaily_7*alcuse 0 0 1 0 0 0 0
0 / estimate ;
contrast "alcuse 1 at nondaily_7=0" intercept 1 adol 5 sex 1 smkgt1yr
1 quand 2 alcuse 1 0 0 0 nondaily_7 1 0 nondaily_7*alcuse 1 0 0 0 0 0 0
0 / estimate ;
contrast "alcuse 1 vs alcuse 2 at nondaily_7=0" alcuse -1 1 0 0
nondaily_7*alcuse -1 0 1 0 0 0 0 0 / estimate;
Also, since alcuse is first on the CLASS statement with GLM coding, the
interaction order the eight placeholders is interpreted as:
alcuse 1 2 3 4
ondaily_7 0 1 0 1 0 1 0 1
contrast "alcuse 1 vs alcuse 3 at nondaily_7=0" alcuse -1 0 1 0
nondaily_7*alcuse -1 0 0 0 1 0 0 0 / estimate;
contrast "alcuse 1 vs alcuse 4 at nondaily_7=0" alcuse -1 0 0 1
nondaily_7*alcuse -1 0 0 0 0 0 1 0 / estimate;
Robin High
UNMC
Jennifer Rose <jrose01@WESLEYAN.EDU>
Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
03/31/2009 02:09 PM
Please respond to
Jennifer Rose <jrose01@WESLEYAN.EDU>
To
SAS-L@LISTSERV.UGA.EDU
cc
Subject
non-estimable contrast
Hi,
I'm trying to run a logistic regression analysis where my two variables of
interest are a 4 category variable (alcuse) and a 2 category variable
(nondaily_7). I'm interested in testing the difference between categories
of
alcuse for nondaily_7 = 0. However, I'm running into a problem where I get
an estimate for my first contrast (alcuse 1 vs alcuse 2 at nondaily_7=0),
but my contrasts comparing levels 1 & 3 and 1 & 4 are non-estimable. I've
posted my code below. Can anyone see where I might be going wrong. Thanks
in
advance for your help.
Jen
proc surveylogistic data=smkalc.pastyralc;
class alcuse nondaily_7 /param=glm;
cluster verep;
model incrs_b(event='1')=adol sex smkgt1yr quand nondaily_7 alcuse
nondaily_7*alcuse;
strata vestr;
weight analwt_comb;
contrast "alcuse 1 vs alcuse 2 at nondaily_7=0" alcuse -1
1
0
0
nondaily_7*alcuse -1 0
1 0
0 0
0 0/ estimate;
contrast "alcuse 1 vs alcuse 3 at nondaily_7=0" alcuse -1
0
1
0
nondaily_7*alcuse -1 0
1 0
0 0
0 0/ estimate;
contrast "alcuse 1 vs alcuse 4 at nondaily_7=0" alcuse -1
0
0
1
nondaily_7*alcuse -1 0
1 0
0 0
0 0/ estimate; run;