Skip to main content
Statistics LibreTexts

28.1: Testing the Value of a Single Mean

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    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.5p=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 X\bar{X} and the hypothesized population mean as μ\mu. Then, the t test for a single mean is:

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

    SEM=σ̂n 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.

    This page titled 28.1: Testing the Value of a Single Mean is shared under a not declared license and was authored, remixed, and/or curated by Russell A. Poldrack via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.

    • Was this article helpful?