Build the design effect you expect a complex design to produce, before
any data are collected, by combining the design features you are
planning: clustering, unequal weighting, stratification, and optional
auxiliary calibration. The result
is a multiplier you pass as deff to n_prop(), n_mean(),
n_alloc(), or any other sizing or precision function.
Usage
design_effect(x = NULL, ...)
# Default S3 method
design_effect(
x = NULL,
...,
icc = NULL,
take = NULL,
var_ratio = 1,
weights = NULL,
strata = NULL,
aux_r2 = NULL
)
# S3 method for class 'numeric'
design_effect(x, ...)
# S3 method for class 'svyplan_cluster'
design_effect(x, ..., weights = NULL, strata = NULL, aux_r2 = NULL)
# S3 method for class 'svyplan_prec'
design_effect(x, ..., weights = NULL, strata = NULL, aux_r2 = NULL)
# S3 method for class 'svyplan_varcomp'
design_effect(
x,
...,
take = NULL,
weights = NULL,
strata = NULL,
aux_r2 = NULL
)
# S3 method for class 'svyplan_alloc'
design_effect(x, ..., weights = NULL, aux_r2 = NULL)
# S3 method for class 'svyplan_n'
design_effect(x, ..., weights = NULL)Arguments
- x
A
svyplanresult to read design features from: an_cluster()orprec_cluster()allocation, avarcomp()estimate, or ann_alloc()orprec_alloc()allocation.NULL(default) builds the design effect from the component arguments below.- ...
Additional arguments passed to methods. Unused arguments are rejected.
- icc
Homogeneity of units within a cluster, in \([0, 1]\). A vector of length
stages - 1(scalar for two stages, length 2 for three stages, and so on). This is the survey-planning measure returned byvarcomp(), not a generic mixed-model ICC.- take
Per-parent take at stages
2..S(lengthstages - 1, matchingicc). Scalar for two stages (units per PSU), length 2 for three stages (SSUs per PSU, units per SSU), and so on. Required withicc.- var_ratio
Ratio of the components' unit variance to the analysis variable's, default 1. A scalar supplies stage 1 and derives deeper ratios via
k_s = k_{s-1} * (1 - icc_{s-1}). Supply a vector matchingiccwhen unequal-sized sub-units are drawn by SRS. See Details.- weights
Numeric vector of planned sampling weights, one per sampled unit. Only their relative variability matters. On an
n_alloc()result they are an additional anticipated weighting adjustment charged on top of the allocation, such as a nonresponse correction or a calibration step. Do not pass the allocation's own weights there. The stratum takes already carry those, and supplying them again counts the same disproportionality twice. Theallocationcomponent is exact for the plan, while the weighting one is Kish's approximation, so withweightssupplied the overall result is approximate too and prints as such.- strata
Stratum-level data frame describing a planned stratified allocation, using the
n_alloc()column names.Nwithngives the weighting component.Nwithsdandmeangives the stratification component. Supply all four for both.- aux_r2
Optional anticipated squared correlation \(R^2\) in \([0, 1)\) between the survey variable and auxiliary calibration variables. Multiplies the design effect by \(1 - R^2\). Avoid supplying this when variance or ICC inputs are already computed on residuals.
Value
A svyplan_deff object: a numeric scalar carrying the component
decomposition. Use it directly wherever a deff argument is expected,
as.double() to strip it to a plain number, and as.data.frame() to
export the components.
Details
The design effect (DEFF) is the ratio of the variance under the planned design to the variance of a simple random sample of the same size. DEFF = 2 means you need twice the sample for the same precision, whereas DEFF below 1 means the design is more efficient than simple random sampling.
design_effect() is a planning tool. It anticipates a design effect
from design parameters you choose or estimate beforehand. It does not
estimate a design effect from collected data. Once you have a realized
sample, use survey::svymean(..., deff = TRUE) and survey::deff(),
which compute it from the actual weights, strata, and clusters.
Components
Components are selected by which arguments you supply, and multiply together:
$$DEFF = DEFF_{cluster} \times DEFF_{weight} \times DEFF_{strata} \times DEFF_{calibration}.$$
Clustering (icc, take, var_ratio) uses the same variance model as
n_cluster() and prec_cluster(), so the two always agree. For an
\(S\)-stage design with stage homogeneities \(\delta_1, \dots, \delta_{S-1}\),
variance ratios \(k_1, \dots, k_{S-1}\), and per-parent
takes \(t_2, \dots, t_S\) (supplied in take, length
\(S - 1\)),
$$DEFF_{cluster} = \sum_{s=1}^{S-1} k_s \delta_s \prod_{j=s+1}^{S} t_j + k_{S-1}(1 - \delta_{S-1}).$$
For two stages (\(t_2 = m\)), this is \(k_1(1 + \delta_1(m - 1))\). For
three stages (\(t_2 = m, t_3 = q\)), it is
\(k_1 \delta_1 m q + k_2(1 + \delta_2(q - 1))\). Estimate icc (and
var_ratio) from a previous round or pilot with varcomp().
In the multistage form \(k_s\) rescales the stage-\(s\) components to
the unit variance of the analysis variable. When sub-units have equal size
or are drawn proportional to size, each stage ratio follows recursively from
the stage above:
$$k_s = k_{s-1}(1 - \delta_{s-1}), \quad s = 2, \dots, S - 1.$$
This makes the design effect collapse to \(k_1\) when every take equals 1,
where no clustering remains. A scalar var_ratio supplies \(k_1\) and
derives deeper ratios this way. When unequal-sized sub-units are drawn by
simple random sampling, supply the full length-\(S - 1\) vector (for
instance from varcomp()).
Written on components referenced to the total unit variance,
\(\delta_1=\sigma_1^2/S^2\) and \(\delta_2^{tot}=\sigma_2^2/S^2\),
the same quantity is the familiar
\(1+\delta_1(mq-1)+\delta_2^{tot}(q-1)\). The package's icc_2 is
referenced to the within-PSU variance instead, so
\(\delta_2=\delta_2^{tot}/(1-\delta_1)\).
Unequal weighting (weights, or N and n in strata) is Kish's
weighting loss. From a vector of planned weights,
$$DEFF_{weight} = n\sum_i w_i^2 / (\sum_i w_i)^2,$$
and from a planned stratified allocation with stratum sizes \(N_h\)
and takes \(n_h\) the same quantity is
$$DEFF_{weight} = n\sum_h N_h^2/n_h / (\sum_h N_h)^2, \quad
n = \sum_h n_h.$$
Equal weights give exactly 1. This is the cost of a disproportionate
allocation, of weighting classes, or of an anticipated nonresponse
adjustment, and it is never below 1. The same factor, computed from a
past survey's final weights, divides that survey's weighting loss out of
its published design effect. See varcomp().
Stratification (N, sd, and mean in strata) is the gain from
stratifying, the only design-stage component that can fall below 1. With
\(W_h = N_h/N\),
$$DEFF_{strata} = \sum_h W_hS_h^2 /
\left(\sum_h W_hS_h^2 + \sum_h W_h(\bar y_h - \bar y)^2\right).$$
It measures the gain under proportional allocation. Any departure from
proportional is already charged to the weighting component, so the two
compose without double counting.
Auxiliary calibration (aux_r2) approximates the variance reduction
from GREG or linear calibration on auxiliary variables with anticipated
squared correlation \(R^2 \in [0, 1)\), multiplying the
design effect by \(1 - R^2\). Do not supply aux_r2 when the sd, var,
or icc inputs were already computed from regression residuals rather than
the raw survey variable, as that would double-count the auxiliary gain.
Because the clustering component already prices the clustering, do not
additionally inflate deff for it elsewhere. Components you leave
unspecified are simply absent, which is equivalent to setting them to 1.
What a multiplier can and cannot say
Multiplying the components you supply by hand is Kish's approximation. It
is exact when the stratum standard deviations are equal, whatever the
stratum sizes, means and takes, and not otherwise. The gap runs in
either direction, so it is not a bound. The weighting component charges
a disproportionate allocation as a loss without knowing which strata
were favored, so a Neyman allocation over strata that differ sharply in
sd is reported well above its true variance ratio, while a constraint
that forces units into a low-variance stratum is reported well below it.
The printed result marks a multi-component product as approximate for
that reason.
Given an n_alloc() result there is no need to approximate at all.
Every quantity the ratio needs is already there, so
design_effect(alloc) returns the allocation's own variance ratio,
$$D = \sum_h n_hc_h \sum_h W_h^2S_h^2d_hk_h(1+\delta_h(m_hr_h-1))/(n_hc_h) \Big/
\left(\sum_h W_hS_h^2+\sum_h W_h(\bar y_h-\bar y)^2\right),$$
with the per-stratum cluster factors entering stratum by stratum rather
than averaged, and the deff the allocation was built under counted
once. \(n_hc_h\) counts the units of stratum \(h\) that
respond and are in scope, \(c_h\) being the product of its unit
response, PSU response and eligibility rates, since those are the units
the plan's variance reads. Where every stratum has the same rate it
cancels. Where the rates differ, a stratum that responds poorly carries
more of the variance than its issued share suggests, and the ratio
includes that loss. A per-stratum deff weights its own stratum's contribution and a
scalar factors straight back out. Joint designs from n_alloc_joint()
and their assessments can have different variance ratios by measure.
Use prec_alloc_joint() for measure-specific precision.
The clustering bracket reads \(m_hr_h\), the take that responds, because
that is the take n_alloc() sized the design on. So the ratio reported
here falls as the ultimate-unit response rate falls, and describes the
variance model the allocation actually used rather than the one its gross
take would suggest. PSU-level response is absent from the bracket,
because it removes whole clusters instead of shrinking the ones that
are worked.
This ratio is computed without finite population corrections, on the
same planning scale as the component arguments. prec_alloc() applies
each stratum's FPC, so a ratio derived from its variance need not equal
design_effect(alloc) once sampling fractions are material. Use
prec_alloc() when the design variance itself is what you want.
Methods (by class)
design_effect(default): Build the design effect from planning components. Supply the components you are designing for and leave the restNULL.design_effect(numeric): Reject a bare numeric vector, which says nothing about which design component it describes.design_effect(svyplan_cluster): Readicc,var_ratio, and the stage takes from an_cluster()orprec_cluster()allocation. The takes are those that respond (includingeligibility_rateandeligible_per_unitat the final stage), so the design effect and thecvdescribe one design. A plan sized from anindicatorstable has no single design effect and is refused.design_effect(svyplan_prec): Read the design features off aprec_cluster()result, the same way as forn_cluster(), or the stratum counts of aprec_alloc()result, the same way as forn_alloc(). Othersvyplan_prectypes carry thedeffyou supplied rather than one to be derived, and are rejected.design_effect(svyplan_varcomp): Readiccandvar_ratiofrom avarcomp()estimate. The stage takes are your design choice, sotake(lengthstages - 1) must be supplied.design_effect(svyplan_alloc): Read the planned allocation from ann_alloc()result. This returns the allocation's own variance ratio, computed from the stratum sizes, takes, standard deviations, means and any per-stratum cluster factors, rather than a product of separate weighting and stratification approximations. An allocation from stratum sizes alone has no variance to compare, and returns Kish's weighting loss of its whole takes that respond, \(\sum_h n_hc_h \sum_h W_h^2 / (n_hc_h)\), the ratio when every stratum has the same variance. Supplyweightsonly for an additional anticipated adjustment. See theweightsargument.design_effect(svyplan_n): Single-indicator sizing results carry thedeffsupplied at creation rather than deriving one, and are rejected.
References
Kish, L. (1965). Survey Sampling. Wiley.
Valliant, R., Dever, J. A., and Kreuter, F. (2018). Practical Tools for Designing and Weighting Survey Samples, 2nd ed. Springer. Chapter 9.
See also
effective_n() for the sample size this design effect costs
you, varcomp() for estimating icc and var_ratio, n_cluster() for
optimizing a multistage design directly.
Other design input functions:
design_df(),
effective_n(),
svyplan()
Examples
# Clustering: 25 households per cluster, homogeneity 0.05
design_effect(icc = 0.05, take = 25)
#> Planning design effect: 2.2000
# The same cluster design with an anticipated calibration gain
design_effect(icc = 0.05, take = 25, aux_r2 = 0.25)
#> Planning design effect: 1.6500
# One design effect per stratum, from a common icc and the takes. The
# result of each call is a scalar, so sapply() returns a plain vector.
sapply(c(20, 25, 30), function(m) design_effect(icc = 0.03, take = m))
#> [1] 1.57 1.72 1.87
# Three stages: 10 SSUs per PSU, 4 units per SSU
design_effect(icc = c(0.01, 0.05), take = c(10, 4))
#> Planning design effect: 1.5385
# Four stages: 5 EAs per district, 4 segments per EA, 8 households per segment
design_effect(icc = c(0.01, 0.03, 0.06), take = c(5, 4, 8))
#> Planning design effect: 3.9140
# Weighting loss from a planned set of weights
design_effect(weights = rep(c(1, 4), c(300, 100)))
#> Planning design effect: 1.5510
# A planned stratified allocation: weighting loss and stratification gain
frame <- data.frame(
N = c(50000, 120000),
n = c(600, 400),
sd = c(12, 20),
mean = c(55, 48)
)
design_effect(strata = frame)
#> Planning design effect: 1.3476
# Clustering and weighting together
deff <- design_effect(icc = 0.05, take = 25, strata = frame)
deff
#> Planning design effect: 2.9648
n_prop(p = 0.3, moe = 0.05, deff = deff)
#> Sample size for proportion (wald)
#> n = 957 (p = 0.30, moe = 0.050, deff = 2.96)
#> expected cases = 287.1
#> # summary() for the precision at the field size and the derived sizes
# Read the design features off an existing plan
plan <- n_cluster(stage_cost = c(500, 50), icc = 0.05, cv = 0.05)
design_effect(plan)
#> Planning design effect: 1.6392