📖 For a 2×2 Table
Both φ and C can be computed. They give similar results but differ in scale:
φ ranges from 0 to 1
C ranges from 0 to less than 1
For the same χ² value, C < φ always.
Unit V · Lecture 37 of 40 · B.Sc. Data Science, 1st Year, Semester II
For a 2×2 contingency table, the chi-square statistic measures the total discrepancy between observed and expected frequencies:
χ² = Σ [(Observed − Expected)² / Expected]
For a 2×2 table:
χ² = N(AD − BC)² / [(A+B)(C+D)(A+C)(B+D)]
Where the table is:
A B | A+B
C D | C+D
———————
A+C B+D | N
φ = √(χ²/N)
Range: 0 ≤ φ ≤ 1
φ = 0: Complete independence (no association)
φ = 1: Perfect association
Interpretation: φ measures the strength of association in a 2×2 table. Higher φ = stronger association.
C = √(χ² / (χ² + N))
Range: 0 ≤ C < 1 (never reaches 1, even for perfect association)
C = 0: Complete independence
C → 1: Very strong association (but C < 1 always)
Advantage over φ: C can be used for tables larger than 2×2 (e.g., 3×3, 4×4).
Disadvantage: C never reaches 1, so it's harder to interpret as "perfect" association.
Both φ and C can be computed. They give similar results but differ in scale:
φ ranges from 0 to 1
C ranges from 0 to less than 1
For the same χ² value, C < φ always.
For an r×c contingency table:
χ² = Σᵢ Σⱼ (Oᵢⱼ − Eᵢⱼ)² / Eᵢⱼ
Where Oᵢⱼ = observed frequency in cell (i,j)
Eᵢⱼ = (row total × column total) / N
C = √(χ²/(χ²+N)) works for any size table.
φ is mainly used for 2×2 tables.
Given the following 2×2 table, compute χ², φ, and C.
| (B) | (β) | Total | |
|---|---|---|---|
| (A) | 100 | 100 | 200 |
| (α) | 60 | 140 | 200 |
| Total | 160 | 240 | 400 |
Using the 2×2 shortcut with A=100, B=100, C=60, D=140, N=400:
χ² = N(AD−BC)² / [(A+B)(C+D)(A+C)(B+D)]
= 400(100×140 − 100×60)² / [200×200×160×240]
= 400(14000−6000)² / [200×200×160×240]
= 400(8000)² / [1,536,000,000]
= 400×64,000,000 / 1,536,000,000
= 25,600,000,000 / 1,536,000,000 = 16.667
φ = √(χ²/N) = √(16.667/400) = √0.04167 = 0.2041
C = √(χ²/(χ²+N)) = √(16.667/416.667) = √0.04 = 0.2000
χ² = 16.667 | φ = 0.204 | C = 0.200
There is a weak-to-moderate positive association between A and B. The attributes are NOT independent (χ² > 0).
Enter the four cell frequencies of a 2×2 table:
| Measure | Formula | Range | Best For | Limitation |
|---|---|---|---|---|
| χ² | Σ(O−E)²/E | 0 to ∞ | Testing independence | Depends on N; not a "strength" measure |
| φ | √(χ²/N) | 0 to 1 | 2×2 tables | Only for 2×2 tables |
| C | √(χ²/(χ²+N)) | 0 to <1 | Any r×c table | Never reaches 1 |
| Yule's Q | (AD−BC)/(AD+BC) | −1 to +1 | 2×2 tables | Lecture 38 |
| Yule's Y | (√AD−√BC)/(√AD+√BC) | −1 to +1 | 2×2 tables | Lecture 39 |
Q1: The φ coefficient ranges from:
Q2: Pearson's C can be used for:
Q3: If χ² = 0, then:
Q4: C never reaches 1 because:
Q5: For the same data, which is always true?
1. For the table: (AB)=80, (Aβ)=120, (αB)=40, (αβ)=160, N=400. Compute χ², φ, and C.
2. For the table: (AB)=50, (Aβ)=50, (αB)=50, (αβ)=50, N=200. Compute χ², φ, and C. What do you observe?
3. Explain why χ² alone is not a good measure of the strength of association.
4. For a 3×3 table with N=300 and χ²=25, compute C.
5. Show that when attributes are independent, φ = 0 and C = 0.
Yule's Coefficient of Association Q — The most popular measure for 2×2 tables