inconsistent result from contingency table (Analysis) and k-sample proportion test (Extras) on a 2X2 table

28 views
Skip to first unread message

eagle.e...@gmail.com

unread,
Nov 7, 2012, 10:30:52 PM11/7/12
to ded...@googlegroups.com
For some reason I get a different result from contingency table in the Analysis menu and the comparison of proportion test in the Extras menu.

Using the birthwt dataset I get, what I think is the correct result from the proportion test (see below). However, the contingency function give a smaller calculated chi-square statistics (4.236 rather than 4.9237). Just to be sure I checked the calculations in excel (see pdf and xls file attached). I get the exact same result as the proportion test.


2-sample test for equality of proportions without continuity
correction

data:  table(group = birthwt$smoke, variable = birthwt$low) 
X-squared = 4.9237, df = 1, p-value = 0.02649
alternative hypothesis: two.sided 
95 percent confidence interval:
 0.01607177 0.29039121 
sample estimates:
   prop 1    prop 2 
0.7478261 0.5945946 
birthweight.pdf
birthweight.xls

Ian Fellows

unread,
Nov 8, 2012, 2:50:49 AM11/8/12
to ded...@googlegroups.com
The analysis menu is giving the chi-squared test with yates continuity
correction.

chisq.test(table(birthwt$smoke,birthwt$low),correct=FALSE)

chisq.test(table(birthwt$smoke,birthwt$low))

I will consider making no correction the default.

ian

Vincent

unread,
Nov 8, 2012, 4:32:15 AM11/8/12
to ded...@googlegroups.com
I didn't realize a correction was applied. No correction as the default would be great. Or an option to turn it off/on in the contingency dialog.

Thanks Ian!
Reply all
Reply to author
Forward
0 new messages