Unit V Β· Lecture 40 of 40 Β· B.Sc. Data Science, 1st Year, Semester II Β· Final Lecture!
(A) = (AB) + (AΞ²) | (B) = (AB) + (Ξ±B) | N = (A) + (Ξ±) = (B) + (Ξ²)
max(0, (A)+(B)βN) β€ (AB) β€ min((A), (B)) | All cross-class frequencies β₯ 0
Independent: (AB) = (A)(B)/N | Positive: (AB) > (A)(B)/N | Negative: (AB) < (A)(B)/N
ΟΒ² = N(adβbc)Β² / [(a+b)(c+d)(a+c)(b+d)] | Ο = β(ΟΒ²/N) | C = β(ΟΒ²/(ΟΒ²+N))
Q = (ad β bc) / (ad + bc) | Range: β1 to +1 | Q = 0 iff ad = bc (independence)
Y = (βad β βbc) / (βad + βbc) | |Y| β€ |Q| always | Q = 2Y/(1+YΒ²)
B Ξ² Total
A a b (A)
Ξ± c d (Ξ±)
Total (B) (Ξ²) N
(a) Build the table:
(V) = 250, (O) = 200, (VO) = 130, N = 400
(VΟ) = 250 β 130 = 120
(Ξ½O) = 200 β 130 = 70
(Ξ½Ο) = 400 β 250 β 200 + 130 = 80 [= 150 β 70 = 80 β]
| O | Ο | Total | |
|---|---|---|---|
| V | 130 | 120 | 250 |
| Ξ½ | 70 | 80 | 150 |
| Total | 200 | 200 | 400 |
(b) Consistency check:
Lower bound: max(0, 250+200β400) = max(0, 50) = 50
Upper bound: min(250, 200) = 200
(VO) = 130. Is 50 β€ 130 β€ 200? Yes β
All cross-class frequencies (130, 120, 70, 80) β₯ 0. Data is CONSISTENT β
Lower bound: max(0, 200+180β300) = max(0, 80) = 80
Upper bound: min(200, 180) = 180
(AB) = 30. Is 80 β€ 30? NO β
Data is INCONSISTENT.
Verification: (Ξ±Ξ²) = 300 β 200 β 180 + 30 = β50 (negative β impossible!)
Minimum (AB) must be 80 for consistency.
At (AB) = 80: (Ξ±Ξ²) = 300 β 200 β 180 + 80 = 0 (just barely consistent).
(a) Expected frequency under independence:
(A) = 80+40 = 120, (B) = 80+60 = 140
E(AB) = (A)(B)/N = 120Γ140/300 = 56
Observed (AB) = 80
Since 80 β 56, the attributes are NOT independent.
(b) Type of association:
(AB) = 80 > 56 = E(AB) β Positive association
The attributes A and B occur together more often than expected by chance.
a=150, b=100, c=50, d=200
Q = (ad β bc) / (ad + bc)
= (150Γ200 β 100Γ50) / (150Γ200 + 100Γ50)
= (30000 β 5000) / (30000 + 5000)
= 25000 / 35000
= 0.7143
Interpretation: Q = 0.714 indicates a strong positive association between treatment and recovery. Patients who received treatment were much more likely to recover than those who did not.
Verification β Independence check:
E(AB) = 250Γ200/500 = 100. Observed = 150 > 100. Confirms positive association β
βad = β(150Γ200) = β30000 = 173.21
βbc = β(100Γ50) = β5000 = 70.71
Y = (βad β βbc) / (βad + βbc)
= (173.21 β 70.71) / (173.21 + 70.71)
= 102.50 / 243.92
= 0.4202
| Measure | Value | Strength |
|---|---|---|
| Q | 0.714 | Strong positive |
| Y | 0.420 | Moderate positive |
|Y| = 0.420 β€ |Q| = 0.714 β (The inequality always holds.)
Q and Y agree on direction (positive) but differ on strength. Q is more sensitive to the large diagonal products.
ΟΒ² = N(adβbc)Β² / [(a+b)(c+d)(a+c)(b+d)]
= 500(30000β5000)Β² / [250Γ250Γ200Γ300]
= 500(25000)Β² / [250Γ250Γ200Γ300]
= 500 Γ 625,000,000 / 3,750,000,000
= 312,500,000,000 / 3,750,000,000
= 83.33
Ο = β(ΟΒ²/N) = β(83.33/500) = β0.1667 = 0.4082
C = β(ΟΒ²/(ΟΒ²+N)) = β(83.33/583.33) = β0.1429 = 0.3780
| Measure | Value | Interpretation |
|---|---|---|
| ΟΒ² | 83.33 | Large discrepancy from independence |
| Ο | 0.408 | Moderate association |
| C | 0.378 | Moderate association (C < Ο β) |
| Q | 0.714 | Strong positive association |
| Y | 0.420 | Moderate positive association |
Key observation: Different measures give different "strength" labels for the same data. This is normal β each measure captures association differently. Always state which measure you're using.
Let (AB) = x. Then:
a = x, b = 200βx, c = 180βx, d = 400β200β180+x = 20+x
Q = (ad β bc) / (ad + bc) = 0.5
ad = x(20+x) = 20x + xΒ²
bc = (200βx)(180βx) = 36000 β 380x + xΒ²
ad β bc = 20x + xΒ² β 36000 + 380x β xΒ² = 400x β 36000
ad + bc = 20x + xΒ² + 36000 β 380x + xΒ² = 2xΒ² β 360x + 36000
(400x β 36000) / (2xΒ² β 360x + 36000) = 0.5
400x β 36000 = 0.5(2xΒ² β 360x + 36000)
400x β 36000 = xΒ² β 180x + 18000
xΒ² β 580x + 54000 = 0
Using quadratic formula:
x = [580 Β± β(336400 β 216000)] / 2
= [580 Β± β120400] / 2
= [580 Β± 347.0] / 2
x = (580+347)/2 = 463.5 β too large (exceeds min(A,B)=180)
x = (580β347)/2 = 116.5 β valid (within consistency range)
(AB) β 117 (rounding to nearest integer)
Verification: Consistency range: max(0, 200+180β400)=0 to min(200,180)=180. 117 is in range β
(a) Pairwise consistency:
AβB: max(0, 400+500β1000)=0 to min(400,500)=400. (AB)=200 β [0,400] β
AβC: max(0, 400+300β1000)=0 to min(400,300)=300. (AC)=150 β [0,300] β
BβC: max(0, 500+300β1000)=0 to min(500,300)=300. (BC)=180 β [0,300] β
All pairwise checks pass β pairwise consistent β
(b) Mutual independence test:
If mutually independent:
E(AB) = 400Γ500/1000 = 200. Observed = 200. AβB: independent β
E(AC) = 400Γ300/1000 = 120. Observed = 150. AβC: NOT independent β (positive)
E(BC) = 500Γ300/1000 = 150. Observed = 180. BβC: NOT independent β (positive)
E(ABC) = (A)(B)(C)/NΒ² = 400Γ500Γ300/1000000 = 60
Observed (ABC) = 80 β 60. Triple: NOT independent β
Conclusion: A and B are pairwise independent, but AβC and BβC are positively associated. The three attributes are NOT mutually independent.
1. Confusing (A) with A β (A) is a frequency (number), A is the attribute itself.
2. Writing (AB) when you mean (AΞ²) β read the notation carefully!
3. Forgetting that (Ξ±) = N β (A), not (N) β (A) β there is no (N) class.
4. Mixing up rows and columns in the 2Γ2 table β always use the standard layout.
1. In Q = (adβbc)/(ad+bc), forgetting that a,b,c,d are the four cells, not the marginals.
2. In Y, computing β(ad) β β(bc) vs β(a)Β·β(d) β β(b)Β·β(c) β they are the same! (βaΒ·βd = β(ad)).
3. Forgetting that |Y| β€ |Q| β use this to verify your answers.
4. In ΟΒ², using the wrong formula for 2Γ2 tables β memorise the shortcut N(adβbc)Β²/[...].
1. Thinking Q = 0 means the attributes are mutually exclusive (it means independent).
2. Thinking Q = 1 means all individuals have both attributes (it means perfect association).
3. Confusing consistency with independence β they are different concepts!
4. Not interpreting the result β always state direction and strength.
Write the 2Γ2 table with a,b,c,d labels before computing anything. This prevents notation confusion.
Check: a+b+c+d=N. All cells β₯ 0. |Q|β€1. |Y|β€|Q|. These catches prevent most arithmetic errors.
Don't just give Q = 0.71. Say: "Strong positive association between A and B." Interpretation earns marks.
Unit V problems are shorter than Unit IV (no large computation tables). Use saved time for checking.
1. Given partial information, construct the complete 2Γ2 table. (Very common)
2. Check consistency of given frequency data. (Common)
3. Test whether two attributes are independent. If not, state the type of association. (Very common)
4. Compute Yule's Q and interpret. (Almost every exam)
5. Compute Yule's Y and compare with Q. (Common)
6. Compute ΟΒ², Ο, and/or C. (Occasional)
7. Given Q and partial data, find a missing frequency. (Occasional, harder)
8. State properties of Q or Y (range, special cases). (Theory question)
Q1: (A) represents:
Q2: (A) = (AB) + (AΞ²) is:
Q3: N=200, (A)=120, (B)=140. Minimum (AB) for consistency:
Q4: If (AB) = (A)(B)/N, the attributes are:
Q5: For a=40, b=60, c=30, d=70, Q = ?
Q6: Q = +1 occurs when:
Q7: Yule's Y uses:
Q8: The relationship between Q and Y is:
Q9: Pearson's C can be used for:
Q10: If (Ξ±Ξ²) = β15, the data is:
Q11: For the same 2Γ2 data, which is always true?
Q12: Three attributes A, B, C are mutually independent if:
Descriptive Statistics
Measures of Central Tendency & Dispersion
Lectures 1β8
Probability
Axioms, Conditional, Bayes' Theorem
Lectures 9β16
Random Variables & Distributions
Binomial, Poisson, Normal
Lectures 17β23
Correlation & Regression
Pearson, Spearman, Regression Lines
Lectures 24β33
Theory of Attributes
Independence, Q, Y, Contingency
Lectures 34β40
You have completed all 40 lectures of BDS113.
Statistics is not just a subject β it is a way of thinking about the world with data. The tools you've learned here β from computing a mean to fitting a regression line to testing independence β form the foundation for data science, machine learning, and evidence-based decision making. Keep practising, stay curious, and let the data guide you.
Best of luck with your exams and your data science journey!
BDS113 Introduction to Statistics Β· B.Sc. Data Science, Semester II Β· All 40 Lectures Complete