# 28.1: Testing the Value of a Single Mean

- Page ID
- 8863

The simplest question we might want to ask of a mean is whether it has a specific value. Let’s say that we want to test whether the mean BMI value in adults from the NHANES dataset is above 25, which is the lower cutoff for being overweight according to the US Centers for Disease Control. We take a sample of 200 adults in order to ask this question.

One simple way to test for this difference is using a test called the *sign test*, which asks whether the proportion of positive differences between the actual value and the hypothesized value is different than what we would expect by chance. To do this, we take the differences between each data point and the hypothesized mean value and compute their sign. In our sample, we see that 66.0 percent of individuals have a BMI greater than 25. We can then use a binomial test to ask whether this proportion of positive differences is greater than 0.5, using the `binom.test()`

function in R:

```
##
## Exact binomial test
##
## data: npos and nrow(NHANES_sample)
## number of successes = 132, number of trials = 200, p-value = 4e-06
## alternative hypothesis: true probability of success is greater than 0.5
## 95 percent confidence interval:
## 0.6 1.0
## sample estimates:
## probability of success
## 0.66
```

Here we see that the proportion of individuals with positive signs would be *very* surprising under the null hypothesis of $p=0.5$.

We can also ask this question using Student’s t-test, which you have already encountered earlier in the book. We will refer to the mean as $\bar{X}$ and the hypothesized population mean as $\mu$. Then, the t test for a single mean is:

$t = \frac{\bar{X} - \mu}{SEM}$ where SEM (as you may remember from the chapter on sampling) is defined as:

$SEM = \frac{\hat{\sigma}}{\sqrt{n}}$

In essence, the t statistic asks how large the deviation of the sample mean from the hypothesized quantity is with respect to the sampling variability of the mean.

We can compute this for the NHANES dataset using the `t.test()`

function in R:

```
##
## One Sample t-test
##
## data: NHANES_adult$BMI
## t = 38, df = 4785, p-value <2e-16
## alternative hypothesis: true mean is not equal to 25
## 95 percent confidence interval:
## 29 29
## sample estimates:
## mean of x
## 29
```

This shows us that the mean BMI in the dataset (28.79) is significantly larger than the cutoff for overweight.