STUDENT
-------
> sample <- c(20.70, 27.46, 22.15, 19.85, 21.29, 24.75, 20.75, 22.91, 25.34, 20.33, 21.54, 21.08,
22.14, 19.56, 21.10, 18.04, 24.12, 19.95, 19.72, 18.28, 16.26, 17.46, 20.53, 22.12,
25.06, 22.44, 19.08, 19.88, 21.39, 22.33, 25.79)
> t.test(sample, mu=20, alternative='less')
One Sample t-test
data: sample
t = 3.0668, df = 30, p-value = 0.9977
alternative hypothesis: true mean is less than 20
95 percent confidence interval:
-Inf 22.17479
sample estimates:
mean of x
21.4
> t.test(sample, mu=20, alternative='greater')
One Sample t-test
data: sample
t = 3.0668, df = 30, p-value = 0.002276
alternative hypothesis: true mean is greater than 20
95 percent confidence interval:
20.62521 Inf
sample estimates:
mean of x
21.4
> t.test(sample, mu=20)
One Sample t-test
data: sample
t = 3.0668, df = 30, p-value = 0.004553
alternative hypothesis: true mean is not equal to 20
95 percent confidence interval:
20.46771 22.33229
sample estimates:
mean of x
21.4
> t.test(sample, mu=21, alternative='less')
One Sample t-test
data: sample
t = 0.87624, df = 30, p-value = 0.8061
alternative hypothesis: true mean is less than 21
95 percent confidence interval:
-Inf 22.17479
sample estimates:
mean of x
21.4
> t.test(sample, mu=21, alternative='greater')
One Sample t-test
data: sample
t = 0.87624, df = 30, p-value = 0.1939
alternative hypothesis: true mean is greater than 21
95 percent confidence interval:
20.62521 Inf
sample estimates:
mean of x
21.4
> t.test(sample, mu=21)
One Sample t-test
data: sample
t = 0.87624, df = 30, p-value = 0.3879
alternative hypothesis: true mean is not equal to 21
95 percent confidence interval:
20.46771 22.33229
sample estimates:
mean of x
21.4
> t.test(sample, mu=23, alternative='less')
One Sample t-test
data: sample
t = -3.505, df = 30, p-value = 0.0007288
alternative hypothesis: true mean is less than 23
95 percent confidence interval:
-Inf 22.17479
sample estimates:
mean of x
21.4
> t.test(sample, mu=23, alternative='greater')
One Sample t-test
data: sample
t = -3.505, df = 30, p-value = 0.9993
alternative hypothesis: true mean is greater than 23
95 percent confidence interval:
20.62521 Inf
sample estimates:
mean of x
21.4
> t.test(sample, mu=23)
One Sample t-test
data: sample
t = -3.505, df = 30, p-value = 0.001458
alternative hypothesis: true mean is not equal to 23
95 percent confidence interval:
20.46771 22.33229
sample estimates:
mean of x
21.4