Dear list, I am facing a problem in my statistical analyses on R. My experiments are about plants, I record there growth after each cutting (every 3 weeks). 'BC' is for the plant, and '1' to '5' is the time of cutting and recording. The data and R script are : "" BourdCoup <- c(21, 7.2, 9.2, 0, 8.52, 14.7, 8.31, 6.2, 127.05, 115.2, 100.7, 24, 162.64, 136.8, 95.1, 78.93, 104.7, 21.2, 35.8, 21, 66, 103.4, 74.9, 43.8, 32.1, 14.9, 2.1, 14.4, 36.1, 35, 53.2, 28.9, 0,0,0,8.7,2.7,4.2,0,21.2) groupBC <- as.factor(rep(c("BC1","BC2","BC3","BC4","BC5"), times=1, each=8)) BC1 <- BourdCoup[groupBC=="BC1"] BC2 <- BourdCoup[groupBC=="BC2"] BC3 <- BourdCoup[groupBC=="BC3"] BC4 <- BourdCoup[groupBC=="BC4"] BC5 <- BourdCoup[groupBC=="BC5"] "" I therefore realise a wilcoxon test for paired series, and compare them one by one. ""> wilcox.test(BC1,BC2, paired=T)Wilcoxon signed rank test data: BC1 and BC2 V = 0, p-value = 0.007813 alternative hypothesis: true location shift is not equal to 0 "" The problem is that it always gives me the same p-value (0.007813), whatever vectors I try. And when I remove "paired=T" from the script, all p-values differ. Could you help me please ? Juliette BELLAY ----------------------------------- Stagiaire Compagnie Nationale du Rhône Direction de l'Ingénierie, Cours d'Eau et Navigation Tél : 04 72 00 18 44 ----------------------------------- [https://www.cnr.tm.fr/imagesEcoGeste/disclaimer_small.png] ÉCO-GESTE SIMPLE : N'IMPRIMEZ CET EMAIL QU'EN CAS DE NÉCESSITÉ Ce message électronique et tous les documents attachés qu'il contient sont confidentiels et destinés exclusivement à la personne à laquelle ils sont destinés. Si vous avez reçu ce message par erreur, veuillez le détruire immédiatement; vous voudrez bien également vous abstenir de toute référence aux informations qui y figurent. Sauf mention expresse, les idées et opinions présentées dans ce message sont celles de son auteur, et n'engagent pas la CNR. La publication, l'usage, la distribution, l'impression ou la copie non autorisée de ce message et des fichiers attachés qu'il contient sont strictement interdits. La CNR a pris toute précaution pour éviter la présence de virus, mais nous ne pouvons vous garantir l'absence de virus. Vous devez donc prendre toute disposition utile pour la vérification de l'absence de virus. La CNR dégage toute responsabilité en cas de problème posé par des virus. [[alternative HTML version deleted]]
On Aug 8, 2012, at 18:16 , BELLAY Juliette wrote:> Dear list, > > I am facing a problem in my statistical analyses on R. > My experiments are about plants, I record there growth after each cutting (every 3 weeks). > 'BC' is for the plant, and '1' to '5' is the time of cutting and recording. > > The data and R script are : > > "" > BourdCoup <- c(21, 7.2, 9.2, 0, 8.52, 14.7, 8.31, 6.2, 127.05, 115.2, 100.7, 24, 162.64, 136.8, 95.1, 78.93, 104.7, 21.2, 35.8, 21, 66, 103.4, 74.9, 43.8, 32.1, 14.9, 2.1, 14.4, 36.1, 35, 53.2, 28.9, 0,0,0,8.7,2.7,4.2,0,21.2) > > groupBC <- as.factor(rep(c("BC1","BC2","BC3","BC4","BC5"), times=1, each=8)) > > BC1 <- BourdCoup[groupBC=="BC1"] > BC2 <- BourdCoup[groupBC=="BC2"] > BC3 <- BourdCoup[groupBC=="BC3"] > BC4 <- BourdCoup[groupBC=="BC4"] > BC5 <- BourdCoup[groupBC=="BC5"] > "" > > I therefore realise a wilcoxon test for paired series, and compare them one by one. > > "" >> wilcox.test(BC1,BC2, paired=T) > > Wilcoxon signed rank test > > data: BC1 and BC2 > V = 0, p-value = 0.007813 > alternative hypothesis: true location shift is not equal to 0 > "" > > The problem is that it always gives me the same p-value (0.007813), whatever vectors I try. And when I remove "paired=T" from the script, all p-values differ. > > Could you help me please ?First of all, that's not actually true:> wilcox.test(BC1, BC5, paired=TRUE)$p.value[1] 0.3828125> wilcox.test(BC1, BC4, paired=TRUE)$p.value[1] 0.015625 If V=0, then the p-value is 2 * 2^(-8) = 1/128 = 0.0078125. This happens if all differences have the same sign. And....> outer(1:5,1:5, Vectorize(function(i,j) sum(sign(M[,i]-M[,j]))))[,1] [,2] [,3] [,4] [,5] [1,] 0 -8 -8 -6 4 [2,] 8 0 8 8 8 [3,] 8 -8 0 8 8 [4,] 6 -8 -8 0 8 [5,] -4 -8 -8 -8 0 ... that is indeed what happens in 8 out of 10 paired comparisons. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com