Skip to content
Prev 75724 / 398502 Next

resampling Question

"Achaz von Hardenberg" <fauna at pngp.it> writes:
replicate is a good start:
[,1]      [,2]      [,3]       [,4]      [,5]       [,6]
statistic -1.552478 -1.09727  -2.053807  -1.671855 -0.1169578 0.1005037
p.value   0.1549645 0.3010120 0.07018008 0.1288855 0.9094619  0.9221477
          [,7]       [,8]      [,9]      [,10]
statistic -0.1711356 -0.933484 0.3169710 -1.136498
p.value   0.867903   0.3749356 0.758495  0.2851029

As you see, the result is a 2xn matrix. If you really need a data
frame, just use as.data.frame(t(....)),  or (bypassing the matrix
entirely):
t.test(rexp(10),mu=1)[c("statistic","p.value")]), simplify=FALSE))
     statistic   p.value
t   0.32566430 0.7521223
t1 -1.22741479 0.2508023
t2 -1.66792987 0.1296757
t3  1.56440274 0.1521619
t4  0.63778111 0.5395015
t5 -1.03826715 0.3262346
t6  0.09337127 0.9276542
t7  0.90166085 0.3907282
t8 -0.78164107 0.4544958
t9 -0.39766367 0.7001452