# blood clotting times example, p 91
time <- c(6.4, 4.6, 6.4, 5.6, 5.9, 6.1, 6.3, 4.5,
4.8, 6.6, 7, 9.3, 7.9, 9.4, 8.2, 4.4, 4.2, 5,
6.9, 4.5, 4, 4.3, 6.9, 5.5, 5.8,
4.4, 4.2, 5.1, 6.9, 4.5)
Treatment = gl(3,5,30, labels=c("T1","T2","T3"))
Health = gl(2,15,30, labels=c("Hemophiliac","Normal"))
L_2way_Factorial_ANOVA(time, Treatment, Health)
contrast1 <- c(-1, -1, 5,
-1, -1, -1) # interaction Hemo T3 higher than others
L_2way_Factorial_ANOVA(time, Treatment, Health, contrast1)
contrast2 <- c(-1, -1, -1,
1, 1, 1) # main effect of health status (Hemo higher than Normal)
m=L_2way_Factorial_ANOVA(time, Treatment, Health, contrast1, contrast2)
m #show outputs
Run the code above in your browser using DataLab