Re: [R] help (boot)

From: Chuck Cleland <ccleland_at_optonline.net>
Date: Thu, 22 May 2008 04:47:13 -0400

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_at_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_at_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.
Received on Thu 22 May 2008 - 09:03:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 22 May 2008 - 12:30:41 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive