######################################################### # Example 11.2.1 lamb diet ######################################################### weight=c(8,16,9,9,16,21,11,18,15,10,17,6) diet=c(1,1,1,2,2,2,2,2,3,3,3,3) diet=factor(diet) ######################################################### # Example 11.1.1 corn ######################################################### weight=c(16.5,11.0,8.5,16.0,13.0,15.0,15.0,13.0,14.5,10.5, 11.5,9.0,12.0,15.0,11.0,12.0,9.0,10.0,9.0,10.0, 12.5,11.5,12.5,10.5,14.0,9.0,11.0,8.5,14.0,12.0, 16.0,9.0,9.5,12.5,11.0,6.5,10.0,7.0,9.0,9.5, 8.0,9.0,10.5,9.0,18.5,14.5,8.0,10.5,9.0,17.0, 7.0,8.0,13.0,6.5,10.0,10.5,5.0,9.0,8.5,11.0) treat= c(1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5, 1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5, 1,2,3,4,5,1,2,3,4,5) treat=factor(treat) boxplot(weight~treat,names=c("Nematodes","Wasps","Nems. & wasps","Bacteria","Control")) ######################################################### # Example 1.1.4 MOA and schitzophrenia ######################################################### moa=c(6.8,4.1,7.3,14.2,18.8,9.9,7.4,11.9,5.2,7.8,7.8,8.7,12.7,14.5,10.7,8.4,9.7, 10.6,7.8,4.4,11.4,3.1,4.3,10.1,1.5,7.4,5.2,10.0,3.7,5.5,8.5,7.7,6.8,3.1, 6.4,10.8,1.1,2.9,4.5,5.8,9.4,6.8) group=c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3) group=factor(group) boxplot(moa~group,names=c("Schizo I","Schizo II","Schizo III")) ######################################################### # Example 2.5.3 radish growth ######################################################### radish=c(8,4,3,10,9,5,11,10,5,15,10,7,15,11,7,20,15,8,20,15,9,22,20,10, 25,20,10,29,20,10,30,21,10,33,22,14,35,25,20,37,27,21) light=c(1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3) light=factor(light) boxplot(radish~light,names=c("Darkness","Diurnal","Light")) fit=aov(radish~light) summary(fit) ######################################################### # Exercise 11.S.16 ######################################################### time=c(23,170,229,12,182,126,29,286,140,12,103,260,5,330,330,47,55,310,18,49,45,30,31,248, 8,132,280,45,150,140,36,165,160,27,206,192,29,200,159,33,270,62,24,298,180,17,100,32, 11,162,54,25,126,149,6,229,201,34,140,173) group=c(1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3, 1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3) group=factor(group) boxplot(log(time)~group,names=c("light","moisture","control"))