[R] boot error: Error in statistic(data, original, ...) : unused argument(s) ( ...)

John Sorkin jsorkin at grecc.umaryland.edu
Sat Aug 13 05:38:48 CEST 2005


I have added on additional line to the code below, the line the
defines the matrix passed to AdjForBase2.

I am having difficulty setting up a boot strap.
My code is listed below. I am getting the following
error message:
Error in statistic(data, original, ...) : unused argument(s) ( ...)
I neither understand the error I have made that leads to 
the error message, nor do I know how to fix my error.
Any help would be appreciated.
Thank you,
John


> AdjForBase2<-
+ function (data) 
+ {
+ cat("******************\n")
+ #print(length(x))
+ 
+ x1<-data[,1]
+ x2<-x1+rnorm(100,0,2)
+ xdiff<-x2-x1
+ corx1x2minx1<-cor(x1,xdiff)
+ 
+ y1<-data[,2]
+ y2<-y1+rnorm(100,10,2)
+ ydiff<-y2-y1
+ cory1y2miny1<-cor(y1,ydiff)
+ 
+ return(c(mean(x1),mean(x2),corx1x2minx1,
+          mean(y1),mean(y2),cory1y2miny1))
+ }
> mommy<-as.matrix(cbind(runif(100,0,100),runif(100,5,100)))
>  boot(data=mommy,statistic=AdjForBase2,R=10)
Error in statistic(data, original, ...) : unused argument(s) ( ...)




More information about the R-help mailing list