I have one paired data from 7 patients: $$(X_i ,Y_i)=\{(5,1),(-2,-4),(4,2),(-6,-3),(-3,-3),(-5,2),(3,1)\},\quad (i=1,\ldots, 7)$$
where $X$ means placebo $Y$ means the test drug.
My classmate asked me can we have permutation test for the sign statistics to identify $X < Y$. I think the coin function can help me shuffle all the observation into $2^7$ permutations, and then we are not sure if we can just implement Wilcoxon rank sum statistics for each permutation to see the $p$-value?
So the question is how to shuffle all these data and implement the test?
coin
you were referring to. So do you just need to know how to use coin to do a permutation test, or do you want to understand PT's conceptually? $\endgroup$ – gung - Reinstate Monica Oct 28 '12 at 2:16wilcoxsign_test(Y ~ X, alternative="less", zero.method="Pratt", distribution="exact")
from packagecoin
does what you want? Note that you have ties as well as zero-differences which can be handled in different ways. $\endgroup$ – caracal Oct 28 '12 at 14:27