EXAMPLE 4 The cocaine study
Here are the observed and expected counts for the cocaine study side by side:
578
We can now find the chi-square statistic, adding six terms for the six cells in the two-way table: