The examples for the non-parametric bootstrap function "abcnon" in the R package, "bootstrap", are all univariate. How do you define the input function to use more than one variable. As an example:

> mydata
        x1       x2
1 0.698970 2.306268
2 1.146128 2.320810
3 1.000000 2.379581
4 0.698970 2.291090
5 0.602060 2.318383

tt <- function(p,ind) { p*lm(x2 ~ x1, data=mydata[ind]) }

r <- abcnon( mydata, tt )

Error in `[.default`(mydata, ind) : invalid subscript type 'list' 
11. NextMethod("[") 
10. `[.data.frame`(mydata, ind) 
9. mydata[ind] 
7. model.frame.default(formula = x2 ~ x1, data = mydata[ind], drop.unused.levels = TRUE) 
6. stats::model.frame(formula = x2 ~ x1, data = mydata[ind], drop.unused.levels = TRUE) 
5. eval(mf, parent.frame()) 
4. eval(mf, parent.frame()) 
3. lm(x2 ~ x1, data = mydata[ind]) 
2. tt(P0, x) 
1. abcnon(mydata, tt) 

closed as off-topic by jbowman, Michael Chernick, kjetil b halvorsen, mkt, Peter Flom Oct 12 at 13:48

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – jbowman, Michael Chernick, kjetil b halvorsen, mkt, Peter Flom
If this question can be reworded to fit the rules in the help center, please edit the question.

  • The argument should be an index vector, which you can use for subsetting, as in function(ind) lm(y~x1+x2+x1:x2, data=mydata[ind]) – kjetil b halvorsen Oct 11 at 18:15
  • Thank you for responding! I still can't get it to work. I edited the original post with an example that will hopefully help show where my mistake is. – Mark Bower Oct 12 at 0:04