```Date: Tue, 16 Jan 2007 12:54:33 -0600 Reply-To: Robin High Sender: "SAS(r) Discussion" From: Robin High Subject: Re: Estimate in proc mixed not correctly defined Comments: To: Cornelis Verboom In-Reply-To: <200701161036.l0G6TZj2001236@mailgw.cc.uga.edu> Content-Type: TEXT/PLAIN; charset=US-ASCII > I hope that you are able to provide me the solution of this problem: > > data sp; > input Block A B Y @@; > datalines; > 1 1 1 56 1 1 2 41 > 1 2 1 50 1 2 2 36 > 1 3 1 39 1 3 2 35 > 2 1 1 30 2 1 2 25 > 2 2 1 36 2 2 2 28 > 2 3 1 33 2 3 2 30 > 3 1 1 32 3 1 2 24 > 3 2 1 31 3 2 2 27 > 3 3 1 15 3 3 2 19 > 4 1 1 30 4 1 2 25 > 4 2 1 35 4 2 2 30 > 4 3 1 17 4 3 2 18 > ; > run; > > proc mixed data=sp; > class A B Block; > model Y = A B A*B/e3; > random Block A*Block; > estimate 'a = 1, B = 1' int 1 a 1 0 0 b 1 0/cl; > > run; > > I would like to calculate the estimate of Y (LSmeans score) with level a = > 1, B=1 with corresponding confidence limit (cl). > The estimate statement however, is not properly defined as you may see in > the code. So, can you see the error and why? > Cornelis, You need to add the interaction term to the ESTIMATE statement proc mixed data=sp; class A B Block; model Y = A B A*B / solution e3; random Block A*Block; estimate 'a = 1, B = 1' int 1 a 1 0 0 b 1 0 a*b 1 0 0 0 0 0 /cl; ^^^^^^^^^^^^^^^^^; run; Since factor a appears first on the class statement and has 3 levels, the first two items of the interaction part correspond to a=1 (b=1,2) repeats for each level of a=1,2,3, so if you wanted the estimate of a=3 and b=1 you would enter: estimate 'a = 3, B = 1' int 1 a 0 0 1 b 1 0 a*b 0 0 0 0 1 0 /cl; You can get the same results with the LSMEANS statement, LSMEANS a*b / cl; with far less effort, though knowing how the ESTIMATE statement works comes in very handy at times. Of course, doing this assumes the a*b interaction is 'significant' which is close with these data. Robin High ```

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