Example of performing a basic hypothesis test

You can follow six basic steps to correctly set up and perform a hypothesis test. For example, the manager of a pipe manufacturing facility wants to determine whether the average diameter of their pipes is different from 5cm. The manager follows the basic steps for doing a hypothesis test.

Note

You should determine the criteria for the test and the required sample size before you collect the data.

  1. Specify the hypotheses.

    First, the manager formulates the hypotheses. The null hypothesis is: The population mean of all the pipes is equal to 5 cm. Formally, this is written as: H0: μ = 5

    Then, the manager chooses from the following alternative hypotheses:
    Condition to test Alternative Hypothesis
    The population mean is less than the target. one sided: μ < 5
    The population mean is greater than the target. one sided: μ > 5
    The population mean differs from the target. two sided: μ ≠ 5

    Because they need to ensure that the pipes are not larger or smaller than 5 cm, the manager chooses the two-sided alternative hypothesis, which states that the population mean of all the pipes is not equal to 5 cm. Formally, this is written as H1: μ ≠ 5

  2. Choose a significance level (also called alpha or α).
    The manager selects a significance level 0.05, which is the most commonly used significance level.
  3. Determine the power and sample size for the test.
    The manager uses a power and sample size calculation to determine how many pipes they need to measure to have a good chance of detecting a difference of 0.1 cm or more from the target diameter.
  4. Collect the data.
    They collect a sample of pipes and measure their diameters.
  5. Compare the p-value from the test to the significance level.
    After they perform the hypothesis test, the manager obtains a p-value of 0.004. The p-value is less than the significance level of 0.05.
  6. Decide whether to reject or fail to reject the null hypothesis.
    The manager rejects the null hypothesis and concludes that the mean pipe diameter of all pipes is not equal to 5cm.