Compute the expected sampling precision of a stratum allocation over the
whole population and by domain. This is the inverse of n_alloc().
Usage
prec_alloc(frame, ...)
# Default S3 method
prec_alloc(
frame,
n = NULL,
...,
domains = NULL,
alpha = 0.05,
deff = 1,
resp_rate = 1,
eligibility_rate = 1,
eligible_per_unit = 1,
df = NULL,
unit_cost = NULL,
fpc = c("unit", "stage", "none"),
plan = NULL
)
# S3 method for class 'svyplan_alloc'
prec_alloc(frame, ...)
# S3 method for class 'svyplan_alloc_joint'
prec_alloc(frame, ...)Arguments
- frame
For the default method, a stratum-level data frame as in
n_alloc(). Forsvyplan_allocobjects, a result fromn_alloc(). Assess a joint allocation fromn_alloc_joint()withprec_alloc_joint().- ...
Additional arguments passed to methods. Unused arguments are rejected.
- n
Numeric vector of stratum sample sizes in frame row order, counting issued units. No entry may exceed its stratum's
N, or, when the frame givesN_1,N_1times the product of the stratum's takes. This holds whateverfpcis.- domains
Optional character vector of domain column names in
frame.- alpha
Significance level, default
0.05.- deff
Design effect multiplier (
> 0), scalar or lengthnrow(frame).- resp_rate
Expected response rate among eligible units in
(0, 1].- eligibility_rate
Share of issued units in scope in
(0, 1].- eligible_per_unit
Eligible units per sampled unit (
> 0). These four combine with frame columns of the same name as inn_alloc().- df
Optional degrees of freedom for interval quantiles.
- unit_cost
Optional scalar or length-
nrow(frame)per-unit cost.- fpc
Finite population correction (
"unit","stage", or"none").- plan
Optional
svyplan()object providing design defaults.
Value
A svyplan_prec object with type = "alloc", overall se, moe,
cv, and rmoe, stratum table $detail, and optional $domains.
Details
Passing a fitted allocation assesses its continuous counts and takes by
default. For a clustered field design, supply n = fit$detail$n_int
and any changed whole takes as named take_2, ..., take_S arguments
in .... The whole take columns are take_2_int, ..., take_S_int.
See also
n_alloc() for the inverse allocator and prec_alloc_joint() for
joint multivariate allocation precision.
Other stratified design functions:
merge_psus(),
n_alloc(),
n_alloc_joint(),
prec_alloc_joint(),
strata_bound()
Examples
frame <- data.frame(
stratum = c("A", "B", "C"),
N = c(4000, 3000, 3000),
sd = c(10, 15, 8),
mean = c(50, 60, 55)
)
fit <- n_alloc(frame, n = 600)
prec_alloc(fit)
#> Sampling precision for stratum allocation (continuous optimum)
#> n = 600 (3 strata)
#> se = 0.4305, moe = 0.8438, cv = 0.0079, rmoe = 0.0155
prec_alloc(frame, n = c(200, 200, 200))
#> Sampling precision for stratum allocation
#> n = 600 (3 strata)
#> se = 0.4443, moe = 0.8708, cv = 0.0082, rmoe = 0.0160
cluster <- transform(frame, N_1 = N / 20, take_2 = 10, icc_1 = 0.05,
cost_1 = 50, cost_2 = 1)
fit <- n_alloc(cluster, n = 600)
prec_alloc(fit, n = fit$detail$n_int, take_2 = fit$detail$take_2_int)
#> Sampling precision for stratum allocation
#> n = 600 (3 strata)
#> se = 0.5184, moe = 1.0161, cv = 0.0095, rmoe = 0.0186