Quantitative Methods in Social Science 360-300 • CEGEP, Montreal

Corrected exercises: cross-tabulations, chi-square and association (360-300)

These ten corrected exercises cover the central tool of Quantitative Methods, 360-300, in Social Science: the cross-tabulation (crosstab), its chi-square test, and the measures that finally say whether the relationship is strong.

The thread of the set fits in one sentence: the chi-square answers “is there a relationship?” and never “is it strong?”, because it is proportional to the sample size. With enough respondents everything becomes significant, and it is Cramér's V that restores a sense of scale.

Three traps are named explicitly: the percentage computed in the wrong direction, the chi-square applied to percentages instead of counts, and a failure to reject read as proof of independence.

10 corrected exercises • 100 points • 150 minutes

This chapter is part of 360-300, every chapter with its set and sheet Before you start Revision sheet: the traps and the method for this chapter

Self-checking set Type your answers and check them question by question: the page tells you right or wrong before you open the solution. With an account, every answer right on the first try earns points, and your right answers stay filled in when you come back.

Course recap

  • • In a crosstab, you compute percentages IN THE DIRECTION of the independent variable, and compare those percentages from one category to the next.
  • • Expected frequency of a cell: Eij=Ri×CjnE_{ij}=\dfrac{R_{i}\times C_{j}}{n}. The expected table has exactly the same marginal totals as the observed table.
  • • The sum of the differences O−EO-E is always zero: that is why they are squared.
  • • χ2=∑(O−E)2E\chi^{2}=\sum \dfrac{\left(O-E\right)^{2}}{E}, with df=(r−1)(c−1)df=\left(r-1\right)\left(c-1\right). Critical values at 5%: 3.841 for 1 degree of freedom, 5.991 for 2, 7.815 for 3, 9.488 for 4.
  • • Read the CONTRIBUTIONS cell by cell: the overall chi-square says there is a relationship, the contributions say where it is.
  • • Conditions: independent observations, expected frequencies above 5 (at most 20% of the cells between 1 and 5), and the calculation made on COUNTS, never on percentages.
  • • Yates' correction on a 2 by 2 table: subtract 0.5 from each absolute difference before squaring it. It always lowers the chi-square.
  • • Cramér's V=χ2n×min⁡(r−1, c−1)V=\sqrt{\dfrac{\chi^{2}}{n\times \min\left(r-1,\ c-1\right)}}, between 0 and 1. Landmarks: below 0.10 negligible, 0.10 to 0.20 weak, 0.20 to 0.40 moderate.
  • • Multiplying every count by kk multiplies the chi-square by kk and leaves VV unchanged.
  • • Failing to reject never demonstrates independence: it is a lack of evidence, often a lack of power.
  • • ELABORATION: redo the table within each category of a third variable. Three outcomes: replication, explanation (spurious relationship) and specification (interaction).

Part A: the basics (/50)

Exercise 1: The cross-tabulation: three percentages, three questions

The cross-tabulation (crosstab) is the central tool of the social sciences: it sets two categorical variables face to face and shows whether one varies with the other. You still have to compute the right percentage, because every cell admits three of them, and they answer three different questions.

A survey of 300 students: hours of paid work per week, and whether the student dropped at least one course during the semester.

Hours of workDropped a courseDid not drop a courseTotal
0 to 10 h18102120
11 to 20 h2496120
21 h or more213960
Total63237300
  • a) Compute the three possible percentages of the cell “21 h or more, dropped a course” and say which question each one answers.
  • b) Compute the ROW percentages for the three work profiles. What do they show?
  • c) Which direction of calculation should be chosen here, and why? State the general rule.
  • d) Compute the column percentages for the column “dropped a course” and say why they do not answer the question asked.
  • e) A colleague claims that the table proves that paid work causes dropping a course. How do you reply?

Type your answers, the page tells you right or wrong 0/16

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) 7.0%7.0\% of the total, 35.0%35.0\% by row, 33.3%33.3\% by column: three different questions
  • b) 15.0%15.0\%, 20.0%20.0\% and 35.0%35.0\%: the share who dropped a course more than doubles from the first profile to the last
  • c) By row, in the direction of the independent variable: each profile is brought to a base of 100
  • d) 28.6%28.6\%, 38.1%38.1\%, 33.3%33.3\%: the composition of those who dropped a course, not their risk
  • e) An association, not a causal relationship: reverse causation, a confounding variable, a non-experimental design
a)

Percentage of the GRAND TOTAL: 21300=7.0%\dfrac{21}{300}=7.0\%, which answers “what share of all respondents both work a lot AND dropped a course”. ROW percentage: 2160=35.0%\dfrac{21}{60}=35.0\%, which answers “among those who work 21 hours or more, what share dropped a course”. COLUMN percentage: 2163≈33.3%\dfrac{21}{63}\approx 33.3\%, which answers “among those who dropped a course, what share worked a lot”. Three numbers, three questions, and only one of the three is the question of the survey.

b)

Row percentages of dropping a course: 18120=15.0%\dfrac{18}{120}=15.0\%, 24120=20.0%\dfrac{24}{120}=20.0\%, 2160=35.0%\dfrac{21}{60}=35.0\%. They show that the share of students who dropped a course rises steadily with the hours worked, and that it more than doubles between the first and the last profile. That is exactly the reading that a 100% stacked bar chart makes visible at a glance.

c)

