Re: [R] stratified bootstrap with boot

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu 05 May 2005 - 02:06:25 EST

You asked for a stratified bootstrap, not a stratified estimator. This is explained in the reference (Davison & Hinkley).

On Wed, 4 May 2005, Richard Chandler wrote:

> Hello,
>
> I am new to R, and am having trouble getting the output I want from a
> stratified bootstrap. I didn't recieve a reply the first time I posted
> this question so I have tried to make it more clear. My data frame
> (denboot) is set up as follows:
>
> SITE cswa parea treat
> 1 BeanA 3 1.20 m
> 2 BeanBC 3 1.05 m
> 3 BeanD 1 0.93 m
> 4 BlackB 1 1.01 m
> 5 Brooks 3 4.00 b
> 6 BullL 3 1.32 b
> 7 BullM 1 0.20 m
> 8 BullU 4 2.06 b
> ...
>
> #Here is my code:
>
> cswafun <- function(denboot, i) sum(cswa[i])/(sum(parea[i])
> attach(denboot)
> cswa.boot <- boot(denboot, cswafun, R = 10000, strata = treat)
>
> #Here is the output
>
> Call:
> boot(data = denboot, statistic = cswafun, R = 10000, strata = treat)
>
>
> Bootstrap Statistics :
> original bias std. error
> t1* 1.109612 0.02641786 0.2032927
>
> #Can anyone tell me why I'm not getting two estimates of
> sum(cswa)/sum(parea), one for each #strata ('b' and 'm')? Any help
> would be appreciated. Thanks

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu May 05 02:45:04 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:35 EST