[R] Permutation Distribution
Torsten.Hothorn at rzmail.uni-erlangen.de
Thu Jul 20 15:03:41 CEST 2006
On Thu, 20 Jul 2006, Jacob van Wyk wrote:
> Is there an elegant way to do the following:
> Dataset consists of 2 variables: var1: some measurements, and var2: a grouping variable with two values, 1 and 2.
> There are (say) 10 measurements from group 1 and 15 measurements from group 2.
> The idea is to study the permutation distribution of
> mean(group 1) * mean(group2).
> One way would be to permute 1s and 2s and select the corresponding
> measurements; calculate the difference in means.
what test statistic do you want to use? Product or difference of means?
The latter one is easy:
independence_test(var1 ~ var2, data = <your data>, ...)
> Redo this 1000 times, say. Etc.
> Any help is much appreciated.
> Jacob L van Wyk
> Department of Statistics
> University of Johannesburg, APK
> P O Box 524
> Auckland Park 2006
> South Africa
> Tel: +27 11 489 3080
> Fax: +27 11 489 2832
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help