You must compute the percentages IN THE DIRECTION of the independent variable, here the hours of work, so by row. The general rule is simple and worth remembering: compute percentages within the categories of the INDEPENDENT variable, and compare those percentages from one category to the next. Each group is then brought to a base of 100, which neutralizes the fact that the three profiles do not have the same size, 120, 120 and 60.

d)

Column percentages: 1863≈28.6%\dfrac{18}{63}\approx 28.6\%, 2463≈38.1%\dfrac{24}{63}\approx 38.1\%, 2163≈33.3%\dfrac{21}{63}\approx 33.3\%. They describe the COMPOSITION of the group of students who dropped a course, and they depend as much on the size of each profile in the sample as on the relationship under study. The “21 h or more” profile looks unremarkable there, 33.3%, when it is by far the most at risk, simply because it has only 60 people. Reading a table in the wrong direction is the most common error of the semester, and it regularly reverses the conclusion.

e)

Reply that the table establishes an ASSOCIATION, not a causal relationship. Three objections stand on these data alone. The causation may run the other way: a struggling student lightens the course load and takes a job, so dropping the course comes before the work. A confounding variable may explain both: the financial situation of the household pushes students to work and makes studies more fragile. Finally, the sample is not experimental: nobody was randomly assigned to 21 hours of work. What the table does allow you to say is that students who work a lot drop courses more often, and that this deserves an explanation.

15%0 to 10 h20%11 to 20 h35%21 h or moreshare who dropped a course, each bar = 100%

Tick the exercises you have done or want to review: a free account, no password, keeps your ticks and your right answers from one visit to the next, tells you which chapter to tackle next and lets you ask for the exercise you are missing. Create your space, an email is enough.

Exercise 2: Expected frequencies: what independence would look like

To judge a gap, you need a point of comparison. The point of comparison of a crosstab is the table you would get if the two variables were perfectly INDEPENDENT, with all the totals kept.

  • a) Under the hypothesis of independence, what would the share of students who dropped a course be in EACH profile? Justify.
  • b) Give the formula for the expected frequency of a cell and compute the six expected frequencies of the previous table.
  • c) Check that the totals of the expected table are those of the observed table.
  • d) Compute the six differences O−EO-E. What do you notice about their sum, and why?
  • e) Which profile departs most from independence? Compare the absolute difference and the RELATIVE difference.

Type your answers, the page tells you right or wrong 0/17

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) 63300=21.0%\dfrac{63}{300}=21.0\% in all three profiles: that is the definition of independence
  • b) Eij=RiCjnE_{ij}=\dfrac{R_{i}C_{j}}{n}: 25.225.2 and 94.894.8 twice, then 12.612.6 and 47.447.4
  • c) Rows 120120, 120120, 6060; columns 6363 and 237237; grand total 300300
  • d) −7.2-7.2, +7.2+7.2, −1.2-1.2, +1.2+1.2, +8.4+8.4, −8.4-8.4: the sum is zero, hence the squares
  • e) “21 h or more”: 8.48.4 in absolute terms, and 8.412.6=66.7%\dfrac{8.4}{12.6}=66.7\% in relative terms against 28.6%28.6\%
a)

Under independence, the share who dropped a course would be the SAME in all three profiles, and it would equal the overall share: 63300=21.0%\dfrac{63}{300}=21.0\%. That is the very definition of independence between two variables: knowing the number of hours worked would give no information about the probability of dropping a course.

b)

Expected frequency: Eij=row i total×column j totalnE_{ij}=\dfrac{\text{row } i \text{ total}\times \text{column } j \text{ total}}{n}. Row “0 to 10 h”: 120×63300=25.2\dfrac{120\times 63}{300}=25.2 and 120×237300=94.8\dfrac{120\times 237}{300}=94.8. Row “11 to 20 h”: the same, 25.2 and 94.8, since the row total is identical. Row “21 h or more”: 60×63300=12.6\dfrac{60\times 63}{300}=12.6 and 60×237300=47.4\dfrac{60\times 237}{300}=47.4. The expected frequencies are decimals, and they must never be rounded: they are expected values, not counts.

c)

Row totals: 25.2+94.8=12025.2+94.8=120, 25.2+94.8=12025.2+94.8=120, 12.6+47.4=6012.6+47.4=60. Column totals: 25.2+25.2+12.6=6325.2+25.2+12.6=63 and 94.8+94.8+47.4=23794.8+94.8+47.4=237. Grand total: 300. This check is the best error control of the chapter, and it is immediate: by construction, the expected table has exactly the same marginal totals as the observed table, and only the internal split changes.

d)

Differences O−EO-E: 18−25.2=−7.218-25.2=-7.2; 102−94.8=+7.2102-94.8=+7.2; 24−25.2=−1.224-25.2=-1.2; 96−94.8=+1.296-94.8=+1.2; 21−12.6=+8.421-12.6=+8.4; 39−47.4=−8.439-47.4=-8.4. Their sum is zero, and so is the sum within each row. This is unavoidable since the two tables have the same margins: what is missing in one cell is necessarily found in another cell of the same row. This property is the reason why the differences are SQUARED before being added, since otherwise the sum would always be zero and would measure nothing.

e)

In ABSOLUTE terms, it is the “21 h or more” profile with a difference of 8.4, against 7.2 for the first profile. In RELATIVE terms, the gap is even clearer: 8.412.6=66.7%\dfrac{8.4}{12.6}=66.7\% more students who dropped a course than expected, against 7.225.2=28.6%\dfrac{7.2}{25.2}=28.6\% fewer than expected for the first profile. This is exactly what the chi-square formalizes by dividing the square of the difference by the expected frequency: a difference of 8.4 in a cell that expected only 12.6 weighs far more than the same difference in a cell that expected 95.

