- count:蟲子出現的個數
- spray:使用的殺蟲劑,分成A, B, C, D, E, F
上面的圖片程式碼來自於InsectSprays資料集的說明,如下:
require(stats)
require(graphics)
boxplot(count ~ spray, data = InsectSprays,
xlab = "Type of spray", ylab = "Insect count",
main = "InsectSprays data", varwidth = TRUE, col = "lightgray")
fm1 <- aov(count ~ spray, data = InsectSprays)
summary(fm1)
opar <- par(mfrow = c(2, 2), oma = c(0, 0, 1.1, 0))
plot(fm1)
fm2 <- aov(sqrt(count) ~ spray, data = InsectSprays)
summary(fm2)
plot(fm2)
par(opar)
_EOF_
沒有留言:
張貼留言