16. 16
[練習]例題1 Rで検定
> data <- c(24.2, 25.3, 26.2, 25.7, 24.4, 25.1, 25.6)
Rを起動して,コンソールに打ち込んでみよう
① データの入力
② t検定の実行
> t.test(data, mu=25)
One Sample t-test
data: data
t = 0.79277, df = 6, p-value = 0.4581
alternative hypothesis: true mean is not equal to 25
95 percent confidence interval:
24.55289 25.87568
sample estimates:
mean of x
25.21429
③ 結論
𝑝 > 𝛼 より,帰無仮説を棄却できない.⇒ エアコンは正常
19. 19
[練習]例題2 Rで検定
> class1 <- c(54, 55, 52, 48, 50, 38, 41, 40, 53, 52)
> class2 <- c(67, 63, 50, 60, 61, 69, 43, 58, 36, 29)
① データの入力
> var.test(class1, class2)
F test to compare two variances
data: class1 and class2
F = 0.21567, num df = 9, denom df = 9, p-value = 0.03206
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
0.05356961 0.86828987
sample estimates:
ratio of variances
0.2156709
③ 母分散の比の検定
② まず母分散の比の検定をする必要がある
有意水準 𝛼 𝑣=0.05とする.
Rを起動して,コンソールに打ち込んでみよう
20. 20
[練習]例題2 Rで検定
> t.test(class1, class2, var.equal = FALSE)
Welch Two Sample t-test
data: class1 and class2
t = -1.1191, df = 12.71, p-value = 0.2838
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-15.554888 4.954888
sample estimates:
mean of x mean of y
48.3 53.6
④ 母分散の比について結論
𝑝 < 𝛼 𝑣より,帰無仮説を棄却する.⇒ 2つの母分散は等しくない.
⑤ 母平均の差の検定
母分散が等しくないので,Welchの𝑡検定をおこなう.
⑥ 結論
𝑝 > 𝛼 より,帰無仮説を棄却できない.⇒ 差があるとは言えない