[R] bootstrapping for maxium data

David Winsemius dwinsemius at comcast.net
Wed May 21 14:24:51 CEST 2014


Run the examples in the ?boot help page. Notice that boot needs a function that accepts a dataframe and an index vector.

Sent from my iPhone

> On May 21, 2014, at 1:49 AM, 张以春 <yczhang at nigpas.ac.cn> wrote:
> 
> Dear friends,
> 
> 
> I  have a numeric vector composed of 320 numbers.
> 
> 
> Now, I want to do resample for 10000 times. I want to get maxium number for every trial and get a 10000 maxium numbers.
> 
> 
> I have tried to use "boot" package such as follows.
> 
> 
> results<-boot(data=nearshore1,statistic=max,R=10000,stype="w")
> 
> 
> But, surprising, the results shows that I got 10000 A (A is the maxium number in "nearshore1")
> 
> 
> It's a puzzle to me. I do not know how to do that. Thank you.
> 
> 
> Yichun
> 
> 
> 
> 
> 
> 
> 
>    [[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.



More information about the R-help mailing list