25.294.80 to 10 h25.294.811 to 20 h12.647.421 h or morebars: observed; dashes and numbers: expecteddroppeddid not

Exercise 3: The chi-square: compute, decide, and read cell by cell

The chi-square adds up the squared differences, each one scaled by what was expected. It then yields a decision and, above all, if you read it cell by cell, it tells you WHERE the relationship is.

χ2=∑(O−E)2E\chi^{2}=\sum \dfrac{\left(O-E\right)^{2}}{E}, with df=(r−1)(c−1)df=\left(r-1\right)\left(c-1\right). Critical values at 5%: 3.841 for 1 degree of freedom, 5.991 for 2, 7.815 for 3, 9.488 for 4.

246810125.991: reject beyond (5%)chi-square, 2 df
  • a) State the null and alternative hypotheses of the test of independence.
  • b) Compute the six contributions and the total chi-square of the hours of work table.
  • c) Give the number of degrees of freedom and conclude at the 5% level.
  • d) Which cell contributes most to the chi-square? What share of the total does it represent?
  • e) Does rejecting the null hypothesis prove that the relationship is strong? What else must be computed?

Type your answers, the page tells you right or wrong 0/15

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) H0H_{0}: the two variables are independent. H1H_{1}: they are not independent, with no indication of direction
  • b) 2.0572.057, 0.5470.547, 0.0570.057, 0.0150.015, 5.6005.600, 1.4891.489, so χ2≈9.765\chi^{2}\approx 9.765
  • c) df=2df=2, critical value 5.9915.991: we reject, with a p-value between 0.0010.001 and 0.010.01
  • d) “21 h or more, dropped a course”, 57.3%57.3\% of the total; the whole profile accounts for more than 72%72\%
  • e) No: rejection says nothing about strength, which is read on Cramér's V
a)

NULL hypothesis: hours of paid work and dropping a course are INDEPENDENT in the population, meaning that the share who drop a course is the same whatever the profile. ALTERNATIVE hypothesis: the two variables are not independent. Two remarks matter for what follows: the null hypothesis is the one we try to refute, and the alternative says nothing about the DIRECTION of the relationship, which is a limitation of the chi-square.

b)

Contributions (O−E)2E\dfrac{\left(O-E\right)^{2}}{E}: (−7.2)225.2=51.8425.2≈2.057\dfrac{\left(-7.2\right)^{2}}{25.2}=\dfrac{51.84}{25.2}\approx 2.057; 51.8494.8≈0.547\dfrac{51.84}{94.8}\approx 0.547; 1.4425.2≈0.057\dfrac{1.44}{25.2}\approx 0.057; 1.4494.8≈0.015\dfrac{1.44}{94.8}\approx 0.015; 70.5612.6=5.600\dfrac{70.56}{12.6}=5.600; 70.5647.4≈1.489\dfrac{70.56}{47.4}\approx 1.489. Total: χ2≈9.765\chi^{2}\approx 9.765.

c)

df=(3−1)(2−1)=2df=\left(3-1\right)\left(2-1\right)=2. The critical value at 5% is 5.991. Since 9.765>5.9919.765>5.991, we REJECT the hypothesis of independence: the association observed between hours of work and dropping a course is statistically significant at the 5% level. We can be more precise: the value also exceeds the 1% critical value, 9.210, but not the 0.1% one, 13.816. The p-value therefore lies between 0.001 and 0.01.

d)

The cell “21 h or more, dropped a course” contributes 5.600, that is 5.6009.765≈57.3%\dfrac{5.600}{9.765}\approx 57.3\% of the total chi-square. Adding its neighbour in the same row, 1.489, the heavy-workers profile alone accounts for more than 72% of the departure from independence. This is an essential and often neglected reading: the overall chi-square says there is a relationship, the table of contributions says WHERE it is, and here it is entirely concentrated on the third profile.

e)

No. Rejection says that the observed gap is too large to be attributed to sampling chance alone; it says nothing about the STRENGTH of the relationship. The proof is that, for an identical structure, the chi-square grows in proportion to the sample size: any gap, however tiny, becomes significant with enough respondents. You must therefore also compute a normalized measure of ASSOCIATION, Cramér's V or the contingency coefficient, which does not depend on nn.

246810125.991: reject beyond (5%)9.77 observedchi-square, 2 df

Exercise 4: The conditions of application, and what to do when they fail

The chi-square relies on an approximation that stops being valid when the cells are too empty. Three rules are enough, and each one is repaired in a precise way.

ProgramVery satisfiedSatisfiedNot very satisfiedDissatisfied
Social Science3852146
Natural Science223193
Arts and Letters81142
  • a) State the three conditions of application of the chi-square test of independence.
  • b) Compute the expected frequencies of the row “Arts and Letters” and check the condition on the cells.
  • c) Propose a merging of categories that restores the conditions, and say what it costs.
  • d) On a 2 by 2 table, Yates' correction subtracts 0.5 from each absolute difference before squaring it. Apply it to the 2 by 2 table made of 12, 8, 6 and 14, and compare.
  • e) What should you do if the conditions remain impossible to satisfy?

