Compute the effective sample size, adjusting for design effects.
This is an S3 generic that mirrors design_effect().
Usage
effective_n(x = NULL, ...)
# S3 method for class 'numeric'
effective_n(
x,
...,
y = NULL,
x_cal = NULL,
prob = NULL,
strata_id = NULL,
cluster_id = NULL,
stages = NULL,
method = "kish"
)
# Default S3 method
effective_n(
x = NULL,
...,
delta = NULL,
psu_size = NULL,
n = NULL,
method = "cluster"
)Arguments
- x
A numeric vector of survey weights (for diagnostic methods), or
NULL(for the"cluster"planning method).- ...
Additional arguments passed to methods.
- y
Outcome variable (for
"henry","spencer","cr").- x_cal
Calibration covariate (for
"henry").- prob
1-draw selection probabilities (for
"spencer").- strata_id
Stratum IDs (for
"cr").- cluster_id
Cluster IDs (for
"cr").- stages
Integer vector of stages per stratum (for
"cr").- method
For numeric weights: one of
"kish"(default),"henry","spencer", or"cr". For planning (no weights):"cluster"(default and only option).- delta
ICC / homogeneity measure, scalar or
svyplan_varcomp.- psu_size
Mean PSU size (scalar).
- n
Total sample size (required for the cluster method).
Methods (by class)
effective_n(numeric): Method for numeric weights vector.effective_n(default): Planning method (no weights needed).
See also
design_effect() for the underlying design effect computation.