'Conservative' option for the Chi Squared test

18 views
Skip to first unread message

Iurie Malai

unread,
Aug 11, 2016, 4:27:43 AM8/11/16
to Deducer
Ian,

1. I wanted to try the chi squared test with the 'Conservative' option (as described here: http://www.deducer.org/pmwiki/pmwiki.php?n=Main.ContingencyTables), but I don`t see it (the 'Conservative' check-box). I tried also to add this option to the command line, but it not worked:

add.chi.squared(tables,simulate.p.value=T,B=1000,conservative=T)

Error in add.chi.squared(tables, simulate.p.value = T, B = 1000, conservative = T) :
  unused argument (conservative = T)

2. The 'Conservative' option wiil add the Yates continuity 'correction' to the chi squared test?

I use R version 3.3.1, Deducer v. 0.7-9 with JGR v. 1.7-16 in 64-bit Ubuntu 16.04.

Regards,
Iurie

Iurie Malai

unread,
Aug 11, 2016, 4:33:23 AM8/11/16
to Deducer
chisquared.png

rudolf....@gmail.com

unread,
Aug 11, 2016, 7:11:20 AM8/11/16
to Deducer
I think this option has been removed a while ago. 
And  I don't think it is required because Yates' correction (conservative) is the default in R.
It works the other way round. If you did not want it, you could add correct=FALSE as an option.

Best regards
Rudolf

Iurie Malai

unread,
Aug 11, 2016, 9:10:58 AM8/11/16
to Deducer, rudolf....@gmail.com
Rudolf, this is the code generated by Deducer when I analyze my data:

tables<-contingency.tables(
    row
.vars=d(profil),
    col
.vars=d(sdsDomin),data=dbTest1)
tables
<-add.chi.squared(tables)
print(tables,prop.r=F,prop.c=F,prop.t=F)
remove
(tables)

and this is a warning message generated by the above code:

Warning message:
In chisq.test(x, correct = FALSE) :
  Chi-squared approximation may be incorrect

So, I think that in the Deducer`s add.chi.squared() wrapper function the Yates' correction (conservative) is NOT the default. The question is how to use this correction with the Deducer`s add.chi.squared() wrapper function.

Best regards,
Iurie

rudolf....@gmail.com

unread,
Aug 11, 2016, 9:36:19 AM8/11/16
to Deducer
You are right. Deducer is different from R default. 
I have tested a simple example.

table1=with(dataframe, table(category1, category2))

chisq.test(table1)

chisq.test(table1,correct=FALSE)

The latter corresponds to the Deducer output.

But I don't know how to change the behaviour in Deducer.

If you search the group, there is an older thread (11.08.2012) that discusses the deliberate change and removal of the conservative option in Deducer.


Best

Rudolf


On Thursday, August 11, 2016 at 6:27:43 PM UTC+10, Iurie Malai wrote:

Ian Fellows

unread,
Aug 11, 2016, 11:30:17 AM8/11/16
to ded...@googlegroups.com
From the warning message, it sounds like you have a small sample size. The chi.squared test (with or without Yates) is of questionable accuracy in that case. I would suggest using either Fisher’s exact, or chi-squared monte carlo permutation option.

Best,
Ian


--

---
You received this message because you are subscribed to the Google Groups "Deducer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deducer+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Iurie Malai

unread,
Aug 12, 2016, 6:42:47 AM8/12/16
to Deducer
Finaly, I have used the chi-squared monte carlo permutation option, as Ian suggested.

Thank you!

Best regards,
Iurie
Reply all
Reply to author
Forward
0 new messages