LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 11 Nov 2005 13:50:30 -0800
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: about contrast in PROC NLMIXED
In-Reply-To:   <>
Content-Type:   text/plain; charset=iso-8859-1

--- Tony Yang <tonyyangsxz@GMAIL.COM> wrote:

> Dear Listers; > One more question about PROC NLMIXED, if I have a nominal variable > COLOR, > which has 4 levels, and re-set another three variables for COLOR, > color1, > color2, color3(letting level 4 as reference), then I include these > three > variables in the modelling. > My question is, if I want to test if there is difference between > color1 and > color2, color1 and color 3, color2 and color3, then how should I do > this > analysis? > I tried the following code, > contrast "b1=b2" b1 1 b2 -1; > contrast "b1=b3" b1 1 b3 -1; > contrast "b2=b3" b2 1 b3 -1; > there are error for this coding, hence I tried in SAS direction > > contrast "b1=b2" b1 +1, b2 -1; > contrast "b1=b3" b1 +1, b3 -1; > contrast "b2=b3" b2 +1, b3 -1; > they works, while according to the syntax notes for contrast in PROC > NLMIXED, it seems SAS is doing the simulaneous test for b1=-1 and > b2=1, etc. > > Then I am not sure how to do this further, any suggestions will be > appreciated. Thanks in advance for your time. > > -- > Best regards, > Tony >


The CONTRAST statement in NLMIXED does not follow the same construction principals as, say, the GLM CONTRAST statement. In GLM, you name an effect followed by the contrast coefficients for each level of the effect. In NLMIXED, you use regular data step type code to construct an equation for each orthogonal contrast. The NLMIXED contrast statement has similarity to the GLM contrast statement in that commas are employed to indicate additional linear combination which are employed to construct a multiple df hypothesis test.

The correct code to test whether the parameters b1=b2, b1=b3, and b2=b3 would be as follows:

contrast "b1=b2" b1 - b2; contrast "b1=b3" b1 - b3; contrast "b2=b3" b2 - b3;

Let me make one other note about the NLMIXED contrast statement. You can perform an omnibus test that b1=b2=b3=0 by specifying

contrast "Omnibus test for COLOR" b1, b2, b3;

Now, it might also be instructive to examine just what was coded by your CONTRAST statements which "worked". You coded

contrast "b1=b2" b1 +1, b2 -1; contrast "b1=b3" b1 +1, b3 -1; contrast "b2=b3" b2 +1, b3 -1;

First, we see that each of these is a multiple df test because of the commas which separate each linear combination. The two linear combinations of the first contrast statement are

1 - H0: b1 + 1 = 0 OR b1 = -1 2 - H0: b2 - 1 = 0 OR b2 = 1

Since there are two independent linear combinations, then you get the simultaneous test that b1=-1 and b2=1, just as you indicated.


--------------------------------------- Dale McLerran Fred Hutchinson Cancer Research Center mailto: Ph: (206) 667-2926 Fax: (206) 667-5977 ---------------------------------------

__________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005

Back to: Top of message | Previous page | Main SAS-L page