chapter 241 two-way tables and the chi-square test
TRANSCRIPT
![Page 1: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/1.jpg)
Chapter 24 1
Chapter 24
Two-Way Tables and the
Chi-square Test
![Page 2: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/2.jpg)
Chapter 24 2
Thought Question 1
A random sample of registered voters were asked whether they preferred balancing the budget or cutting taxes. Each was then categorized as being either a Democrat or a Republican. Of the 30 Democrats, 12 preferred cutting taxes, while of the 40 Republicans, 24 preferred cutting taxes. How would you display the data in a table?
![Page 3: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/3.jpg)
Chapter 24 3
In this chapter we will study the relationship between two categorical variables (variables whose values fall in groups or categories).
To analyze categorical data, use the counts or percents of individuals that fall into various categories.
Categorical Variables
![Page 4: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/4.jpg)
Chapter 24 4
When there are two categorical variables, the data are summarized in a two-way table– each row represents a value of the row variable– each column represents a value of the column variable
The number of observations falling into each combination of categories is entered into each cell of the table– Relationships between categorical variables are
described by calculating appropriate percents from the counts given in the table
prevents misleading comparisons due to unequal sample sizes for different groups
Two-Way Table
![Page 5: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/5.jpg)
Chapter 24 5
Case Study
Statistical Methods for Psychology, 3rd edition, D. C. Howell, 1992, Belmont, CA: Duxbury Press, p. 154.
Helped Pick Up Pencils?Which is More Likely:Females or Males?
![Page 6: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/6.jpg)
Chapter 24 6
Case StudyDrop the Pencils
A handful of pencils were accidentally dropped, so it appeared, by the researcher in an elevator in the presence of either a female subject or a male subject. The subject’s response was observed: did the subject help pick up the pencils or not?
![Page 7: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/7.jpg)
Chapter 24 7
Case StudyThe Question
The question was whether the males or females who observed this mishap would be more likely to help pick up the pencils.
Explanatory variable: gender Response variable: “pick up” action (Y/N)
Categorical Data
![Page 8: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/8.jpg)
Chapter 24 8
Case StudyDisplay the Results: Contingency (Two-Way) Table
![Page 9: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/9.jpg)
Chapter 24 9
Case StudyDisplay the Results: Percentages
![Page 10: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/10.jpg)
Chapter 24 10
Case StudyStatistical Significance
Is the difference between the percentages for males vs. females
statistically significant?One of the following must be true:
Percentages are really the same in population; observed difference is due to chance.
- or -Percentages are really different in population;
observed difference reflects this.
![Page 11: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/11.jpg)
Chapter 24 11
Assessing Statistical Significancefor a Two-Way Table
Strength of the relationship– measured by the difference in the
sample percentages
Much easier to rule out chance with large samples
![Page 12: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/12.jpg)
Chapter 24 12
Measuring the Difference with the Chi-Square Statistic
The Chi-Square statistic measures the magnitude of the difference in the sample percentages, incorporating sample size in its calculation If percentages in the population are the same,
then the Chi-square tends to be small (near 0) If percentages in the population are different,
then the Chi-square tends to be large
![Page 13: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/13.jpg)
Chapter 24 13
Make the Decision:Is the relationship statistically significant? “Critical value” for 22 tables = 3.84 If the chi-square value (for 22 tables) is
larger than 3.84, then the relationship is considered to be statistically significant.
Note: Z = square root of the chi-square.(for 22 tables)
Critical value 3.84 is (1.96)2 [ (~2)2 ]*Note that the procedure given here is specifically for 22 tables (2 rows and 2 columns); the general procedure for any two-way table (with any number of rows and columns) is given later in this chapter (see slide 32)
![Page 14: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/14.jpg)
Chapter 24 14
Case StudyStatistical Significance
Is the difference between the percentages for males vs. females
statistically significant?• Chi-square statistic = 8.65
• Since our chi-square is 8.65 > 3.84, we conclude there is a statistically significant relationship between gender and helping to pick up the pencils.
![Page 15: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/15.jpg)
Chapter 24 15
Agenda Party Taxes Budget Total Democrat %
12 40%
18 60%
30 100%
Republican %
24 60%
16 40%
40 100%
Total %
36 51%
34 49%
70 100%
Case Study Thought Question 1
Agenda versus Political Party
Chi-square = 2.75 (significant?)
![Page 16: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/16.jpg)
Chapter 24 16
Case Study
Quitting Smoking with Nicotine Patches(JAMA, Feb. 23, 1994, pp. 595-600)
Two Categorical Variables:– Explanatory: Treatment assignment
Nicotine patch Control patch
– Response: Still smoking after 8 weeks? Yes No
![Page 17: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/17.jpg)
Chapter 24 17
Smoking after 8 weeks? Patch Yes No Total Nicotine 64
53.3% 56
46.7% 120
100%
Placebo 96 80%
24 20%
120 100%
Total 160 66.7%
80 33.3%
240 100%
Case StudyDisplay the Results: Contingency (Two-Way) Table
![Page 18: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/18.jpg)
Chapter 24 18
Case StudyStatistically Significant Relationship?
Chi-square = 19.2 There is a statistically significant
relationship between the type of patch used and the cessation of smoking for at least 8 weeks.
![Page 19: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/19.jpg)
Chapter 24 19
Case StudyPopular Ad: Seldane-D Allergy Tablets
Double-blind study of side effects– Seldane-D: 374 subjects
27 (7.2%) reporteddrowsiness
347 did not
– Placebo: 193 subjects 22 (11.4%) reported
drowsiness 171 did not
Time, 27 March 1995, p. 18
![Page 20: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/20.jpg)
Chapter 24 20
Case StudySummaries
Chi-square = 2.58 Baseline risk of drowsiness using placebo =
11.4% Risk of drowsiness using Seldane-D= 7.2% Relative risk of drowsiness using Seldane-D
versus placebo = 0.63
![Page 21: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/21.jpg)
Chapter 24 21
Case StudyConclusion
Randomized, controlled experiment Statistically insignificant relationship
between use of Seldane-D allergy tablets and presence of drowsiness.
Evidence does not support that Seldane-D causes drowsiness in some people.
![Page 22: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/22.jpg)
Chapter 24 22
A Caution About Sample Size, Statistical Significance, and
Chi-Square The effect of sample size on the chi-
square statistic when the table percentages stay the same:
For example, if n=850 (instead of 567) and all percentages remain the same, then the chi-square would be 3.87 (instead of 2.58); would the conclusion change?
demo
![Page 23: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/23.jpg)
Chapter 24 23
Inference for Relative Risk
Confidence Intervals– if two risks are the same, the relative risk is 1– see if confidence interval contains 1
Hypothesis Tests– to test if two individual risks are equal, test to
see if the relative risk is 1– use the chi-square value to find the P-value
![Page 24: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/24.jpg)
Chapter 24 24
Relationship between breast cancer and induced abortion
Case Study
Daling, et. al., (1994) “Risk of breast cancer among young women: relationship to induced abortion.” Journal of the
National Cancer Institute, Vol. 86, No. 21, pp. 1584-1592.
Is the risk of breast cancer among women who have had an induced
abortion different from the risk among those who have not?
![Page 25: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/25.jpg)
Chapter 24 25
Relationship between breast cancer and induced abortion
Case Study: Sample
845 breast cancer cases were identified in Washington State from 1983 to 1990.
910 control women were identified using random-digit dialing in the same area.
Women born prior to 1944 were excluded.
![Page 26: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/26.jpg)
Chapter 24 26
Relationship between breast cancer and induced abortion
Case Study: C.I. Results
The relative risk for breast cancer was 1.5, with the higher risk for women who had an induced abortion.
A 95% confidence interval for the relative risk was 1.2 to 1.9. (given)
Note the confidence interval does not contain the value one ( risks are different)
![Page 27: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/27.jpg)
Chapter 24 27
Relationship between breast cancer and induced abortion
Case Study: C.I. Results
No increased risk was found for women who had spontaneous abortions; the relative risk was 0.9.
A 95% confidence interval for the relative risk was 0.7 to 1.2. (given)
Note the confidence interval does contain the value one ( risks are not different)
![Page 28: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/28.jpg)
Chapter 24 28
Relationship between breast cancer and induced abortion
Case Study (continued)
Daling, et. al., (1994) “Risk of breast cancer among young women: relationship to induced abortion.” Journal of the
National Cancer Institute, Vol. 86, No. 21, pp. 1584-1592.
Is the risk of breast cancer among women who have had an induced
abortion different from the risk among those who have not?
![Page 29: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/29.jpg)
Chapter 24 29
Case Study: The Hypotheses Null: The risk of developing breast cancer
for women who have had an induced abortion is the same as the risk for women who have not had an induced abortion. [RR = 1]
Alt: The risk of developing breast cancer for women who have had an induced abortion is different from the risk for women who have not had an induced abortion. [RR 1]
![Page 30: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/30.jpg)
Chapter 24 30
Case Study: Test Statistic and P-value
Relative Risk = 1.5 Could also display data in a 22 table
and compute the chi-square value (9.75). The P-value (we will not compute this
one, just take it from the study) is 0.002. Recall: Z = square root of the chi-square.
(for 22 tables)
![Page 31: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/31.jpg)
Chapter 24 31
Case Study: Decision
Since the P-value is small, we reject chance as the reason for the relative risk (1.5) being different from 1.0.
We find the result to be statistically significant.
We reject the null hypothesis. The data provide evidence that the two population risks (of developing breast cancer) are not the same.
![Page 32: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/32.jpg)
Chapter 24 32
The remainder of this chapter presents the general procedure for determining if a significant relationship exists between two categorical variables with any number of levels– how to analyze two-way tables with any
number of rows and columns– results apply to special case of 22 tables
Two-Way Table: General Procedure
![Page 33: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/33.jpg)
Chapter 24 33
Case Study
Data from patients’ own assessment of their quality of life relative to what it had been before their heart attack (data from
patients who survived at least a year)
Health Care: Canada and U.S.
Mark, D. B. et al., “Use of medical resources and quality of life after acute myocardial infarction in Canada and the United States,” New England Journal of Medicine, 331
(1994), pp. 1130-1135.
![Page 34: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/34.jpg)
Chapter 24 34
Quality of life Canada United States
Much better 75 541
Somewhat better 71 498
About the same 96 779
Somewhat worse 50 282
Much worse 19 65
Total 311 2165
Case StudyHealth Care: Canada and U.S.
![Page 35: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/35.jpg)
Chapter 24 35
Quality of life Canada United StatesMuch better 75 541
Somewhat better 71 498About the same 96 779
Somewhat worse 50 282Much worse 19 65
Total 311 2165
Case StudyHealth Care: Canada and U.S.
Compare the Canadian group to the U.S. group in terms of feeling much better:
We have that 75 Canadians reported feeling much better, compared to 541 Americans.
The groups appear greatly different, but look at the group totals.
![Page 36: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/36.jpg)
Chapter 24 36
Quality of life Canada United StatesMuch better 75 541
Somewhat better 71 498About the same 96 779
Somewhat worse 50 282Much worse 19 65
Total 311 2165
Health Care: Canada and U.S.
Compare the Canadian group to the U.S. group in terms of feeling much better:
Change the counts to percents
Now, with a fairer comparison using percents, the groups appear very similar in terms of feeling much better.
Quality of life Canada United StatesMuch better 24% 25%
Somewhat better 23% 23%About the same 31% 36%
Somewhat worse 16% 13%Much worse 6% 3%
Total 100% 100%
Case Study
![Page 37: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/37.jpg)
Chapter 24 37
Health Care: Canada and U.S.
Is there a relationship between the explanatory variable (Country) and the response variable (Quality of life)?
Quality of life Canada United StatesMuch better 24% 25%
Somewhat better 23% 23%About the same 31% 36%
Somewhat worse 16% 13%Much worse 6% 3%
Total 100% 100%
For each level of the explanatory variable (Country), look at the percents across all levels of the response variable (Quality of life).
Case Study
Conclude that a relationship exists if these distributions look significantly different.
![Page 38: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/38.jpg)
Chapter 24 38
In tests for two categorical variables, we are interested in whether a relationship observed in a single sample reflects a real relationship in the population.
Hypotheses:– Null: the percentages for one variable are the
same for every level of the other variable(No real relationship).
– Alt: the percentages for one variable vary over levels of the other variable. (Is a real relationship).
Hypothesis Test
![Page 39: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/39.jpg)
Chapter 24 39
Health Care: Canada and U.S.Null hypothesis: The percentages for one variable are the same for every level of the other variable.(No real relationship).
Quality of life Canada United StatesMuch better 24% 25%
Somewhat better 23% 23%About the same 31% 36%
Somewhat worse 16% 13%Much worse 6% 3%
Total 100% 100%
For example, could look at differences in percentages between Canada and U.S. for each level of “Quality of life”:
24% vs. 25% for those who felt ‘Much better’,23% vs. 23% for ‘Somewhat better’, etc.
* Want to do all of these comparisons as one overall test…
Case Study
![Page 40: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/40.jpg)
Chapter 24 40
H0: no real relationship between the two categorical variables that make up the rows and columns of a two-way table
To test H0, compare the observed counts in the table (the original data) with the expected counts (the counts we would expect if H0 were true)– if the observed counts are far from the expected
counts, that is evidence against H0 in favor of a real relationship between the two variables
Hypothesis Test
![Page 41: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/41.jpg)
Chapter 24 41
The expected count in any cell of a two-way table (when H0 is true) is
Expected Counts
total tabletotal) (column total)(row count expected
![Page 42: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/42.jpg)
Chapter 24 42
Quality of life Canada United States TotalMuch better 75 541 616
Somewhat better 71 498 569About the same 96 779 875
Somewhat worse 50 282 332Much worse 19 65 84
Total 311 2165 2476
Case StudyHealth Care: Canada and U.S.
For the expected count of Canadians who feel ‘Much better’ (expected count for Row 1, Column 1):
For the observed data to the right, find the expected value for each cell:
77.372476
311616
total table
total) (column1 total) (row1 count expected
![Page 43: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/43.jpg)
Chapter 24 43
Quality of life Canada United StatesMuch better 75 541
Somewhat better 71 498About the same 96 779
Somewhat worse 50 282Much worse 19 65
Case StudyHealth Care: Canada and U.S.
Observed counts:
Quality of life Canada United StatesMuch better 77.37 538.63
Somewhat better 71.47 497.53About the same 109.91 765.09
Somewhat worse 41.70 290.30Much worse 10.55 73.45
Expected counts:
Compare to see if the data support the null hypothesis
![Page 44: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/44.jpg)
Chapter 24 44
To determine if the differences between the observed counts and expected counts are statistically significant (to show a real relationship between the two categorical variables), we use the chi-square statistic:
Chi-Square Statistic
count expected
count expectedcount observed 22X
where the sum is over all cells in the table.
![Page 45: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/45.jpg)
Chapter 24 45
The chi-square statistic is a measure of the distance of the observed counts from the expected counts– is always zero or positive– is only zero when the observed counts are exactly
equal to the expected counts
– large values of X2 are evidence against H0 because these would show that the observed counts are far from what would be expected if H0 were true
– the chi-square test is one-sided (any violation of H0 produces a large value of X2)
Chi-Square Statistic
![Page 46: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/46.jpg)
Chapter 24 46
Quality of life Canada United States
Much better 75 541Somewhat better 71 498
About the same 96 779Somewhat worse 50 282
Much worse 19 65
Case StudyHealth Care: Canada and U.S.
Observed countsCanada United States
77.37 538.6371.47 497.53
109.91 765.0941.70 290.30
10.55 73.45
Expected counts
11.725
0.0100.073
538.63
538.63541
77.37
77.3775 22
2X
![Page 47: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/47.jpg)
Chapter 24 47
Calculate value of chi-square statistic– by hand (cumbersome)– using technology (computer software, etc.)
Find P-value in order to reject or fail to reject H0
– use chi-square table for chi-square distribution (next few slides)
– from computer output If significant relationship exists (small P-value):
– compare appropriate percents in data table– compare individual observed and expected cell counts– look at individual terms in the chi-square statistic
Chi-Square Test
![Page 48: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/48.jpg)
Chapter 24 48
Case StudyHealth Care: Canada and U.S.
Using Technology:
![Page 49: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/49.jpg)
Chapter 24 49
Family of distributions that take only positive values and are skewed to the right
Specific chi-square distribution is specified by giving its degrees of freedom (formula on next slide)
Chi-Square Distributions
![Page 50: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/50.jpg)
Chapter 24 50
Chi-square test for a two-way table withr rows and c columns uses critical values from a chi-square distribution with(r 1)(c 1) degrees of freedom
P-value is the area to the right of X2 under the density curve of the chi-square distribution– use chi-square table
Chi-Square Distributions
![Page 51: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/51.jpg)
Chapter 24 51
Chi-Square Table See Chapter 24 in text for Table 24.1
![Page 52: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/52.jpg)
Chapter 24 52
Finding the P-value for a chi-square test:– use the row for the appropriate degrees of
freedom (df) in the left margin of the table– locate the X2 value in the body of the table– the corresponding probability of lying to the
right of this value is found in the top margin of the table (this is the P-value)
– usually, the observed X2 value will be between two values in the table, and the P-value is reported as being between two values
Chi-Square P-value
![Page 53: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/53.jpg)
Chapter 24 53
Quality of life Canada United StatesMuch better 75 541
Somewhat better 71 498About the same 96 779
Somewhat worse 50 282Much worse 19 65
Case StudyHealth Care: Canada and U.S.
X2 = 11.725
df = (r1)(c1)= (51)(21)= 4
Look in the df=4 row of Table 24.1; the value X2 = 11.725 falls between the 0.05 and 0.01 critical values.
Thus, the P-value for this chi-square test is between 0.01 and 0.05 (is actually 0.019482 ~ 0.02).
** P-value < .05, so we conclude a significant relationship **
Table 24.1
![Page 54: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/54.jpg)
Chapter 24 54
To be significant at level (the cut-off value), the chi-square statistic must be larger than the table entry for – Example: for = .05 (typical cut-off), and
df = 4, the test is significant if X2 > 9.48 previous Case Study had X2 = 11.725 > 9.48
– Note: for 22 tables, df = (21)(21) = 1, and the test is significant if X2 > 3.84
Chi-Square Critical Values
![Page 55: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/55.jpg)
Chapter 24 55
Tests the null hypothesis H0: no relationship between two categorical variables
when you have a two-way table from either of these situations:– Independent SRSs from each of several populations, with each
individual classified according to one categorical variable[Example: Health Care case study: two samples (Canadians & Americans); each individual classified according to “Quality of life”]
– A single SRS with each individual classified according to both of two categorical variables[Example: Sample of 8235 subjects, with each classified according to their “Job Grade” (1, 2, 3, or 4) and their “Marital Status” (Single, Married, Divorced, or Widowed)]
Uses of the Chi-Square Test
![Page 56: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/56.jpg)
Chapter 24 56
The chi-square test is an approximate method, and becomes more accurate as the counts in the cells of the table get larger
The following must be satisfied for the approximation to be accurate:– No more than 20% of the expected counts are less
than 5– All individual expected counts are 1 or greater
If these requirements fail, then two or more groups must be combined to form a new (‘smaller’) two-way table
Chi-Square Test: Requirements
![Page 57: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/57.jpg)
Chapter 24 57
When studying the relationship between two variables, there may exist a lurking variable that creates a reversal in the direction of the relationship when the lurking variable is ignored as opposed to the direction of the relationship when the lurking variable is considered.
The lurking variable creates subgroups, and failure to take these subgroups into consideration can lead to misleading conclusions regarding the association between the two variables.
Simpson’s Paradox
![Page 58: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/58.jpg)
Chapter 24 58
Consider the acceptance rates for the following group of men and women who applied to college.
Discrimination?(Simpson’s Paradox)
counts AcceptedNot
acceptedTotal
Men 198 162 360
Women 88 112 200
Total 286 274 560
percents AcceptedNot
accepted
Men 55% 45%
Women 44% 56%
A higher percentage of men were accepted: Discrimination?
![Page 59: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/59.jpg)
Chapter 24 59
Discrimination?(Simpson’s Paradox)
counts AcceptedNot
acceptedTotal
Men 18 102 120
Women 24 96 120
Total 42 198 240
percents AcceptedNot
accepted
Men 15% 85%
Women 20% 80%
A higher percentage of women were accepted in Business
Lurking variable: Applications were split between the Business School (240) and the Art School (320).
BUSINESS SCHOOL
![Page 60: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/60.jpg)
Chapter 24 60
Discrimination?(Simpson’s Paradox)
counts AcceptedNot
acceptedTotal
Men 180 60 240
Women 64 16 80
Total 244 76 320
percents AcceptedNot
accepted
Men 75% 25%
Women 80% 20%
ART SCHOOL
A higher percentage of women were also accepted in Art
Lurking variable: Applications were split between the Business School (240) and the Art School (320).
![Page 61: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/61.jpg)
Chapter 24 61
So within each school a higher percentage of women were accepted than men.There is not any discrimination against women!!!
This is an example of Simpson’s Paradox. When the lurking variable (School applied to: Business or Art) is ignored, the data seem to suggest discrimination against women. However, when the School is considered, the association is reversed and suggests discrimination against men.
Discrimination?(Simpson’s Paradox)
![Page 62: Chapter 241 Two-Way Tables and the Chi-square Test](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649eff5503460f94c14f48/html5/thumbnails/62.jpg)
Chapter 24 62
Key Concepts
Displaying data in a contingency (two-way) table Concept of statistical significance with respect to
a 22 table (chi-square critical value) Interpreting confidence intervals for relative risk Interpreting hypothesis tests for relative risk Chi-square statistic and a statistically significant
relationship for any two-way table Simpson’s Paradox