Bartlett Test
刚才的ANOVA Test是用来测试3个以上的组的平均值有无差异,现在这个Bartlett Test是用来测试3个以上的组的方差有无差异。
这个可以用R的bartlett.test函数来计算:
(from here)
A组 | 301, 311, 325, 291, 388, 402, 325, 361, 287, 261, 238, 362 |
B组 | 197, 180, 178, 260, 247, 199, 179, 134, 163, 200 |
C组 | 209, 331, 192, 155, 234, 290, 175, 116, 285, 216, 237, 301 |
D组 | 343, 247, 316, 395, 324, 138, 245, 228, 214, 374, 235 |
> vx=c(301, 311, 325, 291, 388, 402, 325, 361, 287, 261, 238, 362,
197, 180, 178, 260, 247, 199, 179, 134, 163, 200, 209, 331, 192, 155,
234, 290, 175, 116, 285, 216, 237, 301, 343, 247, 316, 395, 324, 138,
245, 228, 214, 374, 235)
197, 180, 178, 260, 247, 199, 179, 134, 163, 200, 209, 331, 192, 155,
234, 290, 175, 116, 285, 216, 237, 301, 343, 247, 316, 395, 324, 138,
245, 228, 214, 374, 235)
> fx=factor(rep(c("A", "B", "C", "D"), c(12, 10, 12, 11)))
> bartlett.test(formula=vx~fx)
Bartlett test of homogeneity of variances
data: vx by fx
Bartlett's K-squared = 5.2629, df = 3, p-value = 0.1535
0 Comments:
Post a Comment
<< Home