# Correct use of Chi-Square?

I am trying to test whether one group is significantly different from another in two different collections of data. I have seen that people tend to use chi-squared or fisher's exact for this calculation, but am I doing it correctly? Here is the data:

                                TOTAL   NUMBER   PROPORTION

Group 1:       WGD + SSD         19590     14184  72%
WGD               19590     7045   36%
SSD               19590     7139   36%
Singleton         19590     5406   28%

Group 2:       WGD + SSD         110       102    93%
WGD               110       75     68%
SSD               110       27     25%
Singleton         110       8      7%


If I want to, for example, check whether the number of WGD + SSD is significantly different in group 2 verses group 1, would I set up my contingency table like so?

19590    110
14184    102


This returns a P value of 0.0839 using a two tailed Chi-square with Yates' correction, but the proportions are 93% versus 72%. Have I done something wrong here, or are the numbers in the second group too low compared to the first?

Thanks in advance!

## 1 Answer

I see your problem. You have put the row totals (the margin of your table) in the body of your table.

Your contingency table should look either like this:

Analyze a 2x2 contingency table
Outcome1  Outcome2       Total
Group1      102     14184        14286
Group2        8      5406         5414
Total       110     19590        19700

Chi-square with Yates correction
Chi squared equals 21.661 with 1 degrees of freedom.
The two-tailed P value is less than 0.0001


or like this (it doesn't matter which):

Analyze a 2x2 contingency table
Outcome1  Outcome2       Total
Group1      102         8         110
Group2    14184      5406       19590
Total     14286      5414       19700

Chi-square with Yates correction
Chi squared equals 21.661 with 1 degrees of freedom.
The two-tailed P value is less than 0.0001

• Thank you very much, I have no idea why I couldn't get my head around it..haven't needed to use contingency tables for a while! – user2941526 Aug 14 '14 at 11:26