Anyone know if coin can run a permutation test based on a (user-defined) statistic other than the mean difference? The function independence_test does the permutation t-test via difference in means. I'm wondering if it's possible to use independence_test to run a permutation test for some other statistic than the difference in means. For example, I'd like to run a permutation test using Welch's t instead of the difference in means. The help for independence_test reveals that "teststat" is an argument which allows for specification of standardized scalar test statistic, a maximum type statistic, or a quadratic form. I cannot, however, figure out if it is possible to specify how the statistic should be calculated by, for example, supplying a function. There are other mentions of test statistic in the help file but they all seem to have to do with the names of classes or objects which can be retrieved from coin output. Bryan --------------- Bryan Keller, Doctoral Student/Project Assistant Educational Psychology - Quantitative Methods The University of Wisconsin - Madison
On Sat, 29 May 2010, Bryan Keller wrote:> Anyone know if coin can run a permutation test based on a (user-defined) > statistic other than the mean difference? The function > independence_test does the permutation t-test via difference in means....by default, that is.> I'm wondering if it's possible to use independence_test to run a > permutation test for some other statistic than the difference in means.Yes.> For example, I'd like to run a permutation test using Welch's t instead > of the difference in means.No.> The help for independence_test reveals that "teststat" is an argument > which allows for specification of standardized scalar test statistic, a > maximum type statistic, or a quadratic form. I cannot, however, figure > out if it is possible to specify how the statistic should be calculated > by, for example, supplying a function.Have you considered reading the references mentioned in the documentation. I suggest you start with vignette("LegoCondInf", package = "coin") which essentially is the "The American Statistician" paper mentioned in the help pages. The general framework is that the user can specify data transformations for which an independence test is computed. Depending on the data transformation, this can be a t test, chi-squared test, Wilcoxon test, Kruskal-Wallis test, and many many more. Furthermore, note that the null hypothesis is always permutation invariance. Hence, the Welch test does not fit into this framework because under the null it assumes same means but with potentially different variances, which is not invariant with respect to permutations. Therefore, the default t statistic in independence_test() computes a mean difference standardized by the one-sample standard deviation (with only a single mean!). This is neither the pooled two-sample standard deviation (with two means) that t.test(..., var.equal = TRUE) uses nor the two-sample standard deviation (with two means and two standard deviations) of the Welch test. hth, Z
Thanks for the reply, that answers my question.? I'm actually interested in using the Welch t in a randomization model framework where the variance heterogeneity is introduced by the treatment effect and is not present under the null hypothesis of no differential treatment effect.? In other words, the test would be valid because exchangeability is satisfied by random assignment of experimental units to treatments. Much thanks to you and your colleagues for providing and maintaining this fantastic package. Bryan On 05/30/10, Achim Zeileis? <Achim.Zeileis at uibk.ac.at> wrote:> On Sat, 29 May 2010, Bryan Keller wrote: > > >Anyone know if coin can run a permutation test based on a (user-defined) statistic other than the mean difference?? The function independence_test does the permutation t-test via difference in means. > > ...by default, that is. > > >I'm wondering if it's possible to use independence_test to run a permutation test for some other statistic than the difference in means. > > Yes. > > >For example, I'd like to run a permutation test using Welch's t instead of the difference in means. > > No. > > >The help for independence_test reveals that "teststat" is an argument which allows for specification of standardized scalar test statistic, a maximum type statistic, or a quadratic form.? I cannot, however, figure out if it is possible to specify how the statistic should be calculated by, for example, supplying a function. > > Have you considered reading the references mentioned in the documentation. > I suggest you start with > ? vignette("LegoCondInf", package = "coin") > which essentially is the "The American Statistician" paper mentioned in the help pages. > > The general framework is that the user can specify data transformations for which an independence test is computed. Depending on the data transformation, this can be a t test, chi-squared test, Wilcoxon test, Kruskal-Wallis test, and many many more. > > Furthermore, note that the null hypothesis is always permutation invariance. Hence, the Welch test does not fit into this framework because under the null it assumes same means but with potentially different variances, which is not invariant with respect to permutations. > > Therefore, the default t statistic in independence_test() computes a mean difference standardized by the one-sample standard deviation (with only a single mean!). This is neither the pooled two-sample standard deviation (with two means) that t.test(..., var.equal = TRUE) uses nor the two-sample standard deviation (with two means and two standard deviations) of the Welch test. > > hth, > Z-- --------------- Bryan Keller, Doctoral Student/Project Assistant Educational Psychology - Quantitative Methods The University of Wisconsin - Madison
Apparently Analagous Threads
- A naive question about permutation tests in the coin package
- Permutation Test on Interactions {coin}
- Help me in Cochran armitage trend test Coding
- Jonckheere-Terpstra test using coin package?
- coin package (conditional inference / permutation): parameter teststat