A Z-test is a statistical test used to determine whether two population means are different when the variances are known and the sample size is large. Here's a breakdown of how to conduct a Z-test:
Steps to Perform a Z-Test
-
State the Null and Alternative Hypotheses:
- Null Hypothesis (H₀): This is the statement you're trying to disprove. It typically states that there is no difference between the population means. For example: "The mean blood pressure of patients taking drug A is equal to the mean blood pressure of patients taking a placebo." (μ₁ = μ₂)
- Alternative Hypothesis (H₁ or Ha): This is the statement you're trying to prove. It can take one of three forms:
- Two-tailed: The means are not equal. (μ₁ ≠ μ₂) Example: "The mean blood pressure of patients taking drug A is different from the mean blood pressure of patients taking a placebo."
- Right-tailed: The mean of the first population is greater than the mean of the second population. (μ₁ > μ₂) Example: "The mean blood pressure of patients taking drug A is greater than the mean blood pressure of patients taking a placebo."
- Left-tailed: The mean of the first population is less than the mean of the second population. (μ₁ < μ₂) Example: "The mean blood pressure of patients taking drug A is less than the mean blood pressure of patients taking a placebo."
-
Determine the Significance Level (Alpha):
- The significance level (α) represents the probability of rejecting the null hypothesis when it is actually true (Type I error). Common values for α are 0.05 (5%) and 0.01 (1%). A lower alpha value indicates a more stringent test.
-
Find the Critical Value:
- The critical value is the value that defines the rejection region. You find this value using the chosen alpha level and the type of test (one-tailed or two-tailed) from a Z-table (also known as a standard normal table). Z-tables are readily available online.
- Example: If α = 0.05 and you are performing a two-tailed test, you would look up the Z-score that corresponds to 0.05/2 = 0.025 in each tail. This value is approximately ±1.96.
-
Calculate the Z-Statistic:
-
The Z-statistic measures how many standard deviations the sample mean is from the population mean (or the difference between sample means under the null hypothesis). The formula depends on the type of Z-test you're performing:
-
One-Sample Z-Test: Used to compare the mean of a sample to a known population mean.
Z = (x̄ - μ) / (σ / √n)
Where:
- x̄ is the sample mean
- μ is the population mean
- σ is the population standard deviation
- n is the sample size
-
Two-Sample Z-Test: Used to compare the means of two independent samples.
Z = (x̄₁ - x̄₂) / √((σ₁²/n₁) + (σ₂²/n₂))
Where:
- x̄₁ is the mean of sample 1
- x̄₂ is the mean of sample 2
- σ₁ is the standard deviation of population 1
- σ₂ is the standard deviation of population 2
- n₁ is the sample size of sample 1
- n₂ is the sample size of sample 2
-
-
Make a Decision:
- Compare the calculated Z-statistic to the critical value(s).
- If the Z-statistic falls within the rejection region (i.e., its absolute value is greater than the critical value for a two-tailed test, or it's greater than the critical value for a right-tailed test, or less than the critical value for a left-tailed test), reject the null hypothesis. This suggests there is a statistically significant difference between the means.
- If the Z-statistic does not fall within the rejection region, fail to reject the null hypothesis. This suggests there is not enough evidence to conclude a statistically significant difference between the means.
Example
Let's say you want to test if the average height of adult males in a city is significantly different from the national average of 5'10" (70 inches). You collect a sample of 100 adult males in the city and find their average height to be 71 inches, with a known population standard deviation of 3 inches. You set α = 0.05.
- Hypotheses: H₀: μ = 70, H₁: μ ≠ 70 (two-tailed)
- Alpha: α = 0.05
- Critical Value: ±1.96
- Z-Statistic: Z = (71 - 70) / (3 / √100) = 3.33
- Decision: Since 3.33 > 1.96, you reject the null hypothesis. You conclude that the average height of adult males in the city is significantly different from the national average.
A Z-test is a powerful tool for hypothesis testing when certain conditions are met. Remember to check the assumptions of the test (e.g., known population variance, large sample size) before applying it.