[R] how to specify a particular contrast
array chip
arrayprofile at yahoo.com
Fri Jan 18 01:21:50 CET 2008
Hi, I am running a simple one-way ANOVA with an
independent factot variable "treat" (3 levels: a, b
and c) and a response variable "y". I want to test a
linear relationship of the response among the 3 levels
of the variable "treat" (ordered a->b->c). I used
glht() from multcomp package. Later I found out I need
to exclude the situation where the response at the 3
levels of "treat" are equal. I can do separate
contrasts to test them separately:
obj<-aov(y~treat,data=dat)
### testing a=b=c
summary(glht(obj, linfct= mcp
(treat=c('a-b=0','a-c=0','b-c=0'))),test=Ftest())
### testing linear relationship among a,b and c
summary(glht(obj, linfct= mcp
(treat=c('a+c-2*b=0'))),test=Ftest())
Is there anyway to build one contrast that tests both
at the same time, i.e. just generate one single p
value. Because the ultimate purpose was to test the
linear relationship among the 3 levels of the variable
"treat". Or I am asking something that is non-sensible
to do?
Thanks
John Zhang
____________________________________________________________________________________
Looking for last minute shopping deals?
More information about the R-help
mailing list