A good site, but that is not what im looking for. Here is a sample i've provided
Computing the Chi Square Test of Independence (1 of 5)
The first step in computing the chi square test of independence is to
compute the expected frequency for each cell under the assumption that
the null hypothesis is true. To calculate the expected frequency of
the first cell in the example (experimental condition, graduated),
first calculate the proportion of subjects that graduated without
considering the condition they were in. The table shows that of the
167 subjects in the experiment, 116 graduated. Therefore, 116/167
graduated. If the null hypothesis were true, the expected frequency
for the first cell would equal the product of the number of people in
the experimental condition (85) and the proportion of people
graduating (116/167). This is equal to (85)(116)/167 = 59.042.
Therefore, the expected frequency for this cell is 59.042. The general
formula for expected cell frequencies is:
where Eij is the expected frequency for the cell in the ith row and
the jth column, Ti is the total number of subjects in the ith row, Tj
is the total number of subjects in the jth column, and N is the total
number of subjects in the whole table.
The formulas are shown below.
Once the expected cell frequencies are computed, it is convenient to
enter them into the original table as shown below. The expected
frequencies are in parentheses.
The formula for chi square test for independence is
For this example,
= 22.01.
The degrees of freedom are equal to (R-1)(C-1) where R is the number
of rows and C is the number of columns. In this example, R = 2 and C =
2, so df = (2-1)(2-1) = 1. A chi square table can be used to determine
that for df = 1, a chi square of 22.01 has a probability value less
than .0001.
In a table with two rows and two columns, the chi square test of
independence is equivalent to a test of the difference between two
sample proportions. In this example, the question is whether the
proportion graduating from high school differs as a function of
condition. Whenever the degrees of freedom equal one (as they do when
R = 2 and C = 2), chi square is equal to z2. Note that the test of the
difference between proportions for these data results in a z of 4.69
which, when squared, equals 22.01.
Conclude:
The proportion of students from the early-intervention group who
graduated from high school was .86 whereas the proportion from the
control group who graduated was only .52. The difference in
proportions is significant, (1, N = 167) = 22.01, p < .001.
Sample 2:
The same procedures are used for analyses with more than two rows
and/or more than two columns. For example, consider the following
hypothetical experiment: A drug that decreases anxiety is given to one
group of subjects before they attempted to play a game of chess
against a computer. The control group was given a placebo. The
contingency table is shown below.
The expected frequencies are shown in parentheses. As in the previous
example, each expected frequency is computed by multiplying the row
total by the column total and dividing by the total number of
subjects. For example, the expected frequency for the "Drug-Lose"
condition is the product of the row total (40) and the column total
(25) divided by the total number of subjects (70): (40)(25)/70 =
14.29.
The chi square is calculated using the formula:
The df are (R-1)(C-1) = (2-1)(3-1) = 2. A chi square table shows that
the probability of a chi square of 3.52 with 2 degrees of freedom is
.172. Therefore, the effect of the drug is not significant.
Conclude:
The number of subjects winning,losing,and drawing as a function of
drug condition is shown in Figure 1. Although subjects receiving the
drug performed slightly worse than subjects not receiving the drug,
the difference was not significant, (2, N = 70) = 3.52, p = 0.17.
Summary of Computations
1. Create a table of cell frequencies.
2. Compute row and column totals.
3. Compute expected cell frequencies using the formula: where Eij is
the expected frequency for the cell in the ith row and the jth column,
Ti is the total number of subjects in the ith row, Tj is the total
number of subjects in the jth column, and N is the total number of
subjects in the whole table.
4. Compute Chi Square using the formula:
5. Compute the degrees of freedom using the formula: df = (R-1)(C-1)
where R is the number of rows and C is the number of columns.
6. Use a chi square table to look up the probability value.
Note that the correction for continuity is not used in the chi square
test of independence.
Critical values for the Chi Square Distribution
Significance Level
df 0.10 0.05 0.025 0.01 0.005
1 2.7055 3.8415 5.0239 6.6349 7.8794
2 4.6052 5.9915 7.3778 9.2104 10.5965
3 6.2514 7.8147 9.3484 11.3449 12.8381
4 7.7794 9.4877 11.1433 13.2767 14.8602
5 9.2363 11.0705 12.8325 15.0863 16.7496
6 10.6446 12.5916 14.4494 16.8119 18.5475
7 12.017 14.0671 16.0128 18.4753 20.2777
8 13.3616 15.5073 17.5345 20.0902 21.9549
9 14.6837 16.919 19.0228 21.666 23.5893
10 15.9872 18.307 20.4832 23.2093 25.1881
11 17.275 19.6752 21.92 24.725 26.7569
12 18.5493 21.0261 23.3367 26.217 28.2997
13 19.8119 22.362 24.7356 27.6882 29.8193
14 21.0641 23.6848 26.1189 29.1412 31.3194
15 22.3071 24.9958 27.4884 30.578 32.8015
16 23.5418 26.2962 28.8453 31.9999 34.2671
17 24.769 27.5871 30.191 33.4087 35.7184
18 25.9894 28.8693 31.5264 34.8052 37.1564
19 27.2036 30.1435 32.8523 36.1908 38.5821
20 28.412 31.4104 34.1696 37.5663 39.9969
21 29.6151 32.6706 35.4789 38.9322 41.4009
22 30.8133 33.9245 36.7807 40.2894 42.7957
23 32.0069 35.1725 38.0756 41.6383 44.1814
24 33.1962 36.415 39.3641 42.9798 45.5584
25 34.3816 37.6525 40.6465 44.314 46.928
26 35.5632 38.8851 41.9231 45.6416 48.2898
27 36.7412 40.1133 43.1945 46.9628 49.645
28 37.9159 41.3372 44.4608 48.2782 50.9936
29 39.0875 42.5569 45.7223 49.5878 52.3355
30 40.256 43.773 46.9792 50.8922 53.6719
31 41.4217 44.9853 48.2319 52.1914 55.0025
32 42.5847 46.1942 49.4804 53.4857 56.328
33 43.7452 47.3999 50.7251 54.7754 57.6483
34 44.9032 48.6024 51.966 56.0609 58.9637
35 46.0588 49.8018 53.2033 57.342 60.2746
36 47.2122 50.9985 54.4373 58.6192 61.5811
37 48.3634 52.1923 55.668 59.8926 62.8832
38 49.5126 53.3835 56.8955 61.162 64.1812
39 50.6598 54.5722 58.1201 62.4281 65.4753
40 51.805 55.7585 59.3417 63.6908 66.766
41 52.9485 56.9424 60.5606 64.95 68.0526
42 54.0902 58.124 61.7767 66.2063 69.336
43 55.2302 59.3035 62.9903 67.4593 70.6157
44 56.3685 60.4809 64.2014 68.7096 71.8923
45 57.5053 61.6562 65.4101 69.9569 73.166
46 58.6405 62.8296 66.6165 71.2015 74.4367
47 59.7743 64.0011 67.8206 72.4432 75.7039
48 60.9066 65.1708 69.0226 73.6826 76.9689
49 62.0375 66.3387 70.2224 74.9194 78.2306
50 63.1671 67.5048 71.4202 76.1538 79.4898
51 64.2954 68.6693 72.616 77.386 80.7465
52 65.4224 69.8322 73.8099 78.6156 82.0006
53 66.5482 70.9934 75.0019 79.8434 83.2525
54 67.6728 72.1532 76.1921 81.0688 84.5018
55 68.7962 73.3115 77.3804 82.292 85.7491
56 69.9185 74.4683 78.5671 83.5136 86.994
57 71.0397 75.6237 79.7522 84.7327 88.2366
58 72.1598 76.7778 80.9356 85.9501 89.477
59 73.2789 77.9305 82.1174 87.1658 90.7153
60 74.397 79.082 83.2977 88.3794 91.9518
61 75.5141 80.2321 84.4764 89.5912 93.1862
62 76.6302 81.381 85.6537 90.8015 94.4185
63 77.7454 82.5287 86.8296 92.0099 95.6492
64 78.8597 83.6752 88.004 93.2167 96.8779
65 79.973 84.8206 89.1772 94.422 98.1049
66 81.0855 85.9649 90.3488 95.6256 99.3303
67 82.1971 87.108 91.5193 96.8277 100.5538
68 83.3079 88.2502 92.6885 98.0283 101.7757
69 84.4179 89.3912 93.8565 99.2274 102.9961
70 85.527 90.5313 95.0231 100.4251 104.2148
71 86.6354 91.6703 96.1887 101.6214 105.4323
72 87.7431 92.8083 97.353 102.8163 106.6473
73 88.8499 93.9453 98.5162 104.0098 107.8619
74 89.9561 95.0815 99.6784 105.2019 109.0742
75 91.0615 96.2167 100.8393 106.3929 110.2854
76 92.1662 97.351 101.9992 107.5824 111.4954
77 93.2702 98.4844 103.1581 108.7709 112.7037
78 94.3735 99.617 104.3159 109.9582 113.9107
79 95.4762 100.7486 105.4727 111.144 115.1163
80 96.5782 101.8795 106.6285 112.3288 116.3209
81 97.6796 103.0095 107.7834 113.5123 117.524
82 98.7803 104.1387 108.9373 114.6948 118.7261
83 99.8805 105.2672 110.0902 115.8762 119.927
84 100.98 106.3949 111.2422 117.0566 121.1262
85 102.0789 107.5217 112.3933 118.2356 122.3244
86 103.1773 108.6479 113.5436 119.4137 123.5218
87 104.275 109.7733 114.6929 120.5909 124.7176
88 105.3723 110.898 115.8415 121.7672 125.9123
89 106.4689 112.022 116.989 122.9422 127.106
90 107.565 113.1452 118.1359 124.1162 128.2987
91 108.6606 114.2679 119.282 125.2893 129.4902
92 109.7556 115.3898 120.427 126.4616 130.6812
93 110.8501 116.511 121.5714 127.633 131.8705
94 111.9442 117.6317 122.7152 128.8032 133.0589
95 113.0377 118.7516 123.858 129.9725 134.2466
96 114.1307 119.8709 125.0001 131.1411 135.4327
97 115.2232 120.9897 126.1414 132.3089 136.6188
98 116.3153 122.1077 127.2821 133.4756 137.803
99 117.4069 123.2252 128.4219 134.6415 138.9869
100 118.498 124.3421 129.5613 135.8069 140.1697 |