多谢 rtist 和 谢益辉 及时帮助!
问题来自我师姐要我帮她看Bootstrap and Randomization Tests。
自己以前也没做过,在网上找了一下
http://www-stat.stanford.edu/~susan/courses/b494/index/node70.html
A permutation test approach Based on the fact that if there is no difference between the two populations then the result will be compatible to allocation at random of each observation to one of two groups (shuffling).
Any statistical measure of the difference could be used here : mean difference, studentised (t) difference, or even a median difference.
1. Compute the mean difference between samples A and B: MAB(0).
2. For p=1 to P do
1. Randomly allocate 12 observations to sample A and 10 to sample B
2. Compute the mean difference MAB(p)
3. Is MAB(0) a typical value from the randomization distribution MAB(p),p=1..P?
所以我的问题就是
对于一个长为L的向量,我已经无放回的抽出m个元素,构成新的向量,
我想用一个命令得到,由余下n个元素得到的向量。
不是去掉第几个元素。
A bootstrap approach Following the previous definitions of the bootstrap a possible bootstrap test could run as follows:
1. Compute MAB=mean difference between the two original samples
2. For b=1 to B=500 do :
1. Draw a bootstrap sample from population A.
2. Draw a bootstrap sample from population B.
3. Compute a bootstrap estimate of the mean difference :MD(b).
3. Construct the bootstrap distribution of MD, eventually smoothed and recentred at 0.
Situate MAB(0) with respect to this distribution.