I have two distributions $X$ and $Y$ with $n_Y>n_X$ that I want to test if they are different. But within each sample, I have subgroups that have an effect on the variable in question. As an example, consider the screenshot below, where I have pairs within each sample, and these pairs interact with the variables in question. So when I run the Wilcox (Mann-Whitney) test (for instance in R with wilcox.test(x, y)), how can I (or should I) take into account the between-pair variability? I could take the pair averages and then compare. Is that a good way?
1 Answer
I found the R package 'clusrank' which performs one or two-sample/s Wilcoxon tests for clustered data on vectors of data. Details on this can be found in the following papers.
Bernard Rosner, Robert J. Glynn, Mei-Ling T. Lee (2006) Extension of the Rank Sum Test for Clustered Data: Two-Group Comparisons with Group. Biometrics, 62, 1251-1259.
Somnath Datta, Glen A. Satten (2005) Rank-Sum Tests for Clustered Data. Journal of the American Statistical Association, 100, 908-915.