What's the formula to get the x² in this chi-square table?

420 Views Asked by At

I'm just wondering what's the formula to get the $x^2$ answers in this table:

$$\begin{align} \text{expected value}&=\frac{(\text{Total of the 1st Row})(\text{Total of the 2nd Column})}{\text{Overall Total}}\\ &=\frac{(90)(64)}{250}=23.04 \end{align}$$

Continue the computation until all the variables have expected values, compare them against the expected values below in the table, arrange for the computation of $x^2$.

$$\begin{array}{c|c|c|c|c} \text{observed}&\text{expected}&\text{observed}-\text{expected}&(\text{observed}-\text{expected})^2&x^2\\\hline 31&30.96&0.04&0&0\\ 2&20.64&-18.64&347.45&16.83\\ 53&34.4&18.6&345.96&10.06\\ 14&23.04&-10.36&107.33&6.99\\ 45&25.6&19.4&376.36&14.7\\ 45&36&9&81&2.25\\ 53&24&29&841&35.04\\ 2&40&-38&1444&36.1\\\hline &&&&125.52 \end{array}\\ x^2=125.52$$

The degree of freedom is calculated as $(\text{row}-1)(\text{column}-1)$, we have three number of rows and three number of columns hence $$\text{degree of freedom}=(\text{row}-1)(\text{column}-1)=(3-1)(3-1)=4$$

Refer to the table of the critical value for the chi square, the critical value in the table for $db=4$ and a significance of $0.05$ is $9.49$.

2

There are 2 best solutions below

0
On

I get it now. Just divide the $(\text{observed}-\text{expected})^2$ value by the expected value. Example: $$\frac{347.45}{20.64} = 16.83$$

0
On

Right, those values in the column $\chi^2$ are called "contributions to" or "components of" the overall chi-squared statistic 125.52.

I verified your table as follows:

 > obs = c(31,2,53,14,5,45,45,53,2)
 > exp = c(30.96,20.64,34.4,23.04,15.36,25.6,36,24,40)
 > dif = obs-exp
 > d.sq = dif^2
 > cont = dif^2/exp
 > comp = round(cont,4)
 > cbind(obs, exp, dif, dif.sq, comp)
       obs   exp    dif    dif.sq    comp
  [1,]  31 30.96   0.04    0.0016  0.0001
  [2,]   2 20.64 -18.64  347.4496 16.8338
  [3,]  53 34.40  18.60  345.9600 10.0570
  [4,]  14 23.04  -9.04   81.7216  3.5469
  [5,]   5 15.36 -10.36  107.3296  6.9876
  [6,]  45 25.60  19.40  376.3600 14.7016
  [7,]  45 36.00   9.00  961.0000  2.2500
  [8,]  53 24.00  29.00  441.0000 35.0417
  [9,]   2 40.00 -38.00 1444.0000 36.1000
 > sum(cont)
 [1] 125.5186
 > 1 - pchisq(125.52, 4)
 [1] 0

Some comments on interpretation. The area under the density curve of $Chisq(df = 4)$ to the right of the observed value 125.52 is essentially 0. So you certainly reject the null hypothesis at the 5% level (but also the 0.1% level, etc.) On average, if the null hypothesis were true, you would observe a chi-squared statistic around 4. And as you have seen, any value above 9.5 or 10 can be considered as evidence against the null hypothesis.

The four cells of your $3 \times 3$ contingency table with the largest contributions to the highly significan statistic are the ones with observed values 2, 53, 53, and 2. The cells with observed counts of 2 had far fewer than the expected number of 'hits'. If you want to know the 'explanation' for rejecting the null hypothesis, perhaps look at those cells of your original table.