I read the vignette of contrast package. I don't think that I
understand how to use it.

I made the following simpler example (contrast between '3' and '4').
Could somebody let me know what is the correct way to compute the
contrast in the following example?

 library(contrast)

 a=3
 n=4
 A = as.vector(sapply(1:a,function(x){rep(x,n)}))
 Y = A + rnorm(a*n)

 aframe = data.frame(Y=Y, A=as.factor(A))
 aframe
 afit=aov(Y ~ A - 1, aframe)

 contrast(afit, list=(A='3'), list=(A='4'))

______________________________________________
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.

Reply via email to