[quote]如果P大于0.005,则再加入一个数据点重复上述过程,[/quote]
?append
[quote]直到得到p小于0.005
如果得到了小于0.005的p值,则下一个数据将作为第一个数据,依次选15个数据作为一个新的数据段,然后再重复上述过程,得到p值,每个过程以一个小于0.005的p值为止。[/quote]
if while for
开始我还以为是这个意思呢:
m <- 100<br />
n <- 15<br />
x <- rnorm(100)<br />
j <- 1:15<br />
tmp <- NULL<br />
for (i in 1:(m - n + 1)){<br />
tmp[i] <- t.test(x[j])$p.value<br />
j <- j + 1<br />
}<br />
tmp<br />
which(tmp < 0.005)<br />