There are three types of replicate weight that can be created with as.svrepdesign. Jackknife (JK1 and JKn) weights omit one PSU at a time. Balanced repeated replicates (BRR and Fay) omit or downweight half the sample. Bootstrap replicates resample PSUs from an estimated population. All these types of weights are created by as.svrepdesign, according to the type argument. The default is JK1 weights for an unstratified sample and JKn for a stratified sample.Here we create a survey design object using the one-stage cluster sample from the California Academic Performance Index.
data(api) dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)Converting this design to use unstratified jackknife (JK1) weights is as simple as
rclus1<-as.svrepdesign(dclus1)To convert to bootstrap weights, specify the type and the number of bootstrap replicates.
bclus1 <- as.svrepdesign(dclus1,type="bootstrap", replicates=100)Balanced Repeated Replicates are designed for surveys with two PSUs in each stratum (although as.svrepdesign will attempt to handle some other designs. Within each replicate each stratum of the sample is split into halves, in a complex design that ensures two PSUs from different strata are in the same half-sample for exactly half the replicates. This "complete orthogonal balance" is possible only when the number of replicates is a multiple of 4, larger than the number of strata. Even then, constructing a suitable set of replicates may be difficult. The survey package will sometimes use more replicates than are strictly necessary. Here we create a design from a small data set with 2 PSUs in each stratum.
data(scd) scdnofpc<-svydesign(data=scd, prob=~1, id=~ambulance, strata=~ESA, nest=TRUE)To convert to use BRR weights, we specify type="BRR".
scd2brr <- as.svrepdesign(scdnofpc, type="BRR")Fay's method is a modified version of BRR that uses weights of 2-ρ and ρ rather than 2 and 0 for PSUs in and not in a particular half-sample.
scd2fay <- as.svrepdesign(scdnofpc, type="Fay",fay.rho=0.3)