帰無仮説:全てのカテゴリの母分散が等しい
対立仮説:少なくとも一つの母分散が他の母分散と異なる
1.データを入力
> score=c(11,10.38461538,11.38461538,10.76923077,11.15384615,10.69230769,11.92307692,10.61538462,11.56521739,11.7826087,11.7826087,11.73913043,10.63636364,10.72727273,10.61363636,10.40909091,11.13157895,11.15789474,10.57894737,10.28947368,10.55555556,11,10.55555556,10,9.833333333,9.666666667,9,9.166666667,9.571428571,9.214285714,9.571428571,8.285714286,9.838709677,9.612903226,9.387096774,9.096774194,7.678571429,7.607142857,7.464285714,7.035714286,9.176470588,8.352941176,8.352941176,7.823529412,7.333333333,7.333333333,8.111111111,6.555555556,6.909090909,7,6.545454545,6.545454545)
2. ラベルと標本数
> group=factor(rep(c("Awareness", "Decision", "Comunication", "Leadership"), c(13, 13, 13, 13)))
3.テスト実施 > bartlett.test(score ~ group) Bartlett test of homogeneity of variances data: score by group Bartlett's K-squared = 5.9198, df = 3, p-value = 0.1156
4.結果
p-value = 0.1156なので各群の母分散は等しくないと言えない(等しいとして次の検定を実施)。この場合は Bonferroniを実施
もう1件例を書いておく
> score_v=c(1.976331361,1.905325444,0.071005917,10.23668639,3.146683673,5.095663265,5.677295918,6.605867347,3.167533819,4.172736733,4.172736733,5.635796046,3.244897959,3.168367347,3.673469388,4.918367347,2,1.777777778,2.987654321,3.135802469,2.851211073,2.46366782,3.404844291,2.851211073,0.805555556,1.222222222,1.333333333,2.472222222,2.082644628,2.727272727,2.975206612,1.884297521,1.135802469,1.111111111,1.135802469,1.777777778,1.538461538,2.236686391,1.621301775,1.562130178,1.685950413,1.652892562,1.646177686,1.559917355,1.114265928,0.922437673,0.822714681,1.100415512,0.767485822,0.691871456,0.517958412,0.801512287) > group=factor(rep(c("Awareness", "Decision", "Comunication", "Leadership"), c(13, 13, 13, 13))) > bartlett.test(score_v ~ group) Bartlett test of homogeneity of variances data: score_v by group Bartlett's K-squared = 40.782, df = 3, p-value = 7.274e-09
今回は有意差ありなので、等分散性は棄却される。この場合は Steel–Dwass nonparametric testを実施。
参考
http://bio-info.biz/tips/r_bartlett_test.html
0 件のコメント:
コメントを投稿