Pearson's Chi-Square Test of Independence

From Q
Jump to navigation Jump to search

Pearsons's Chi-Square Test of Independence tests the independence between two categorical variables, x and y which contain s and r categories respectively. The test statistic is

X2=∑k=1s∑j=1r(okj−ekj)2ekj

where:

okj=∑i=1nwiIx=k,y=j,
wi is the Calibrated Weight of the ith of n observations,
ekj=∑k=1sokj×∑j=1rokj∑i=1nwi
p≈Pr⁡(χ(s−1)(g−1)2≥X2)