Type your answers, the page tells you right or wrong 0/17

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) Independent observations, expected frequencies above 5, and a calculation on COUNTS
  • b) 8.58.5, 11.7511.75, 3.3753.375 and 1.3751.375: three cells out of twelve below 5, that is 25%25\%, beyond the tolerance
  • c) Merge the two lowest levels: only one cell below 5 out of nine, that is 11%11\%
  • d) χ2=3.636\chi^{2}=3.636 without correction, 2.5252.525 with Yates: the correction is conservative
  • e) Merge, switch to Fisher's exact test, or enlarge the sample; never force the test
a)

First condition, the INDEPENDENCE of the observations: each individual appears in only one cell, which rules out multiple-response questions and repeated measurements on the same people. Second condition, all the expected frequencies must be ABOVE 5, or more flexibly, at most 20% of the cells may have an expected frequency between 1 and 5, and none may fall below 1. Third condition, the test is applied to COUNTS, never to percentages: computing a chi-square on a table of percentages amounts to pretending that the sample has exactly 100 people.

b)

Total for “Arts and Letters”: 8+11+4+2=258+11+4+2=25. Column totals: 38+22+8=6838+22+8=68; 52+31+11=9452+31+11=94; 14+9+4=2714+9+4=27; 6+3+2=116+3+2=11. Grand total: 200. Expected frequencies of the row: 25×68200=8.5\dfrac{25\times 68}{200}=8.5; 25×94200=11.75\dfrac{25\times 94}{200}=11.75; 25×27200=3.375\dfrac{25\times 27}{200}=3.375; 25×11200=1.375\dfrac{25\times 11}{200}=1.375. Two cells out of four fall below 5, and among the twelve cells of the table, the three cells below 5 make up 25% of the total, which exceeds the 20% tolerance. The test is therefore not applicable as it stands.

c)

Merge the two lowest levels of satisfaction into one, “not very satisfied or dissatisfied”. The row “Arts and Letters” then has observed frequencies 8, 11 and 6, and expected frequencies 8.5, 11.75 and 25×38200=4.75\dfrac{25\times 38}{200}=4.75. Only one cell in nine remains below 5, that is 11%, which is acceptable. The cost is twofold: you lose the distinction between “not very satisfied” and “dissatisfied”, so information is lost, and above all you chose the merging AFTER seeing the data, a decision that must be honestly declared in the report. A merging decided in advance, for reasons of content, is always preferable.

d)

Table 12, 8 / 6, 14: the row totals are 20 and 20, the column totals 18 and 22, and n=40n=40. Expected frequencies: 20×1840=9\dfrac{20\times 18}{40}=9 and 20×2240=11\dfrac{20\times 22}{40}=11, in both rows. Without correction: χ2=99+911+99+911≈3.636\chi^{2}=\dfrac{9}{9}+\dfrac{9}{11}+\dfrac{9}{9}+\dfrac{9}{11}\approx 3.636, below the critical value 3.841: we fail to reject. With Yates' correction, each absolute difference of 3 becomes 2.5: χ2=6.259×2+6.2511×2≈2.525\chi^{2}=\dfrac{6.25}{9}\times 2+\dfrac{6.25}{11}\times 2\approx 2.525, even further from the critical value. The correction is therefore CONSERVATIVE: it always lowers the chi-square and makes rejection harder, which compensates for the fact that the continuous chi-square distribution approximates a discrete reality.

e)

Three routes. Merge categories, which remains the simplest solution when the merging makes sense in terms of content. Use Fisher's EXACT test, which directly computes the probability of every possible table with fixed margins and requires no condition on the frequencies; it is instantaneous with software today, and it is the right answer for a small 2 by 2 table. Finally, enlarge the sample, which is the only solution if you want to keep all the categories. What you must never do is apply the test anyway and hope that nobody checks: p-values obtained on nearly empty cells are plainly wrong, not just approximate.

Exercise 5: Measuring strength: Cramér's V

The chi-square answers “does the relationship exist?”. Cramér's V answers “is it strong?”. The two questions are independent, and mixing up the answers is the most common error in research reports.

V=χ2n×min⁡(r−1, c−1)V=\sqrt{\dfrac{\chi^{2}}{n\times \min\left(r-1,\ c-1\right)}}, between 0 and 1.

  • a) Compute Cramér's V for the hours of work table, where χ2=9.765\chi^{2}=9.765 and n=300n=300.
  • b) Interpret the value obtained with the usual landmarks: below 0.10 negligible, 0.10 to 0.20 weak, 0.20 to 0.40 moderate, beyond that strong.
  • c) Show that VV equals 0 in case of perfect independence, and 1 in case of complete dependence on a 2 by 2 table.
  • d) The contingency coefficient is C=χ2χ2+nC=\sqrt{\dfrac{\chi^{2}}{\chi^{2}+n}}. Compute it here and say why VV is often preferred to it.
  • e) Write the concluding sentence that the report should contain.

Type your answers, the page tells you right or wrong 0/12

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) V=9.765300≈0.180V=\sqrt{\dfrac{9.765}{300}}\approx 0.180
  • b) WEAK association, just above negligible: the relationship is real and remains modest
  • c) Perfect independence: χ2=0\chi^{2}=0 so V=0V=0. Pure diagonal: χ2=n\chi^{2}=n so V=1V=1
  • d) C=9.765309.765≈0.178C=\sqrt{\dfrac{9.765}{309.765}}\approx 0.178; it never reaches 1 and its maximum depends on the format
  • e) Direction from the percentages, significance from the test, strength from V, plus the limit of the design
a)

min⁡(3−1, 2−1)=1\min\left(3-1,\ 2-1\right)=1, so V=9.765300×1=0.03255≈0.180V=\sqrt{\dfrac{9.765}{300\times 1}}=\sqrt{0.03255}\approx 0.180.

