drewlee
我想出了一个permutation test的方法。但是只是对一元线性回归。步骤:
1。构造数据y=y1-y2,生成(yi,xi);
2。把(yi,xi)按xi递增的方向排序,排好序后的的(yi,xi)仍然记为(yi,xi),此后,xi>xj,for any i>j;
3。求出序列{di},其中di=1,if yi>0;di=0, if yi<0。
4。求出在{di}中相等的相邻项的长度的最大值E。比如{di}={1,1,0,0,0},那么步骤4求出的E值为3。
5。把{di}permute, 并把结果的每一个元素按.5概率改变01值(即1变为0或0变为1),然后按步骤4求出Ej。这个步骤重复n=1000次(或者n取其他一个较大的数)。得到{Ej},j=1,...1000。
6。求出{Ej}中大于E的个数n,把n/1000作为p-value。
应该有一定的power。
longoR
I didn't check drewlee's method in detail, but _suppose_ the permutation is done properly, i.e. we are permuting the right exchangeable quantities under the null, permutation test will almost always perform well in practice.