View source: R/compare_designs.R
| compare_designs | R Documentation |
Given a fitted "strata" object (from strata.data or
strata.distr), computes and compares the variance of the sample
mean under three designs for the same total sample size n:
Simple random sampling without replacement (baseline).
Stratified sampling with n_h \propto W_h
(proportional allocation).
Stratified sampling with n_h \propto W_h S_h
(optimal/Neyman allocation), the allocation used by stratifyR.
Design effects (DEFF) follow Kish (1965): \mathrm{DEFF} = V_{\rm design}
/ V_{\rm SRS}. The equivalent SRS sample size is the number of
observations an SRS design would need to match the precision of the Neyman
design, and the cost saving is the corresponding percentage reduction.
compare_designs(object, ...)
## S3 method for class 'strata'
compare_designs(object, n = NULL, ...)
## S3 method for class 'compare_designs'
print(x, digits = 6, ...)
object |
An object of class |
... |
Currently unused. |
n |
Integer. Total sample size. Defaults to |
x |
A |
digits |
Integer. Number of significant digits used when printing. |
An object of class "compare_designs" (an invisibly-printed
list) with components:
nTotal sample size used.
HNumber of strata.
S2Estimated population variance S^2.
V_withinWithin-stratum variance component
\sum W_h S_h^2.
V_srs, V_prop, V_optVariance of \bar{y} under
SRS, proportional, and Neyman designs.
SE_srs, SE_prop, SE_optCorresponding standard errors.
deff_prop, deff_optDesign effects relative to SRS.
n_srs_equivEquivalent SRS sample size for same precision as the Neyman design.
pct_savingPercentage sample-size saving of Neyman over SRS.
WhShTot\sum W_h S_h (objective function value).
strata.data, strata.distr
## Not run:
res <- strata.data(data = anaemia$Iron, h = 3, n = 300)
cd <- compare_designs(res)
cd
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.