Module 9 · Quantitative Methods

Parametric and Non-parametric Tests of Independence

EN: Test for correlation and independence between variables: Pearson, Spearman, and chi-square tests.
VN: Kiểm định tương quan và độc lập: Pearson, Spearman, chi-square.

In this module
  1. Test of Pearson Correlation (parametric)
  2. Spearman Rank Correlation (non-parametric)
  3. Chi-square Test of Independence

1. Test of Pearson Correlation Core

About: Test whether linear correlation differs from zero. Assumes joint normality. Most common test for 'is there a relationship?' — but only catches LINEAR relationships.Tóm tắt: Kiểm định ρ ≠ 0. Giả định phân phối chuẩn đa biến. Test phổ biến nhất nhưng chỉ phát hiện quan hệ tuyến tính.

EN: Tests H₀: ρ = 0 (no linear relationship) for jointly normal data.
VN: Kiểm định H₀: ρ = 0 với dữ liệu phân phối chuẩn đa biến.

\[ t = \frac{r\,\sqrt{n - 2}}{\sqrt{1 - r^{2}}}, \quad df = n - 2 \]

Components / Thành phần

  • \(r\) Sample Pearson correlation.
  • \(n\) Sample size.
Practice problem

A sample of n = 30 has correlation r = 0.40. Test H₀: ρ = 0 at α = 5%.

Show solution
\(t = 0.40\sqrt{28}/\sqrt{1 - 0.16} = 0.40(5.29)/0.917 = 2.117/0.917\)
t ≈ 2.31, df = 28, critical t (α/2) ≈ ±2.048
|2.31| > 2.048 → Reject H₀. Correlation is statistically significant.

2. Spearman Rank Correlation Core

About: Non-parametric — uses ranks instead of raw values. Robust to outliers and detects MONOTONIC (not just linear) relationships. Use when normality is doubtful.Tóm tắt: Phi tham số — dùng thứ hạng thay vì giá trị. Bền với outlier, phát hiện quan hệ đơn điệu (không chỉ tuyến tính).

EN: Non-parametric — based on ranks rather than raw values; robust to outliers and non-normality.
VN: Phi tham số — dựa trên thứ hạng, không nhạy cảm với outlier.

\[ r_s = 1 - \frac{6\sum_{i=1}^{n} d_i^{2}}{n\,(n^{2} - 1)} \]

Components / Thành phần

  • \(d_i\) Difference in ranks of observation i for variables X and Y.
  • \(n\) Sample size.

For \(n > 30\), test using same t-formula as Pearson with \(r_s\) replacing \(r\).

Practice problem

n = 8, sum of squared rank differences = 12. Compute Spearman correlation.

Show solution
\(r_s = 1 - 6(12)/[8(64-1)] = 1 - 72/504\)
≈ 0.857

3. Chi-square Test of Independence Core

About: χ² test on a contingency table to check whether two categorical variables are independent. Compares observed counts to counts expected under independence.Tóm tắt: Test chi-square trên bảng tần số kiểm tra hai biến phân loại có độc lập không. So observed vs expected.

EN: Test whether two categorical variables are independent — uses an r × c contingency table.
VN: Kiểm định độc lập 2 biến phân loại bằng bảng tần số.

\[ \chi^{2} = \sum_{i=1}^{r}\sum_{j=1}^{c}\frac{(O_{ij} - E_{ij})^{2}}{E_{ij}}, \quad df = (r - 1)(c - 1) \] \[ E_{ij} = \frac{(\text{row}_i\,\text{total})(\text{col}_j\,\text{total})}{n} \]

Components / Thành phần

  • \(O_{ij}\) Observed frequency in cell (i, j).
  • \(E_{ij}\) Expected frequency under independence.
  • r, c Number of rows and columns.
Practice problem

2×2 table: row totals 60 and 40, column totals 50 and 50, n = 100. Expected count for cell (1,1)?

Show solution
E11 = (row1)(col1)/n = 60×50/100
E11 = 30; df = (2−1)(2−1) = 1