Skip to content
Prev 30175 / 398503 Next

Can boot return matrix?

You're certainly very close.  I observe that you have interchanged
positions for the function which calculates the statistic (f2) and
the number of replicates (R) in the third line of your example below.
Swap positions, or assign arguments by name instead of by position,
and I would expect this example to work.  Probably, you've spotted
this already.  Details are in  help("boot").

And, a matrix is also a vector, so perhaps f1() can return a matrix
without causing any problems.  If not, use

f2 <- function(nxm.matrix, i)  as.vector(f1(nxm.matrix[i, ]))

The confidence intervals will require a separate call to boot.ci()
for each entry in the matrix, changing the value of boot.ci(index= )
each time.

-  tom blackwell  -  u michigan medical school  -  ann arbor  -
On Wed, 2 Apr 2003, Katalin Csillery wrote: