# Permutation paired test with signed statistic

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?

-
What software are you using? Do you just want to understand teh algorithm conceptually? – gung Oct 28 '12 at 2:07
I am using R for statistic analysis – user1489975 Oct 28 '12 at 2:13
I wondered if that was the 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? – gung Oct 28 '12 at 2:16
I understand the permutation idea for comparing two groups, but not for paired. So that's why I think I need some advice here. – user1489975 Oct 28 '12 at 2:20
So you know that wilcoxsign_test(Y ~ X, alternative="less", zero.method="Pratt", distribution="exact") from package coin does what you want? Note that you have ties as well as zero-differences which can be handled in different ways. – caracal Oct 28 '12 at 14:27
show 1 more comment