PHD → Probability and Statistics → Statistical Inference ↓
Hypothesis Testing
In the field of statistics, hypothesis testing is a structured method used to make judgements about a population parameter based on sample data. It provides a mechanism for drawing conclusions or determining a parameter, such as a mean or proportion, from the data. This process is fundamental to the field of statistical inference.
Understanding the basics
Hypothesis testing involves evaluating two mutually exclusive statements about a population. These statements are known as the null hypothesis and the alternative hypothesis.
Null hypothesis
The null hypothesis, denoted as H0
, is a statement of no effect or no difference. It suggests that any difference or significance you see in a set of data is due to randomness or chance.
Alternative hypothesis
The alternative hypothesis, denoted as Ha
or H1
, is the one you want to prove. It represents an effect, difference, or relationship in the population.
Steps of hypothesis testing
The process of hypothesis testing typically involves five main steps:
- State the null and alternative hypotheses.
- Select a significance level (alpha).
- Collect data and calculate test statistics.
- Determine the p-value or critical value.
- Decide whether to accept or reject the null hypothesis.
Step 1: State the hypotheses
In this step, you formulate your null and alternative hypotheses. For example, let's say you're testing whether a new drug is more effective than an existing drug. Your null hypothesis might state that there is no difference in effectiveness between the two drugs, while your alternative hypothesis might claim that the new drug is actually more effective.
Step 2: Choosing the significance level
The significance level, represented by α
, is the probability of rejecting the null hypothesis when it is actually true. Commonly used significance levels are 0.05, 0.01, and 0.10. A smaller significance level indicates that you need stronger evidence to reject the null hypothesis.
Step 3: Collecting data and calculating test statistics
Once you have your hypothesis and significance level, collect the relevant data for your study. With this data, calculate a test statistic. The design of your test statistic depends on your specific hypothesis and data type.
The test statistic is a standardized value that allows you to relate your sample data to the null hypothesis.
Step 4: Determining the p-value or critical value
The p-value is the probability of observing data as extreme as the data you collected, provided the null hypothesis is true. If this probability is less than or equal to the significance level you chose, you have evidence against the null hypothesis.
Alternatively, you can use critical values, which are limits established in testing that determine rejection regions for the null hypothesis. If your test statistic falls within this region, you reject the null hypothesis.
Step 5: Making a decision
Finally, compare your p-value to your significance level or compare your test statistic to the critical value, and decide whether you will reject the null hypothesis or fail to reject it. Rejecting the null hypothesis shows that there is enough evidence to support the alternative hypothesis.
Visual example of hypothesis testing
Imagine two populations: Population A and Population B. Suppose we want to compare the average heights of these two groups to determine if there is a significant difference.
Our hypotheses will be:
H0
: Average height of population A = Average height of population BHa
: Average height of population A ≠ Average height of population B
The following illustration shows one way of representing this.
Population A Population B
This SVG circle simply shows two overlapping populations. Its purpose is to statistically determine whether the observed differences in their centers (means) are due to random sampling or reflect true differences.
Types of hypothesis testing
Different tests are used depending on the nature of data and hypothesis:
- T-test: Used to compare the means of two groups. It can be one-sample, two-sample or paired.
- ANOVA (Analysis of Variance): This is used when comparing more than two groups or conditions.
- Chi-square test: Used for categorical data to assess how likely an observed distribution is to occur by chance.
- Z-test: It is used to determine if there is a significant difference between the sample and population mean while the variance is known.
- Non-parametric tests: These tests do not assume normal distribution and are used for ordinal data or when the data does not meet the assumptions of parametric tests.
Example of a t-test
Suppose you are a school teacher and want to know whether the new teaching method improves students' scores compared to the old method. You randomly select 40 students: 20 for the old method and 20 for the new method.
Your hypotheses will be:
H0
: The average score of students using the new method = The average score of students using the old methodHa
: Average score of students using the new method > Average score of students using the old method
Using statistical software or manual calculations, you obtain the test statistic and the p-value to decide whether to reject the null hypothesis.
Errors in hypothesis testing
There are two types of errors that may occur while testing hypotheses:
- Type I error: incorrectly rejecting the null hypothesis when it is true (false positive).
- Type II error: failing to reject the null hypothesis when it is false (false negative).
Significance level and power
The significance level α
is closely related to the probability of a Type I error. Decreasing the significance level decreases the probability of this error but may increase the probability of a Type II error.
The power of the test (1 - probability of type II error) is the probability of correctly rejecting a false null hypothesis. High power is desirable in hypothesis testing.
Conclusion
Hypothesis testing is a crucial component in the field of statistics that allows us to make data-driven decisions. With its roots deeply rooted in probability theory, it helps validate new findings, compare procedures, and evaluate claims. By thoroughly understanding the steps involved: formulating hypotheses, choosing significance levels, calculating test statistics, and making informed decisions, researchers can uncover meaningful patterns and outcomes inherent in their data.