Functions > Statistics > Descriptive Statistics > Example: Hypothesis Test of a Normal Mean
  
Example: Hypothesis Test of a Normal Mean
Use the normal distribution functions to conduct a hypothesis test for normal, independent data.
1. Define the following vector of data.
Click to copy this expression
2. Use functions length and mean to collect the sample statistics.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
* 
The sample mean is m_s.
3. Define the significance level α, the population standard deviation σ and the proposed population mean μ.
Click to copy this expression
Click to copy this expression
Click to copy this expression
4. Calculate the Z score.
Click to copy this expression
Click to copy this expression
Two-Tailed Test
1. State the null and the alternative hypothesis for a two-tailed test.
H0: m = μ
H1: m ≠ μ
2. Use function pnorm to test the hypothesis in terms of p-values for the two-tailed test. In this example, all of the Boolean expressions evaluate to 1 when the null hypothesis is true (you do not reject H0).
Click to copy this expression
The comparison between the p-value and the significance level indicates there is evidence that the alternative hypothesis is true.
3. Use function qnorm to test the hypothesis in terms of q-values for the two-tailed test.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Reject the null hypothesis. There is evidence that the mean is significantly different from μ.
4. Use function dnorm to calculate the standard normal distribution.
Click to copy this expression
5. Plot the normal distribution and then use red markers to show the left and right boundaries of the critical region. Use a green marker to show the Z score.
Click to copy this expression
Left-Tailed Test
1. State the null and the alternative hypothesis for a left-tailed test.
H0: m >= μ
H1: m < μ
2. Use function pnorm to test the hypothesis in terms of p-values for the left-tailed test.
Click to copy this expression
The comparison between the p-value and the significance level indicates there is evidence that the alternative hypothesis is true.
3. Use function qnorm to test the hypothesis in terms of q-values for the left-tailed test.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Reject the null hypothesis. There is evidence that the mean is smaller than μ.
4. Plot the standard normal distribution and then use a red marker to show the left boundary of the critical region. Use a green marker to show the Z score.
Click to copy this expression
Right-Tailed Test
1. State the null and the alternative hypothesis for a right-tailed test.
H0: m <= μ
H1: m > μ
2. Use the pnorm function to test the hypothesis in terms of p-values for the right-tailed test:
Click to copy this expression
The comparison between the p-value and the significance level indicates there is no evidence that the alternative hypothesis is true.
3. Use the qnorm function to test the hypothesis in terms of q-values for the right-tailed test.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Accept the null hypothesis. There is no evidence that the mean is greater than μ.
4. Plot the standard normal distribution and then use a red marker to show the right boundary of the critical region. Use a green marker to show the Z score.
Click to copy this expression