Description Usage Arguments Details Value Author(s) References See Also Examples

Chen-Rust design effect for stratified, clustered, two-stage samples

1 |

`w` |
vector of weights for a sample |

`strvar` |
vector of stratum identifiers; equal in length to that of |

`clvar` |
vector of cluster identifiers; equal in length to that of |

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

`nest` |
Are cluster IDs numbered within strata ( |

`y` |
vector of the sample values of an analysis variable |

The Chen-Rust *deff* 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.

A list with components:

`strata components` |
Matrix with |

`overall deff` |
Design effect for full sample accounting for weighting, clustering, and stratification |

Richard Valliant, Jill A. Dever, Frauke Kreuter

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. (2013, chap. 14). *Practical Tools for Designing and Weighting Survey Samples*. New York: Springer.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ```
require(sampling)
require(reshape)
data(MDarea.pop)
Ni <- table(MDarea.pop$TRACT)
m <- 10
probi <- m*Ni / sum(Ni)
# select sample of clusters
set.seed(-780087528)
sam <- sampling::cluster(data=MDarea.pop, clustername="TRACT", size=m, method="systematic",
pik=probi, description=TRUE)
# extract data for the sample clusters
samclus <- getdata(MDarea.pop, sam)
samclus <- rename(samclus, c(Prob = "pi1"))
# treat sample clusters as strata and select srswor from each
nbar <- 4
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)
``` |

```
Loading required package: sampling
Loading required package: reshape
Number of selected clusters: 10
Number of units in the population and number of selected units: 403997 67098
$`strata components`
stratum deff.w deff.c deff.s
[1,] 1 1.409053 1.4344129 0.7461304
[2,] 2 1.295517 0.3680934 0.1701147
$`overall deff`
[1] 1.589175
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.