Chi-square Χ2 Test for Independence of 2 categorical variables

Does the observed distribution fit the theoretical/expected distribution derivable from independence?
Does the value of one variable affect the probability of the other variable?

H0: the 2 categorical variables are independent
HA: the 2 categorical variables are dependent. (So, actually testing for dependence.)

Select a desired level of confidence (significance level, α) for the result of the test:
0.90 0.95 0.975 0.99 0.999

Type or paste your Observed joint distribution matrix/contingency table (data only, no names, no totals):

#rows: #columns:

Calculations:

E (expected frequency P(A∩B), if independent, is P(A)*P(B)) of cell at row i, column j = (∑row i * ∑column j) / ∑∑cell.
Eij= (rowi total)(columnj total) / (grand total)    Each should be ≥5.

Expected joint distribution:

df =(rows-1)(cols-1):


Χ2 statistic=    critical value=
If the Χ2 test statistic > critical value, then null hypothesis (H0 that the two variables are independent) can be rejected, and the alternative hypothesis (HA that the variables are dependent, linked somehow) is supported.
If Χ2 test statistic < critical value, then, informally, the variables are independent, not linked.

p_value: If >α, fail to reject H0, i.e. the variables are independent (more precisely, not enough evidence to conclude that they are dependent).

More about Χ2


       unvax vaxed
autism   25     64
no aut  362   1427

        M     F
smoke   14    11
no smok 17    19


color of helmet  B W Y
injured/not
 231 112  8
 491 377 31

dog right/wrong rows, malaria/not cols
 123 131
 52   14

handedness of parent (father/mother)  rows,  handedness of offspring (left/right) cols
rt/rt
rt/lft
lft/rt
lft/lft
  5360    50928
   767     2736
   741     3667
    94      289

NFL coin flip
252 59
208 52

home games
127 53 50 57
 71 47 43 42