b)

A value of 0.18 corresponds to a WEAK association, only just above the threshold of negligibility. In other words, the relationship between hours of work and dropping a course is real in the statistical sense, it is much larger than what chance would produce, and it remains modest: knowing the work profile of a student improves the prediction of dropping a course only marginally. This is the nuance that the headline of a press release always loses.

c)

If the two variables are independent, every observed frequency equals its expected frequency, all the differences are zero, so χ2=0\chi^{2}=0 and V=0V=0. At the other extreme, on a 2 by 2 table where all the observations lie on one diagonal, for example 50 and 0 in the first row, 0 and 50 in the second, the expected frequencies are all equal to 25 and χ2=4×62525=100=n\chi^{2}=4\times \dfrac{625}{25}=100=n. Since min⁡(r−1, c−1)=1\min\left(r-1,\ c-1\right)=1, we get V=100100=1V=\sqrt{\dfrac{100}{100}}=1. So VV is indeed normalized between 0 and 1, and it is precisely the division by nn that makes it insensitive to the sample size.

d)

C=9.7659.765+300=9.765309.765≈0.178C=\sqrt{\dfrac{9.765}{9.765+300}}=\sqrt{\dfrac{9.765}{309.765}}\approx 0.178. The value is very close to VV, which is normal for a weak association. VV is preferred because the contingency coefficient NEVER reaches 1: its maximum depends on the dimensions of the table, about 0.707 for a 2 by 2 table and 0.816 for a 3 by 3. Two contingency coefficients from tables of different formats are therefore not comparable, whereas two values of VV are.

e)

“Among 300 students, the proportion who dropped a course rises from 15.0% among those who work at most 10 hours a week to 35.0% among those who work 21 hours or more. The association is statistically significant, χ2=9.77\chi^{2}=9.77 with 2 degrees of freedom, p-value below 0.01, but its strength is weak, V=0.18V=0.18. More than half of the departure from independence comes from the 21 hours or more profile alone. Since these data are cross-sectional and non-experimental, they do not establish a cause-and-effect relationship.” Four elements never to omit: the percentages that show the DIRECTION, the test that shows the SIGNIFICANCE, the measure that shows the STRENGTH, and the limit of the design.

Part B: problems and reasoning (/50)

Exercise 6: Why everything becomes significant with enough people

One property of the chi-square explains half of the bad conclusions that get published: it is proportional to the sample size when the structure of the table does not change.

  • a) Every count in the hours of work table is doubled, with no change in the proportions. What happens to the chi-square? Justify algebraically.
  • b) What happens to Cramér's V? Justify.
  • c) A 2 by 2 table shows 51% against 49% success between two groups. What sample size is needed to make the gap significant at the 5% level?
  • d) What should you conclude about the use of the word “significant” in a report?
  • e) The symmetric problem also exists. Describe it and say how to guard against it.

Type your answers, the page tells you right or wrong 0/11

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) It DOUBLES, to 19.5319.53: each term is multiplied by kk, and the critical value does not move
  • b) Unchanged at 0.1800.180: the factor kk cancels between numerator and denominator
  • c) 0.0004n≥3.8410.0004n\ge 3.841, so n≥9,603n\ge 9{,}603, for a VV of 0.020.02
  • d) That it does not mean “important”; publish the raw gap, the test and the strength together
  • e) A lack of power; compute the power before the survey and publish intervals
a)

The chi-square is MULTIPLIED BY TWO, going from 9.765 to 19.53. Algebraically: if all the observed frequencies are multiplied by kk, the row and column totals are as well, so each expected frequency R×Cn\dfrac{R\times C}{n} is multiplied by k×kk=k\dfrac{k\times k}{k}=k. Each term then becomes (kO−kE)2kE=k2(O−E)2kE=k(O−E)2E\dfrac{\left(kO-kE\right)^{2}}{kE}=\dfrac{k^{2}\left(O-E\right)^{2}}{kE}=k\dfrac{\left(O-E\right)^{2}}{E}. The chi-square is therefore exactly proportional to nn, while the critical value does not move: it depends only on the degrees of freedom.

b)

Cramér's V is UNCHANGED: V=kχ2kn×min⁡(r−1,c−1)V=\sqrt{\dfrac{k\chi^{2}}{kn\times \min\left(r-1,c-1\right)}}, and the factor kk cancels. With n=900n=900 and χ2=29.29\chi^{2}=29.29, we get back V=29.29900≈0.180V=\sqrt{\dfrac{29.29}{900}}\approx 0.180. This is precisely the property that makes VV a measure of STRENGTH: it describes the structure of the table, not the amount of data collected.

c)

On a 2 by 2 table with equal groups and proportions 0.51 and 0.49, the chi-square is approximately n×(p1−p2)24p‾(1−p‾)n\times \dfrac{\left(p_{1}-p_{2}\right)^{2}}{4\overline{p}\left(1-\overline{p}\right)} with p‾=0.50\overline{p}=0.50, that is n×0.00041=0.0004nn\times \dfrac{0.0004}{1}=0.0004n. We need 0.0004n≥3.8410.0004n\ge 3.841, so n≥9,603n\ge 9{,}603. With nearly ten thousand respondents, a gap of two points therefore becomes significant, while Cramér's V is 3.8419,603=0.02\sqrt{\dfrac{3.841}{9{,}603}}=0.02, a perfectly negligible association.

d)

