So, what about our university teacher and his bunch of clever students? First, let’s check what is known about the sample:
List of the things you should know:
µ
(here µ=120)n
(here n=40)M
=126.35)sd
(here sd=10.14)SD
(unknown in our example)Assumptions:
The null hypothesis to be tested:
H0
: the sample mean M equals the population mean µ.Our alternative hypothesis:
Ha
: the sample mean M is greater than the population mean µ (our teacher has the feeling that the student are clever, meaning that their IQ is higher than average).We do not know the standard deviation of the population, SD. Thus we have to run a one-sample t-test. In R, we had previously stored our data in scores
. We just need to enter the following command:
t.test(scores, alternative="greater", mu = 120)
##
## One Sample t-test
##
## data: scores
## t = 3.9591, df = 39, p-value = 0.0001547
## alternative hypothesis: true mean is greater than 120
## 95 percent confidence interval:
## 123.6476 Inf
## sample estimates:
## mean of x
## 126.35
As you may read above here, a p-value less than 0.05 (0.0001547) has been “delivered” by t.test()
. This means that our alternative hypothesis Ha
is accepted. Our teacher’s feeling about his students was correct, assuming that using IQ score for this purpose makes sense…