Re: [R] Getting bootstrap statistic to work

2011-08-12 Thread Jean V Adams
Shouldn't the "i" in your theta() function refer to the selected rows (a "vector of indices" as referred to in the help file for boot) of the data used by boot()? theta <- function(data, i) { data <- data[i, ] data.cov <- cov(data) data.eigen <- eigen(data.cov) data.eigen$values[1]/sum(d

Re: [R] Getting bootstrap statistic to work

2011-08-12 Thread Ken Hutchison
Hi, It's kind of weird for me to not see a return() statement in the function. Maybe try rolling your own, nonparametric bootstraps aren't all that bad. i.e. reps=1000 stat.holder=rep(NA,reps) ###Rep of NA's so you can pick up errors easily for(count in 1:reps) { bootsample=sample(data, n.data