That it must stop being read as “important”. “Significant” means nothing more than “too large to be reasonably attributed to sampling chance, given the sample size”. A serious report therefore always publishes three things together: the raw measure of the gap, in percentage points, the result of the test, and a normalized measure of strength. On very large administrative files, where nn exceeds a million, the test loses all practical interest since absolutely everything is significant.

e)

The symmetric problem is a lack of POWER: with a sample that is too small, a real and even important relationship may fail to reach significance, and you wrongly conclude that there is no relationship. Failing to reject the null hypothesis has never meant that it is true. You guard against it by computing the power BEFORE the survey, which amounts to choosing the sample size according to the smallest gap you want to be able to detect, and by publishing confidence intervals rather than the rejection decision alone.

9.765n = 300V = 0.1819.53n = 600V = 0.1829.295n = 900V = 0.18

Exercise 7: Controlling for a third variable

An association between two variables must always be judged in the presence of a third. The method, called elaboration, consists in redoing the table within each category of the control variable.

Among 400 students, we cross participation in extracurricular activities with passing all courses.

ParticipatesDoes not participate
Overall: passed all courses145 out of 200 (72.5%)115 out of 200 (57.5%)
Works little: passed all courses120 out of 150 (80%)40 out of 50 (80%)
Works a lot: passed all courses25 out of 50 (50%)75 out of 150 (50%)
  • a) Describe the association observed overall, in percentage points.
  • b) Describe the association within each stratum. What do you notice?
  • c) Check that the frequencies of the strata add up to those of the whole.
  • d) Explain the mechanism: by what path did the overall association appear?
  • e) Name the three possible outcomes of an elaboration and say which one this case belongs to.

Type your answers, the page tells you right or wrong 0/17

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) 72.5%72.5\% against 57.5%57.5\%: a gap of 15.015.0 points
  • b) 80%80\% against 80%80\%, and 50%50\% against 50%50\%: ZERO gap in both strata
  • c) 200200 participants of whom 145145 passed, 200200 non-participants of whom 115115 passed; 400400 students, 260260 who passed
  • d) Hours of work determine both participation and success: a common antecedent variable
  • e) Replication, explanation, specification; here an EXPLANATION, the association was spurious
a)

Overall, 72.5% of the participants pass all their courses against 57.5% of the non-participants, a gap of 15.0 POINTS in favour of the participants. A hasty report would conclude that extracurricular activities promote success, and the institution would fund the program.

b)

Among those who work little: 80% against 80%, ZERO gap. Among those who work a lot: 50% against 50%, also ZERO gap. With hours of work held constant, participation has strictly no relationship with success. The overall association, though perfectly real, is found in NEITHER of the two subgroups.

c)

Participants: 150+50=200150+50=200, of whom 120+25=145120+25=145 passed, that is 72.5%. Non-participants: 50+150=20050+150=200, of whom 40+75=11540+75=115 passed, that is 57.5%. The total is indeed 400 students and 260 who passed. This check is indispensable: it establishes that the reversal is not a calculation error but a property of the data.

d)

The mechanism is that of a common ANTECEDENT variable. Hours of paid work determine both participation, since nobody joins the debating club while working 25 hours a week, and success, which drops from 80% to 50% among heavy workers. Participants are therefore massively recruited among those who work little, 150 out of 200, and non-participants among those who work a lot, 150 out of 200. The overall comparison actually compares two populations with very different availability, and the gap of 15 points measures that difference in composition, not an effect of extracurricular activities.

e)

Three possible outcomes. REPLICATION: the association remains identical in each stratum, the third variable changes nothing, and the initial relationship is strengthened. EXPLANATION, or spurious relationship: the association disappears in all the strata because the third variable is ANTECEDENT to the other two. SPECIFICATION, or interaction: the association remains in some strata and not in others, which specifies the conditions of the relationship. The present case is an EXPLANATION: hours of work logically and chronologically precede participation as well as success, and the overall association was spurious. If the third variable came after the first, we would speak of interpretation, and the variable would be intervening rather than confounding.

72.5%57.5%overallgap: 15 points80%80%light workgap: 0 points50%50%heavy workgap: 0 pointsparticipatesdoes not participate

Exercise 8: Five statements to correct

Each of the following five statements is FALSE. Say why and give the correct statement.

  • 1) “The chi-square is 42.7, so the association is very strong.”
  • 2) “Among those who dropped a course, 33% worked more than 21 hours: work therefore explains a third of the dropped courses.”
  • 3) “I converted my table to percentages before computing the chi-square, it is more readable.”
  • 4) “The test is not significant, so the two variables are independent.”
  • 5) “The association disappears when I control for a third variable: my initial analysis was therefore badly done.”

Type your answers, the page tells you right or wrong 0/10

1)
2)
3)
4)
5)
Show the solution

Answers

  • 1) FALSE: on 5,0005{,}000 respondents, χ2=42.7\chi^{2}=42.7 gives V=0.09V=0.09, a negligible association
  • 2) FALSE: column reading; the right reading is 35%35\% against 15%15\% by row
  • 3) FALSE: the chi-square is computed on COUNTS, otherwise you impose n=100n=100 per row
  • 4) FALSE: the data are compatible with independence, they do not demonstrate it
  • 5) FALSE: elaboration completes the analysis; a spurious relationship is a result to publish
1)

FALSE. The value of the chi-square depends on three things: the strength of the relationship, the sample size and the dimensions of the table. A chi-square of 42.7 on 5,000 respondents corresponds to a Cramér's V of 0.09, a negligible association. Correct statement: the chi-square settles SIGNIFICANCE; strength is read on Cramér's V, which divides by nn precisely for that reason.

