[R] Bootstrapping with weighted data sample

Cliff Lunneborg cliff at ms.washington.edu
Tue Sep 28 19:07:54 CEST 2004


Salvatore Barbaro writes, in part:


> Consider a sample, x, like this:
> #
> x<- matrix(rbind(4,8,0,2, 25,30,5,32), ncol=2)
> #
>
> Weight  Income
> 4    25
> 8    30
> 0    5
> 2    32
>
> Here the "Weight" assigns the weight of each observation.
> P.S. I am using library(bootstrap) with bcanon() to obtain boostrap
> confidence intervals.

You may want to use functions from the boot package instead. The boot
function accommodates weighted observations in drawing new samples.


**********************************************************
Cliff Lunneborg, Professor Emeritus, Statistics &
Psychology, University of Washington, Seattle
cliff at ms.washington.edu




More information about the R-help mailing list