On 5/21/2008 4:52 PM, Sharai Gomez-Raygoza wrote:
Hi!!!
I am trying to run a bootstrap but I have troubles. My code is as follows
theta <- function(x){mean(x,)} boot1<-boot(x,theta,R=1000)
Error in statistic(data, original, ...) : unused argument(s) (1:487)
Any help is welcome
Thanks

When sim="ordinary" (the default), the statistic argument to boot() should have at least two arguments. Try revising your theta function along those lines:

library(boot)
X <- rnorm(1000)
theta <- function(x, index){mean(x[index])}
boot(X, theta, R=1000)

ORDINARY NONPARAMETRIC BOOTSTRAP

Call:
boot(data = X, statistic = theta, R = 1000)

Bootstrap Statistics :
        original       bias    std. error
t1* -0.003371328 -0.001429037  0.03195157

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

--
Chuck Cleland, Ph.D.
NDRI, Inc. (www.ndri.org)
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to