Re: Contrasts

From: <brian.cullis_at_DPI.NSW.GOV.AU>
Date: Thu, 9 Jul 2009 21:02:54 +1000

Dear jason
sorry the implementation is not there. We have decided to avoid the use of
contrasts() in ASReml-R for good reasons.

We use reflexive generalised inverses to obtain a non-unique solution to
the mixed model equations. These have useful properties and in doing this
we avoid problems which other packages can run into with user enforced
constraints, such as sum zero or others. It is still quite simple to set
up any sort of contrasts you wish as long as you are aware of the
potential perils of this

An example of this is given here where I use dummy variates to partition
the 3 df for Nitrogen into 1 for 1vs4 and 2 for the rest. ASReml
gracefully handles this with and you will see that 2 of the effects
associated with Nitrogen have been aliased.
I hope this makes it clear.

require(asreml)
temp <- oats
temp$n1 <- as.numeric(temp$Nitrogen)
temp$n1 <- as.numeric(temp$n1==4) - as.numeric(temp$n1==1)
temp.asr <- asreml(yield~Variety + n1 + Nitrogen + Variety:n1 +
Variety:Nitrogen,
                   random=~Blocks/Wplots,data=temp)
wald(temp.asr)
> coef(temp.asr)$fi
                                         effect
Variety_Golden_rain:Nitrogen_0.2_cwt 0.000000
Variety_Golden_rain:Nitrogen_0.4_cwt 0.000000
Variety_Golden_rain:Nitrogen_0.6_cwt 0.000000
Variety_Golden_rain:Nitrogen_0_cwt 0.000000
Variety_Marvellous:Nitrogen_0.2_cwt 0.000000
Variety_Marvellous:Nitrogen_0.4_cwt 0.000000
Variety_Marvellous:Nitrogen_0.6_cwt -0.500000
Variety_Marvellous:Nitrogen_0_cwt 11.666667
Variety_Victory:Nitrogen_0.2_cwt 0.000000
Variety_Victory:Nitrogen_0.4_cwt 0.000000
Variety_Victory:Nitrogen_0.6_cwt -2.500000
Variety_Victory:Nitrogen_0_cwt -9.666667
Variety_Golden_rain:n1 0.000000
Variety_Marvellous:n1 -7.500000
Variety_Victory:n1 5.000000
Nitrogen_0.2_cwt 0.000000
Nitrogen_0.4_cwt 0.000000
Nitrogen_0.6_cwt 10.166667
Nitrogen_0_cwt -50.833333
n1 16.166667
Variety_Golden_rain 0.000000
Variety_Marvellous 2.500000
Variety_Victory -3.833333
(Intercept) 114.666667
>

warm regards

Brian Cullis
Research Leader, Biometrics &
Senior Principal Research Scientist
NSW Department of Primary Industries
Wagga Wagga Agricultural Institute

Visiting Professorial Fellow
School of Mathematics and Applied Statistics
Faculty of Informatics
University of Wollongong

Professor,
Faculty of Agriculture, Food & Natural Resources
The University of Sydney

Adjunct Professor
School of Computing and Mathematics
Charles Sturt University

Phone: 61 2 6938 1855
Fax: 61 2 6938 1809
Mobile: 0439 448 591
 
Received on Fri Jul 09 2009 - 21:02: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.)