STA1003: Fundamental Statistics
Chi-Square of Independence
Overview:
What is a Chi-Square test of Independence;
The mechanics behind a Chi-Square test of Independence;
Overall objective - Recall:
Hypothesis tests designed to answer the question:
Does the data support our assumption, or is it evidence against the
assumption?
The four steps of hypothesis testing
1. State the null and alternative hypotheses
2. Assume the null hypothesis is true and calculate the value of the
test statistic
3. Determine the P-value, a measure of the plausibility of the null
hypothesis
4. Conclusion in context
Don’t forget to check the assumptions!
In a contingency table, column totals produce a marginal distribution
In a contingency table, row totals also produce a marginal distribution
Each column produces a conditional distribution
Likewise, each row produces a conditional distribution
Associations:
Differences between these conditional distributions suggest an association
between the two categorical variables
But are the differences due to chance (sampling error) or a real
difference?
Use a chi-square test of independence to decide
The same steps…
To perform a χ2 test of independence, the four steps discussed for Hypothesis
Testing are used:
1. State the hypotheses
2. Compute the test statistic
3. Compute the P-value
4. Make a conclusion
Chi-square test of independence:
Step 1: Write hypotheses
H0: The two variables are not associated
HA: The two variables are associated
o H0 says the differences are due to chance
o HA says the differences are real differences
o REMEMBER: for each question the hypotheses must be written in
context
Step 2: Compute test statistic
Recall: This test statistic measures how extreme the data is, assuming H0
is true
First, compute the expected value for each cell:
Chi-Square of Independence
Overview:
What is a Chi-Square test of Independence;
The mechanics behind a Chi-Square test of Independence;
Overall objective - Recall:
Hypothesis tests designed to answer the question:
Does the data support our assumption, or is it evidence against the
assumption?
The four steps of hypothesis testing
1. State the null and alternative hypotheses
2. Assume the null hypothesis is true and calculate the value of the
test statistic
3. Determine the P-value, a measure of the plausibility of the null
hypothesis
4. Conclusion in context
Don’t forget to check the assumptions!
In a contingency table, column totals produce a marginal distribution
In a contingency table, row totals also produce a marginal distribution
Each column produces a conditional distribution
Likewise, each row produces a conditional distribution
Associations:
Differences between these conditional distributions suggest an association
between the two categorical variables
But are the differences due to chance (sampling error) or a real
difference?
Use a chi-square test of independence to decide
The same steps…
To perform a χ2 test of independence, the four steps discussed for Hypothesis
Testing are used:
1. State the hypotheses
2. Compute the test statistic
3. Compute the P-value
4. Make a conclusion
Chi-square test of independence:
Step 1: Write hypotheses
H0: The two variables are not associated
HA: The two variables are associated
o H0 says the differences are due to chance
o HA says the differences are real differences
o REMEMBER: for each question the hypotheses must be written in
context
Step 2: Compute test statistic
Recall: This test statistic measures how extreme the data is, assuming H0
is true
First, compute the expected value for each cell: