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:

- the mean/reference of the population,
`µ`

(here µ=120) - the number of observations in your sample,
`n`

(here n=40) - the sample mean, M (here
`M`

=126.35) - the standard deviation for the sample,
`sd`

(here sd=10.14) - the standard deviation for the population,
`SD`

(unknown in our example)

- the mean/reference of the population,
Assumptions:

- the variable is
*continuous* - the data are
*independent*(no relationship between observations) - the variable has a
*normal distribution*

- the variable is
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…