2)

FALSE, it is a column reading presented as an explanation. The 33% describe the COMPOSITION of the group who dropped a course, which depends mostly on the size of each profile in the sample. The right reading is by row: 35% of the heavy workers drop a course against 15% of the light workers. Correct statement: the share who drop a course is more than twice as high among those who work 21 hours or more, and nothing in this table attributes a share of the dropped courses to a cause.

3)

FALSE, and the error is serious. The chi-square is computed on COUNTS. Converting to percentages amounts to imposing n=100n=100 in each row, which manufactures a fictitious sample size and makes the p-value entirely wrong, in one direction or the other depending on the true size. Correct statement: percentages are presented to the reader, and the test is computed on the raw counts.

4)

FALSE. Failing to reject the null hypothesis means that the data are COMPATIBLE with independence, not that they demonstrate it. With a small sample, an important association may well fail to reach the threshold: that is a lack of power, not proof of absence. Correct statement: at the 5% level, the data do not allow us to conclude that there is an association; to go further, we would need a larger sample or a confidence interval on the difference.

5)

FALSE, or rather backwards. Elaboration does not invalidate the initial analysis, it COMPLETES it: the overall relationship did exist in the data, and the control reveals that it ran through a third variable. Correct statement: the observed association was spurious, that is, attributable to a common antecedent variable; this is a RESULT of the analysis, often the most interesting one, and it must be published as such rather than hidden.

Exercise 9: Problem: the complete survey, from the table to the conclusion

A student success office wants to know whether having a place to study at home is associated with success. Survey of 250 students, the whole chapter in one question.

Place to study at homePasses every courseFails at least one courseTotal
Yes, a dedicated space9624120
Shared or noisy563490
None182240
Total17080250
  • a) Compute the success percentages in the right direction and describe the trend.
  • b) Compute the six expected frequencies.
  • c) Compute the chi-square and the degrees of freedom, and conclude at the 5% level.
  • d) Compute Cramér's V and interpret it.
  • e) Write the conclusion in three sentences, with its limits.

Type your answers, the page tells you right or wrong 0/17

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) 80.0%80.0\%, 62.2%62.2\% and 45.0%45.0\%: 3535 points between the extremes, monotone trend
  • b) 81.681.6 and 38.438.4; 61.261.2 and 28.828.8; 27.227.2 and 12.812.8, all above 5
  • c) χ2≈19.05\chi^{2}\approx 19.05 with 22 degrees of freedom: we reject, p-value below 0.0010.001
  • d) V=19.05250≈0.276V=\sqrt{\dfrac{19.05}{250}}\approx 0.276: MODERATE association, actionable
  • e) Direction, significance, strength, then the cross-sectional limit and the household income to control for
a)

Success rates: 96120=80.0%\dfrac{96}{120}=80.0\% with a dedicated space, 5690≈62.2%\dfrac{56}{90}\approx 62.2\% with a shared space, 1840=45.0%\dfrac{18}{40}=45.0\% with no place to study at all. The trend is monotone and strong: 35 points separate the two extremes, and the rate drops at every step. This is the correct direction of calculation, since the place to study is the independent variable here.

b)

Margins: rows 120, 90 and 40; columns 170 and 80; n=250n=250. Expected frequencies: 120×170250=81.6\dfrac{120\times 170}{250}=81.6 and 120×80250=38.4\dfrac{120\times 80}{250}=38.4; 90×170250=61.2\dfrac{90\times 170}{250}=61.2 and 90×80250=28.8\dfrac{90\times 80}{250}=28.8; 40×170250=27.2\dfrac{40\times 170}{250}=27.2 and 40×80250=12.8\dfrac{40\times 80}{250}=12.8. All exceed 5, so the condition is satisfied.

c)

Contributions: (96−81.6)281.6=207.3681.6≈2.541\dfrac{\left(96-81.6\right)^{2}}{81.6}=\dfrac{207.36}{81.6}\approx 2.541; 207.3638.4=5.400\dfrac{207.36}{38.4}=5.400; (56−61.2)261.2=27.0461.2≈0.442\dfrac{\left(56-61.2\right)^{2}}{61.2}=\dfrac{27.04}{61.2}\approx 0.442; 27.0428.8≈0.939\dfrac{27.04}{28.8}\approx 0.939; (18−27.2)227.2=84.6427.2≈3.112\dfrac{\left(18-27.2\right)^{2}}{27.2}=\dfrac{84.64}{27.2}\approx 3.112; 84.6412.8=6.613\dfrac{84.64}{12.8}=6.613. Total: χ2≈19.05\chi^{2}\approx 19.05, with df=(3−1)(2−1)=2df=\left(3-1\right)\left(2-1\right)=2. Since 19.05>5.99119.05>5.991 and even >13.816>13.816, we reject independence with a p-value below 0.001.

d)

V=19.05250×1=0.07619≈0.276V=\sqrt{\dfrac{19.05}{250\times 1}}=\sqrt{0.07619}\approx 0.276. The association is MODERATE, clearly stronger than the one observed with hours of work, which was 0.18. This is a result the office can actually use, unlike an association of 0.05 that would be significant without being actionable.

e)

