Alter test assumptions for t-test and Chi square

51 views
Skip to first unread message

Oliver

unread,
Apr 19, 2017, 11:10:57 AM4/19/17
to compareGroups Forum
Hi there,
again congratulations for this package!
I have noticed that per default the t-test used in the package per default not assumes equal variances (Welch) while normally one would assume equal variances (Student). 
Welch two sample t-test the r syntax would be:
t.test(x~y)
This test does not assume equal variances.
Students t-test syntax is:
t.test(x~y, var.equal=TRUE)


Another thing with the Chi square test used in the package:
The default in the package uses Yates continuity correction. The syntax is: > chisq.test(x, y).
However I would like to use Chi Square without correction. The syntax is > chisq.test(x, y, correct=FALSE)

Is there a way to specify these things in de compareGroups command?
Greetings,
Oli

compareGroups

unread,
Apr 24, 2017, 5:39:25 AM4/24/17
to compareGroups Forum
Hi Oliver,


compareGroups

unread,
Apr 24, 2017, 5:46:30 AM4/24/17
to compareGroups Forum
Hi Oliver,

The compareGroups function performs a Student T test when comparing two means using t.test default options, i.e. not assuming equal variances. Therefore, it performs the Welch modification of Student T test which is valid when variances are different and is almost as powerful than "classic" T test when poblacional variances are equal. Performing a previous test variance equality before applying a T-test can inflate type I error, specially if sample size is not large, because you finally are concatenating two tests.

Regarding the chi-squared issue, again compareGoups uses chisq.test R function with the default options. So, it applies Yates correction. 

By now, there is no argument to change these options (not applying Yates correction in chisq.test and assuming equal variances in t.test). But we will consider to incorate them as arguments in the compareGroups function in new versions of the package.


Isaac.
Reply all
Reply to author
Forward
0 new messages