Thanks Mark and Richard for your propositions on how to extract residuals.
However, I've tried both solutions on my model, and I got different
residuals :
If we consider the within residuals :
Mark's solution gave me a vector of 24 residuals :
as.vector(residuals(aov(PH~Community*Mowing*Water + Error(Block))$Within))
[1] -1.107277057 -0.977277057 -0.007277057 -0.719777057 -1.021627882
0.215872118 -1.621627882 0.508372118 1.241311954 1.498811954
-0.616188046
[12] 0.483811954 -0.477827381 -1.660327381 2.684672619 1.924672619
-0.465198010 -1.735198010 1.502301990 0.839801990 -0.428515358
-0.751015358
[23] 0.836484642 1.181484642
and Richard's solution gave me a vector 32 residuals :
do.call(data.frame,proj(aov(PH~Community*Water*Mowing + Error(Block))))->proj
proj$Within.Residuals
[1] -0.216875 1.745625 -1.174375 -0.354375 0.800625 0.460625
-0.799375 -0.461875 -0.404375 -0.274375 0.695625 -0.016875 -0.541875
0.695625 -1.141875
[16] 0.988125 0.589375 0.846875 -1.268125 -0.168125 -1.095625
-2.278125 2.066875 1.306875 -0.500625 -1.770625 1.466875 0.804375
-0.638125 -0.960625
[31] 0.626875 0.971875
What could be the difference between the two?
Regards
JPM
Quoting "Richard M. Heiberger" <r...@temple.edu>:
Jean-Paul Maalouf wrote:
Do you have any idea on how can I verify preliminary assumptions in
this model (normality of the residuals and variance homogeneity),
since R is not able to extract residuals?
Of course, R extracts residuals. Use the proj() function. See ?proj
for the example
to get the projection of an aovlist object onto the terms of a linear model
proj(npk.aovE)
To get the projections into a simple data.frame, use
tmpE <- proj(npk.aovE)
tmpE.df <- do.call("data.frame", tmpE)
tmpE.df
Mark Difford's solution effectively retrieved columns 3 and 10 from tmpE.df
Rich
--
Jean-Paul Maalouf
UMR 1202 BIOGECO
Inra - Université Bordeaux 1
Bâtiment B8, Avenue des Facultés
33405 Talence, France
Tel : 05 40008772
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.