[R] interaction contrasts

Kay Cichini Kay.Cichini at uibk.ac.at
Wed Oct 13 17:19:21 CEST 2010


hello list,

i'd very much appreciate help with setting up the 
contrast for a 2-factorial crossed design.

here is a toy example:

library(multcomp)

dat<-data.frame(fac1=gl(4,8,labels=LETTERS[1:4]),
                fac2=rep(c("I","II"),16),y=rnorm(32,1,1))

mod<-lm(y~fac1*fac2,data=dat)

## the contrasts i'm interressted in:

c1<-rbind("fac2-effect in A"=c(0,1,0,0,0,0,0,0),
          "fac2-effect in B"=c(0,1,0,0,0,1,0,0),
          "fac2-effect in C"=c(0,1,0,0,0,0,1,0),
          "fac2-effect in D"=c(0,1,0,0,0,0,0,1),
	    "fac2-effect, A*B"=c(0,0,0,0,0,1,0,0),
          "fac2-effect, A*C"=c(0,0,0,0,0,0,1,0),
          "fac2-effect, A*D"=c(0,0,0,0,0,0,0,1))

summary(glht(mod,c1))

## now i want to add the remaining combinations 
## "fac2, B*C"
## "fac2, B*D"
## "fac2, C*D"
## to the simultanous tests to see whether the effects 
## of fac2 within the levels of fac1 differ between  
## each combination of the levels of fac1, or not ??

thanks for any advise!

yours,
kay



-----
------------------------
Kay Cichini
Postgraduate student
Institute of Botany
Univ. of Innsbruck
------------------------

-- 
View this message in context: http://r.789695.n4.nabble.com/interaction-contrasts-tp2993845p2993845.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list