Calculating hypothesis testing involves a series of steps to determine if there is enough evidence to reject a null hypothesis in favor of an alternative hypothesis. Here's a breakdown of the process:
1. State the Null and Alternative Hypotheses
- Null Hypothesis (H₀): This is the statement you are trying to disprove. It often represents the status quo or no effect. For example, the average height of adult males is 5'10".
- Alternative Hypothesis (H₁ or Ha): This is the statement you are trying to prove. It contradicts the null hypothesis. For example, the average height of adult males is not 5'10". This could be two-tailed (not equal to), right-tailed (greater than), or left-tailed (less than).
2. Choose a Significance Level (α)
- The significance level (α) represents the probability of rejecting the null hypothesis when it is actually true (Type I error). Common values are 0.05 (5%), 0.01 (1%), and 0.10 (10%).
3. Select the Appropriate Test Statistic
The choice of test statistic depends on the type of data, the distribution, and the hypotheses. Common test statistics include:
- Z-test: Used when the population standard deviation is known, or the sample size is large (n > 30) and the population standard deviation is unknown.
- Formula:
z = (x̄ - μ) / (σ / √n)
- x̄ = Sample mean
- μ = Population mean (under the null hypothesis)
- σ = Population standard deviation
- n = Sample size
- Formula:
- t-test: Used when the population standard deviation is unknown and the sample size is small (n < 30).
- Chi-square test: Used for categorical data to determine if there is a relationship between two variables.
- ANOVA (Analysis of Variance): Used to compare the means of two or more groups.
4. Calculate the Test Statistic
Using the appropriate formula and your sample data, calculate the value of the test statistic.
Example (Z-test):
Suppose you want to test if the average weight of apples from an orchard is significantly different from 150 grams. You take a sample of 40 apples and find the sample mean is 155 grams. Assume the population standard deviation is known to be 20 grams.
- H₀: μ = 150
- H₁: μ ≠ 150
- α = 0.05
- x̄ = 155
- μ = 150
- σ = 20
- n = 40
z = (155 - 150) / (20 / √40) = 5 / (20 / 6.32) = 5 / 3.16 = 1.58
5. Determine the p-value or Critical Value
- p-value: The probability of obtaining a test statistic as extreme as, or more extreme than, the one calculated, assuming the null hypothesis is true. You can find the p-value using statistical software or tables. A smaller p-value indicates stronger evidence against the null hypothesis.
- Critical Value: A threshold value determined by the significance level (α) and the distribution of the test statistic. If the test statistic exceeds the critical value (or is less than the negative critical value in a two-tailed test), you reject the null hypothesis.
In the Z-test example above, with z = 1.58 and a two-tailed test with α = 0.05, you would look up the p-value corresponding to z = 1.58. The p-value is approximately 0.114.
6. Make a Decision
- p-value approach: If the p-value is less than or equal to the significance level (α), reject the null hypothesis. Otherwise, fail to reject the null hypothesis.
- Critical value approach: If the test statistic falls in the rejection region (beyond the critical value(s)), reject the null hypothesis. Otherwise, fail to reject the null hypothesis.
In the apple weight example, the p-value (0.114) is greater than α (0.05). Therefore, we fail to reject the null hypothesis. We do not have enough evidence to conclude that the average weight of apples from the orchard is significantly different from 150 grams.
7. Draw a Conclusion
State your conclusion in the context of the original research question. Avoid stating that you "prove" the alternative hypothesis. Instead, say that you have sufficient or insufficient evidence to support it.