multtest
1
0
Entering edit mode
@stefanie-scheid-316
Last seen 10.1 years ago
Hi, after using multtest to calculate Wilcoxon test statistics for original and for permuted class labels, three questions appeared: 1. What is calculated by mt.teststat ("stat.orig")? The Wilcoxon statistic is defined as the ranksum of one of the two samples after joining. In my simple example "a1" is the ranksum which is not equal to "stat.orig". Actually, the function wilcox.test gives a third result which is the ranksum minus its theoretical minimum ("b1"=="b2"). 2. What is calculated my mt.sample.teststat ("stat.perm")? Here, the calculated Wilcoxon statistics seem to be standardized. Why is the original value not standardized ("stat.orig"!="a2")? 3. What is the difference between fixed.seed.sampling="y" and "n"? Each time I run the example the permuted values stay fixed. Is there way to calculate values with random seeds? Thanks a lot, Stefanie. index <- c(rep(0,5),rep(1,5)) value <- c(3,6.5,2,1,1.5,6,9,8,0,3.5) expr <- t(matrix(value,10,2)) # a very correlated expression matrix :-) stat.orig <- mt.teststat(expr,index,test="wilcoxon") stat.perm1 <- apply(expr, 1, mt.sample.teststat, index, test="wilcoxon", B=10, nonpara="n", fixed.seed.sampling="n") stat.perm2 <- apply(expr, 1, mt.sample.teststat, index, test="wilcoxon", B=10, nonpara="n", fixed.seed.sampling="y") a1 <- sum(rank(expr[1,])[6:10]) a2 <- (sum(rank(expr[1,])[6:10])-5*11/2)/sqrt(25*11/12) b1 <- wilcox.test(value[1:5],value[6:10])$statistic b2 <- sum(rank(expr[1,])[1:5])-5*6/2 --- Stefanie Scheid Max Planck Institute for Molecular Genetics Dept. of Computational Molecular Biology Ihnestra?e 63-73 D-14195 Berlin, Germany phone: +49 (0)30 8413 1178 fax: +49 (0)30 8413 1152 http://www.molgen.mpg.de/~scheid email: stefanie.scheid@molgen.mpg.de
multtest multtest • 1.2k views
ADD COMMENT
0
Entering edit mode
@sandrine-dudoit-16
Last seen 10.1 years ago
Hi Stefanie, Thank you for the feedback. We have updated the code and fixed the help pages to clarify the issues you raised about the computation of the Wilcoxon test statistic. The revised package is available under "Developmental Packages". Below are answers to your three questions. > 1. What is calculated by mt.teststat ("stat.orig")? > The Wilcoxon statistic is defined as the ranksum of one of the two samples > after joining. In my simple example "a1" is the ranksum which is not equal > to "stat.orig". Actually, the function wilcox.test gives a third result > which is the ranksum minus its theoretical minimum ("b1"=="b2"). The function now computes the centered and scaled version of the Wilcoxon statistic. [sum ranks for sample 1 - n1*(n1+n2+1)/2]/sqrt(n1*n2*(n1+n2+1)/12) We have also corrected the cut-and-paste error in the help file. > 2. What is calculated my mt.sample.teststat ("stat.perm")? > Here, the calculated Wilcoxon statistics seem to be standardized. Why is > the original value not standardized ("stat.orig"!="a2")? This function also computes the centered and scaled version of the Wilcoxon statistic as in mt.teststat. > 3. What is the difference between fixed.seed.sampling="y" and "n"? > Each time I run the example the permuted values stay fixed. Is there way > to calculate values with random seeds? This option is only meaningful for the minP procedure. Details are given in Remarks 2.(a) and 2.(b) in Section 4.4.3 of the tech report http://www.stat.berkeley.edu/~gyc/633.pdf. In summary, there are two different ways to force each row of the T, P, and Q matrices to contain the same order for the B permutations. If we use fixed.seed.sampling="y", then each time we go from one row to another row, we use the same random seed. If we use fixed.seed.sampling="n", we store the B permutation configurations into memory and for each row read these from memory. Best regards, Sandrine ---------------------------------------------------------------------- --------- Sandrine Dudoit, Ph.D. E-mail: sandrine@stat.berkeley.edu Assistant Professor Tel: (510) 643-1108 Division of Biostatistics Fax: (510) 643-5163 School of Public Health http://www.stat.berkeley.edu/~sandrine University of California, Berkeley 140 Earl Warren Hall, #7360 Berkeley, CA 94720-7360
ADD COMMENT

Login before adding your answer.

Traffic: 1026 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6