Lecture Notes: Chi-Squared Test for Independence
Introduction
- Section: 15D, Last section of the course
- Topic: Chi-squared test for independence
- Objective: Understand the chi-squared test to prepare for the final exam
Key Concepts
Independence
- Definition: Independence means no association between variables.
- Example: Sex at birth and eye color are independent.
- Association: If there's a relationship, variables are not independent.
Chi-Squared Test of Independence
- Purpose: Test whether two categorical variables are independent.
Example
- Data Source: Pew Research Center
- Variables:
- Income level (Poor: <30,000, Middle: 30,000-74,999, Upper: 75,000+)
- Education level
- Two-way Table: Displays the relationship between income and education level
Null and Alternate Hypotheses
- Null Hypothesis (H₀): The two variables are independent (no association)
- Alternate Hypothesis (H₁): The two variables are not independent (there is an association)
Conditions for Chi-Squared Test
- Data Type: Two categorical variables measured on one sample
- Sample Quality: Data collected should represent a random and unbiased sample
- Sample Size: Each expected cell count should be at least 5
Calculating Expected Values
- Formula:
- Expected Value = (Row Total × Column Total) / Grand Total
- Interpretation: If H₀ is true, expected count should be observed
Performing the Chi-Squared Test
- Steps:
- Enter data into a statistical software
- Use software to calculate chi-squared test statistic
- Determine p-value
Conclusion
- Small p-value: Reject the null hypothesis (suggests an association)
- Important Note: Chi-squared test only suggests association, not causation
Limitations
- Test shows association, not causality or direction of association
Additional Concepts
- Degrees of Freedom: (Number of rows - 1) × (Number of columns - 1)
- Test Statistic Calculation: Sum of (Observed - Expected)² / Expected for each cell
Lurking Variables
- Variables that can affect both variables being studied (e.g., family support)
Final Thoughts
- Importance of understanding assumptions and methodology of chi-squared test
- Prepare for final by reviewing these notes and completing homework assignments
This concludes your course section on chi-squared tests. Best of luck on your final exam!