1\name{bootweights}
2\alias{bootweights}
3\alias{subbootweights}
4\alias{mrbweights}
5\alias{bootstratum}
6%- Also NEED an '\alias' for EACH other topic documented here.
7\title{Compute survey bootstrap weights }
8\description{
9Bootstrap weights for infinite populations ('with replacement' sampling) are created by sampling with
10replacement from the PSUs in each stratum. \code{subbootweights()}
11samples \code{n-1} PSUs from the \code{n} available (Rao and Wu),
12\code{bootweights} samples \code{n} (Canty and Davison).
13
14For multistage designs or those with large sampling fractions,
15\code{mrbweights} implements Preston's multistage rescaled
16bootstrap. The multistage rescaled bootstrap is still useful for
17single-stage designs with small sampling fractions, where it reduces
18to a half-sample replicate method.
19}
20\usage{
21bootweights(strata, psu, replicates = 50, fpc = NULL,
22         fpctype = c("population", "fraction", "correction"),
23         compress = TRUE)
24subbootweights(strata, psu, replicates = 50, compress = TRUE)
25mrbweights(clusters, stratas, fpcs, replicates=50,
26         multicore=getOption("survey.multicore"))
27}
28%- maybe also 'usage' for other objects documented here.
29\arguments{
30  \item{strata}{Identifier for sampling strata (top level only)}
31  \item{stratas}{data frame of strata for all stages of sampling}
32  \item{psu}{Identifier for primary sampling units}
33  \item{clusters}{data frame of identifiers for sampling units at each stage}
34  \item{replicates}{Number of bootstrap replicates}
35  \item{fpc}{Finite population correction (top level only) }
36  \item{fpctype}{Is \code{fpc} the population size, sampling fraction,
37    or 1-sampling fraction?}
38  \item{fpcs}{\code{survey_fpc} object with population and sample size at each stage}
39  \item{compress}{Should the replicate weights be compressed?}
40   \item{multicore}{Use the \code{multicore} package to generate the replicates in parallel}
41}
42
43\value{
44 A set of replicate weights
45}
46
47\section{warning}{With \code{multicore=TRUE} the resampling procedure does not
48use the current random seed, so the results cannot be exactly
49reproduced even by using \code{set.seed()}}
50
51\note{
52These bootstraps are strictly appropriate only when the first stage of
53sampling is a simple or stratified random sample of PSUs with or
54without replacement, and not (eg) for PPS sampling.  The functions
55will not enforce simple random sampling, so they can be used
56(approximately) for data that have had non-response corrections and
57other weight adjustments.  It is preferable to apply these adjustments
58after creating the bootstrap replicate weights, but that may not be
59possible with public-use data.
60
61}
62\references{Canty AJ, Davison AC. (1999) Resampling-based variance
63  estimation for labour force surveys. The Statistician 48:379-391
64
65  Judkins, D. (1990), "Fay's Method for Variance Estimation" Journal of Official Statistics, 6, 223-239.
66
67  Preston J. (2009) Rescaled bootstrap for stratified multistage sampling. Survey Methodology 35(2) 227-234
68
69  Rao JNK, Wu CFJ. Bootstrap inference for sample surveys. Proc Section
70  on Survey Research Methodology. 1993 (866--871)
71}
72
73\seealso{\code{\link{as.svrepdesign}}}
74
75\keyword{survey}% at least one, from doc/KEYWORDS
76
77