Re: Contrasts

From: jason <asremlforum_at_VSNI.CO.UK>
Date: Fri, 10 Jul 2009 02:20:54 +0100

cullisb wrote:
> Dear jason
> It worked great and had the same results as using "!CONTRAST n1 Nitrogen -1 0 0 1" in ASReml. Thanks!
>
> Could you also please shed me some light on how to setup contrasts with interaction terms, say "Variety_Marvellous vs. Variety_Victory in Nitrogen_0.2_cwt"? I believe that the contrast involves both the Variety effect and the Variety by Nitrogen interaction.
> ****this is simple, and only requires you to not fit the main effect of Nitrogen. SO form the
>
> v1<- V-M - V_V contrast as in the text script and simply fit v1 + Variety + v1:Nitrogen + Variety:Nitrogen and then the effects for both interaction terms should be nested within Variety. This follows from the definition of
>
> A/B = A + A:B
>
> where B is "nested on" A
>
>
> warm regards
>
> Brian Cullis
> Research Leader, Biometrics &
> Senior Principal Research Scientist
> NSW Department of Primary Industries
> Wagga Wagga Agricultural Institute

Dear Brian,

Thanks, and sorry to keep bothering you. Does the "v1" your mentioned refer to the following?

Code:
temp$v1 <-(temp$Variety=='Marvellous' & temp$Nitrogen=='0.2_cwt') -
          (temp$Variety=='Victory' & temp$Nitrogen=='0.2_cwt')

Fitting the following model
Code:
temp.asr <- asreml(yield ~ v1 + Variety + v1:Nitrogen + Variety:Nitrogen,
                   random = ~ Blocks/Wplots, data=temp)

did not give me a similar result of the contrast as reported from SAS:
Code:
proc mixed data=oats;
        class Blocks Nitrogen Subplots Variety Wplots;
        model yield = Variety Nitrogen Nitrogen*Variety;
        random Blocks Wplots(Blocks);
        contrast "Marvellous vs Victory in 0.2_cwt" Variety 0 1 -1
                                     Nitrogen*Variety 0 1 -1 0 0 0 0 0 0 0 0 0;
run;

Code:
                                                     Num Den
                Label DF DF F Value Pr > F

                Marvellous vs Victory in 0.2_cwt 1 45 3.76 0.0588

Had I made any stupid mistakes?

Jason

-------------------- m2f --------------------

Sent using Mail2Forum (http://www.mail2forum.com).

Read this topic online here:
http://www.vsni.co.uk/forum/viewtopic.php?p=646#646

-------------------- m2f --------------------
Received on Sat Jul 10 2009 - 02:20:54 EST

This webpage is part of the ASReml-l discussion list archives 2004-2010. More information on ASReml can be found at the VSN website. This discussion list is now deprecated - please use the VSN forum for discussion on ASReml. (These online archives were generated using the hypermail package.)