A two-way contingency table, also known as a 2x2 contingency table, is a fundamental tool in statistics used to compare two categorical variables. It's a 2x2 matrix that displays the frequency counts of two variables, helping researchers understand the relationship between them. Let's explore this concept with an engaging example.
Imagine you're studying the relationship between two variables: smoking habits and stress levels among university students. The smoking habits variable has two categories: 'smoker' and 'non-smoker'. Similarly, stress levels can be categorized into 'high' and 'low'. Now, let's build our two-way contingency table.
Smoking Habits vs. Stress Levels
In our study, we've collected data from 100 students. Here's how they fall into the four categories:
| High Stress | Low Stress | Total | |
|---|---|---|---|
| Smoker | 35 | 20 | 55 |
| Non-smoker | 15 | 30 | 45 |
| Total | 50 | 50 | 100 |
High Stress Levels
The top left cell (35 students) shows that 35 smokers reported high stress levels. The row below (15 students) indicates that 15 non-smokers also reported high stress. In total, half of our students (50) are experiencing high stress.
Looking at high stress levels, we notice that a higher proportion of smokers (35/55) report high stress compared to non-smokers (15/45). This suggests a potential relationship between smoking and high stress levels, but let's examine the other categories before drawing conclusions.
Low Stress Levels
The bottom left cell (20 students) shows that 20 smokers reported low stress. Moving down, 30 non-smokers reported low stress (bottom middle cell). So, half of our students (50) are experiencing low stress.
Interestingly, a higher proportion of non-smokers (30/45) report low stress compared to smokers (20/55). This further supports the potential relationship between smoking and stress levels we noticed earlier.
Statistical Analysis
To gain a more precise understanding of the relationship, we can conduct a chi-square test of independence. This test will help determine if the association between smoking habits and stress levels is statistically significant. Let's break it down:
Expected Frequencies
The chi-square test uses expected frequencies, which can be calculated by multiplying the row totals by the column totals, and then dividing by the grand total (100 in this case).
| High Stress | Low Stress | Total | |
|---|---|---|---|
| Smoker | 27.5 | 27.5 | 55 |
| Non-smoker | 22.5 | 22.5 | 45 |
| Total | 50 | 50 | 100 |
Calculating the Chi-square Statistic
Now, we calculate the chi-square statistic (χ²) by summing the values in each cell, subtracting the expected frequency, squaring the result, and then dividing by the expected frequency.
The calculated χ² value is approximately 4.1, which, with a degree of freedom of 1 (since we have two categories in both variables), gives us a p-value less than 0.05. This suggests that there is indeed a statistically significant relationship between smoking habits and stress levels among university students.
So, there you have it - we've explored two-way contingency tables using a practical example. By understanding the frequencies and proportions within these tables, we can make informed decisions and uncover relationships between categorical variables.