Learn R Programming

PracTools (version 1.6)

deffCR: Chen-Rust design effect

Description

Chen-Rust design effect for an estimated mean from a stratified, clustered, two-stage samples

Usage

deffCR(w, strvar=NULL, clvar=NULL, Wh=NULL, nest=FALSE, y)

Value

A list with components:

strata components

Matrix with number of sample first-stage units, intracluster correlation, coefficient of variation of the weights, and deff's due to weighting (deff.w), clustering (deff.c), and stratification (deff.s)for each stratum. When strvar or clvar are NULL appropriate subsets of these are output.

overall deff

Design effect for full sample accounting for weighting, clustering, and stratification

Arguments

w

vector of weights for a sample

strvar

vector of stratum identifiers; equal in length to that of w.

clvar

vector of cluster identifiers; equal in length to that of w.

Wh

vector of the proportions of elements that are in each stratum; length is number of strata.

nest

Are cluster IDs numbered within strata (TRUE or FALSE)? If TRUE, cluster IDs can be restarted within strata, e.g., 1,2,3,1,2,3,...

y

vector of the sample values of an analysis variable

Author

Richard Valliant, Jill A. Dever, Frauke Kreuter

Details

The Chen-Rust deff for an estimated mean accounts for stratification, clustering, and unequal weights, but does not account for the use of any auxiliary data in the estimator of a mean. The Chen-Rust deff returned here is appropriate for stratified, two-stage sampling. Note that separate deff's are produced for weighting, clustering, and stratification within each stratum. These cannot be added across strata unless the stratum values of the coefficient of variation of the weights, the sample size of clusters, and the intracluster correlation of y are equal across all strata (see Chen and Rust 2017, p.117).

References

Chen, S. and Rust, K. (2017). An Extension of Kish's Formula for Design Effects to Two- and Three-Stage Designs with Stratification. Journal of Survey Statistics and Methodology, 5(2), 111-130.

Valliant, R., Dever, J., Kreuter, F. (2018, chap. 14). Practical Tools for Designing and Weighting Survey Samples, 2nd edition. New York: Springer.

See Also

deff, deffH, deffK, deffS

Examples

Run this code
require(sampling)
require(reshape)
data(MDarea.popA)
Ni <- table(MDarea.popA$TRACT)
m <- 20
probi <- m*Ni / sum(Ni)
    # select sample of clusters
set.seed(-780087528)
sam <- sampling::cluster(data=MDarea.popA, clustername="TRACT", size=m, method="systematic",
                pik=probi, description=TRUE)
    # extract data for the sample clusters
samclus <- getdata(MDarea.popA, sam)
samclus <- rename(samclus, c("Prob" = "pi1"))
    # treat sample clusters as strata and select srswor from each
nbar <- 8
s <- sampling::strata(data = as.data.frame(samclus), stratanames = "TRACT",
            size = rep(nbar,m), method="srswor")
    # extracts the observed data
samdat <- getdata(samclus,s)
samdat <- rename(samdat, c("Prob" = "pi2"))
    # add a fake stratum ID
H <- 2
nh <- m * nbar / H
stratum <- NULL
for (h in 1:H){
    stratum <- c(stratum, rep(h,nh))
}
wt <- 1/(samdat$pi1*samdat$pi2) * runif(m*nbar)
samdat <- cbind(subset(samdat, select = -c(stratum)), stratum, wt)
deffCR(w = samdat$wt, strvar = samdat$stratum, clvar = samdat$TRACT, Wh=NULL, y=samdat$y2)

Run the code above in your browser using DataLab