Functions > Statistics > Probability Distributions > Example: Z Score of a Vector of Data
Example: Z Score of a Vector of Data
Compute a z-score for a vector of normally distributed data with known population standard deviation.
1. Define a data set to be analyzed.
Click to copy this expression
2. Calculate the sample mean m_s.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
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
5. State the null and the alternative hypothesis for a two-tailed test.
H0: m = μ
H1: m ≠ μ
6. Use the pnorm function to calculate the p-value and test the hypothesis. 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
Click to copy this expression
Click to copy this expression
There is a 4.11*10-10 probability that the test statistic is greater than the one observed, assuming that the null hypothesis is true. The comparison between the p-value and the significance level indicates there is evidence that the alternative hypothesis is true.
7. Use the qnorm function to calculate the limits of the critical region and test the hypothesis.
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 not equal to μ.
8. Use the dnorm function to calculate and plot the standard normal distribution (blue), the boundaries of the critical region (red) , and the z-score (green).
Click to copy this expression
Was this helpful?