Colorful House of Math logo
Log in

How to Do Hypothesis Testing with Normal Distribution

Hypothesis tests compare a result up against something you already believe is true. Let X1,X2,,Xn be n independent random variables with equal expected value μ and standard deviation σ. Let X¯ be the mean of these n random variables, so

X¯ = 1 n i=1nX i.

The stochastic variable X¯ has expected value μ and standard deviation  σ n. You want to perform a hypothesis test on this expected value. You have a null hypothesis H0: μ = μ0 and three possible alternative hypotheses: Ha: μ < μ0, Ha: μ > μ0 or Ha: μμ0. The first two alternative hypotheses belong to what you call a one-sided test, while the latter is two-sided.

In hypothesis testing, you calculate with the alternative hypothesis to say something about the null hypothesis.


Hypothesis Testing (Normal Distribution)

You set up the null hypothesis H0 against an alternative hypothesis HA. H0: μ = μ0 against Ha: μ > μ0 (possibly Ha: μ < μ0, Ha: μμ0).
Then you do an experiment and find that the average value is x¯. Next, you calculate the probability P (X¯ x¯) for the alternative hypothesis Ha: μ > μ0.
If this probability is less than 1 %, 5 % or 10 %, you discard H0.

Note! For two-sided testing, multiply the p-value by 2 before checking against critical region.

Example 1

As production manager in the new soft drink factory, you are worried that the machines don’t fill the bottles properly. Each bottle should be filled with 0.5L soda, but random samples show that 48 soda bottles have an average of 0.48L, with an empirical standard deviation of 0.1. You are wondering if you need to recalibrate the machines so that they become more precise.

This is a classic case of hypothesis testing by normal distribution. You now follow the instructions above and select 10 % level of significance, since it is only a quantity of soda and not a case of life and death.

The null hypothesis is that there is 0.5 L in each bottle:
μ0 = 0.5.

The alternative hypothesis in this case is that the bottles do not contain 0.5 L and that the machines are not precise enough. This thus becomes a two-sided hypothesis test and you must therefore remember to multiply the p-value by 2 before deciding whether the p-value is in the critical region. This is because the normal distribution is symmetric, so P (X k) = P (X k). Thus it is just as likely to observe an equally extremely high value as an equally extreme low:

Find the p-value by calculating P (X¯ 0.48): P (X¯ 0.48) = P (Z 0.48 0.5 0.1 48 ) = P (Z 1.39) = 0.0823 p = 0.0823 2 = 0.1646 = 16.46%.
You have chosen that if the machines are to be recalibrated your p-value must be less than 10 %. Therefore, there must be less than 10 % chance of the machine filling 0.5 L on average in the bottles. Your p-value is
p = 16.46% > 10%,

so that H0 must be kept and the machines are fine as is.

Had the p-value been less than the level of significance, that would have meant that the calibration represented by the alternative hypothesis is significantly better for the business.

Want to know more?Sign UpIt's free!
White arrow pointing to the LeftPrevious entry
How to Do Hypothesis Testing with Binomial Distribution