[R] survey weights in sample with replacement
tlumley at u.washington.edu
Wed Oct 31 15:43:52 CET 2007
On Tue, 30 Oct 2007, Azam, Mehtabul wrote:
> I am trying to draw a random sample from an household survey with
> sample weight. Is there any function in R or Splus which allows this.
It depends on exactly what you want.
The sample() function will draw unequal probability samples with
sample() will also draw samples without replacement, but (as documented)
it uses sequential sampling and so does not actually generate
probabilities proportional to the specified weights for sample sizes
greater than 1.
The error in sequential sampling is pretty small, but it has attracted a
lot of creativity in the survey literature (probably more than it
deserves). The 'sampling' package implements several algorithms for
drawing unequal probability samples without replacement that really are
proportional to the specified weights where this is achievable.
Thomas Lumley Assoc. Professor, Biostatistics
tlumley at u.washington.edu University of Washington, Seattle
More information about the R-help