data(arousal)
contrasts22 <- data.frame( c(-.5,-.5,.5,.5),
c(-.5,.5,-.5,.5), c(.5,-.5,-.5,.5) )
names(contrasts22) <- c("Drug.A", "Drug.B", "Drug.A.B")
granovagg.contr(arousal, contrasts = contrasts22)
data(rat)
dat6 <- matrix(c(1, 1, 1, -1, -1, -1, -1, 1, 0, -1, 1, 0, 1, 1, -2,
1, 1, -2, -1, 1, 0, 1, -1, 0, 1, 1, -2, -1, -1, 2), ncol = 5)
granovagg.contr(rat[,1], contrasts = dat6, ylab = "Rat Weight Gain",
xlab = c("Amount 1 vs. Amount 2", "Type 1 vs. Type 2",
"Type 1 & 2 vs Type 3", "Interaction of Amount and Type 1 & 2",
"Interaction of Amount and Type (1, 2), 3"))
#Polynomial Contrasts
granovagg.contr(rat[,1],contrasts = contr.poly(6))
#based on random data
data.random <- rt(64, 5)
granovagg.contr(data.random, contrasts = contr.helmert(8),
ylab = "Random Data")
Run the code above in your browser using DataLab