“The rate of passing every course falls from 80.0% among students with a dedicated study space to 62.2% among those whose space is shared, then to 45.0% among those who have none. The association is significant, χ2=19.05\chi^{2}=19.05 with 2 degrees of freedom, p-value below 0.001, and of moderate strength, V=0.28V=0.28. Since these data are cross-sectional, they do not allow us to attribute the difference to the place to study alone: having a dedicated space is strongly linked to household income and to the size of the home, variables that would have to be controlled before guiding an intervention.” It contains the three mandatory elements, direction, significance and strength, plus the limit of the design and the control variable that should be measured.

80%dedicated62.2%shared45%noneshare passing every course, by row

Exercise 10: Problem: reading a table published in a journal

Last exercise, the one about reading. A sociology article publishes the following table, with the note: “χ2=4.12\chi^{2}=4.12; df=2df=2; p=0.127p=0.127; V=0.09V=0.09; N=510N=510. Persons who did not answer the income question are excluded, initial NN of 604.”

Household incomeVolunteersDoes not volunteerTotal
Under 40,000 dollars38132170
40,000 to 79,999 dollars52148200
80,000 dollars or more4496140
Total134376510
  • a) Check the degrees of freedom reported and compute the volunteering rates by income bracket.
  • b) The p-value is 0.127. What conclusion can the author draw, and which one can the author not draw?
  • c) Is the VV of 0.09 consistent with the reported chi-square? Check.
  • d) 94 persons were excluded for lack of an answer on income. How can this change the conclusions?
  • e) The author writes in the abstract: “volunteering does not depend on income”. Rewrite the sentence correctly.

Type your answers, the page tells you right or wrong 0/14

a)
b)
c)
d)
e)
Show the solution

Answers

  • a) df=2df=2, as reported; rates 22.4%22.4\%, 26.0%26.0\% and 31.4%31.4\%, rising by nine points
  • b) The author can say that we fail to reject; the author cannot say that there is no relationship
  • c) 4.12510≈0.0899\sqrt{\dfrac{4.12}{510}}\approx 0.0899: consistent with the reported 0.090.09
  • d) 9494 excluded, that is 15.6%15.6\%: nonresponse on income hits mostly the two extremes
  • e) Replace the claim of absence with a finding of indecision, citing the exclusion of the 15.6%
a)

df=(3−1)(2−1)=2df=\left(3-1\right)\left(2-1\right)=2: the reported value is correct. Volunteering rates: 38170≈22.4%\dfrac{38}{170}\approx 22.4\%, 52200=26.0%\dfrac{52}{200}=26.0\%, 44140≈31.4%\dfrac{44}{140}\approx 31.4\%. The trend rises with income, by nine percentage points between the extremes, which is not nothing even if the test does not conclude.

b)

The author can say that, at the usual 5% level, the data do NOT allow rejecting the hypothesis of independence: the observed gap could be produced by sampling chance about one time in eight. The author can NOT say that volunteering is independent of income: with N=510N=510 spread over three brackets, the power of the test is modest, and a real difference of nine points may perfectly well fall below the threshold. What should be published here is the confidence interval on the gap between the extreme brackets, which would show the whole range of differences compatible with these data.

c)

V=4.12510×min⁡(2,1)=4.12510=0.008078≈0.0899V=\sqrt{\dfrac{4.12}{510\times \min\left(2,1\right)}}=\sqrt{\dfrac{4.12}{510}}=\sqrt{0.008078}\approx 0.0899, rounded to 0.09. The reported figure is therefore consistent. This check takes ten seconds and it regularly catches transcription errors in published tables: it is worth doing systematically.

d)

Nonresponse to the income question is not random: it is notoriously more frequent at both ends of the distribution, among the poorest out of embarrassment and among the richest out of caution. The 94 excluded persons represent 15.6% of the initial sample, a considerable share, and removing them may have flattened the relationship by emptying precisely the extreme brackets, the ones that carried the gap. A serious analysis would compare respondents and nonrespondents on the other available variables, age, schooling, region, and say so in the text.

e)

“In this sample, the volunteering rate rises from 22.4% among households under 40,000 dollars to 31.4% among those at 80,000 dollars or more, but the gap does not reach significance at the 5% level, χ2=4.12\chi^{2}=4.12; df=2df=2; p=0.127p=0.127; V=0.09V=0.09. These data therefore do not allow us to conclude that there is a relationship, nor to rule one out, especially since 15.6% of the respondents were excluded for not reporting their income.” The difference from the author's sentence is decisive: it replaces a claim of absence with a finding of indecision, which is the only thing the test allows.

22.4%under 4026%40 to 8031.4%80 and overvolunteering by income (thousands of dollars)
Something missing from this set? A type of exercise your teacher gives, a problem you are stuck on, a mistake you spotted: tell me, I read every request.

Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space. Rather not create an account? Write to me directly.

What is it about?
I read every request myself, nobody else sees it. No need to write your name or your school.
When your request is dealt with, you hear about it by email and in your space.

By sending, you agree that I read your request to answer it. It is kept with your account, erased with it, and never published: privacy policy.

Previous chapter Index numbers, rates and constant dollars, 360-300 Next chapter The margin of error of a poll, 360-300

© Ahmed Squalli Houssaini. Exercise set published at www.letuteurscientifique.ca/en/exercices/cegep-qm-crosstabs-chi-square. Free for personal and classroom use; republishing it elsewhere requires written permission (legal notice).

See also

Looking for a quantitative methods tutor in Montreal?

Get in touch for a first session. Quantitative Methods is the only compulsory mathematics course in Social Science, and it is also the one that most often decides the R score of a semester.

Site by Studio Squalli