# 8.1 One sample t-tests: comparing a sample mean against the population mean

The one-sample t-test operates similarly to the z-test, with the primary difference lying in how we determine the critical value. As you may recall from the earlier section, the shape of the t-distribution depends on the sample size, which slightly alters our calculated results of t critical value).

Figure 23 Z-distribution vs t-distribution with different sample size

To fully comprehend this difference, we need to understand the concept of degrees of freedom (DF). DF represent the amount of independent information available for estimating statistical parameters. More degrees of freedom generally lead to more reliable estimates.

For a one-sample t-test, we calculate degrees of freedom as the sample size minus one.The formula is:

DF = n - 1

Where:

- n represents the sample size

We subtract 1 because we estimate one parameter (the population mean) in a one-sample t-test. This reduction reflects the "cost" of estimating the unknown parameter. Larger sample sizes result in more degrees of freedom. This increase in DF improves the precision of our estimates and enhances the power of our statistical tests.

The t-statistic formula is typically expressed as:

= sample mean

μ = hypothesised population mean

s = sample standard deviation

n = sample size

To perform a one-sample t-test, we must calcuate t-statistic and then determine the t critical value. Unlike z critical values, which use a single function, Excel provides specific functions for calculating t critical values for both one-tailed and two-tailed tests. However, we can modify these functions to calculate values for either type of test.

OpenLearn - Data analysis: hypothesis testing
Except for third party materials and otherwise, this content is made available under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 Licence, full copyright detail can be found in the acknowledgements section. Please see full copyright statement for details.