例題:
10 個の測定値がある。母平均が 10 であるかどうか検定しなさい。また,95% 信頼区間を求めなさい。
測定値: 9.7, 10.3, 9.6, 7.7, 10.2, 10.6, 10.4, 11.4, 7.8, 8.6
R による解析:
> x <- c(9.7, 10.3, 9.6, 7.7, 10.2, 10.6, 10.4, 11.4, 7.8, 8.6)
> x
[1] 9.7 10.3 9.6 7.7 10.2 10.6 10.4 11.4 7.8 8.6
> mean(x)
[1] 9.63
> var(x)
[1] 1.509
> t.test(x, mu=10)
One Sample t-test
data: x
t = -0.9525, df = 9, p-value = 0.3657
alternative hypothesis: true mean is not equal to 10
95 percent confidence interval:
8.751246 10.508754
sample estimates:
mean of x
9.63