print() gives the answer of n_prop(), n_mean(), n_ratio(),
n_multi(), n_cluster(), n_change(), and n_pooled(). summary() gives
what follows from it,
read at the design that is fielded: the whole sample size or the whole
stage sizes in $operational, beside the continuous solution they round.
Arguments
- object
A result of
n_prop(),n_mean(),n_ratio(),n_multi(),n_cluster(),n_change(), orn_pooled().- ...
Additional arguments are not supported and produce an error.
- x
A
summary.svyplan_norsummary.svyplan_clusterobject.
Value
summary() returns a list of class summary.svyplan_n or
summary.svyplan_cluster whose numbers are unformatted. Formatting is
applied only by the print methods, which return the summary invisibly.
A size for a proportion, mean or ratio has kind = "scalar" and the
fields type, method, target (its scale and value),
estimand, binding, min_cases, sizes, precision,
expected_cases, interval, level and assumptions. A
multi-indicator size has kind = "multi" and the fields sizes,
binding, binding_cause, n_domain_max, domains, domain_values,
indicators and assumptions. A single-indicator cluster size has kind = "single" and
the fields stages, question, design, field, eligible, cost
and assumptions. A multi-indicator cluster size has kind = "multi"
and the fields stages, question, design, domains,
domain_values, total, worst, binding, binding_cause,
indicators, cost and assumptions. A change summary has
kind = "change" and sizes in n. A pooled summary has
kind = "pooled" and sizes in sizes. Both report the
target, precision at the whole size, and assumptions.
Details
Field size
A one-stage size is fielded as ceiling(n). Separate domain quotas are
fielded one by one, so their total is the sum of the whole quotas. Under
natural incidence the whole total is fielded and each domain is expected
at that total times its share, which need not be whole. A cluster design
is fielded as $operational, and a cluster design with domains as each
row of $operational$domains.
Precision at the field size
The precision is that of the matching prec_*() function evaluated at
the field size, so it can be slightly better than the target the
continuous size meets exactly. Each indicator's target and achieved
precision are reported on the scale the target was stated in (moe,
rmoe or cv). A row with only a respondent floor has no precision and
reads NA. An interval method other than Wald adds its limits, at the
confidence level the size was planned for (1 - alpha).
Derived sizes
Expected respondents are the field size times the response and
eligibility rates, and eligible respondents multiply that by
eligible_per_unit. The effective size divides the units analyzed by the
design effect. For a cluster design the design effect and the effective
size are the planning quantities of design_effect() and
effective_n(), which leave out finite population corrections. A
multi-indicator cluster design has no single design effect and the
summary reports none.
Binding indicator
The binding indicator of n_multi() is the row whose requirement sets
the size, and binding_cause says what set it: "precision",
"min_cases", "min_respondents" or "min_n_domain". For a
multi-indicator cluster design it is the row with the largest ratio of
achieved to target cv at the field design, which need not be the row with
the worst cv. With domains it is that row in the domain with the worst cv
at the field design.
Domains
A domain is labeled by its value when one column defines domains, and by
column=value pairs joined by commas when several do. A value holding a
comma, an equals sign, a quote or a backslash is quoted, so two domains
never share a label. domain_values holds the domain columns, one row
per row of domains.
Assumptions of a multi-indicator cluster design
The indicators table carries each row's design quantities:
unit_relvar, icc_1 through icc_{S-1}, var_ratio_1 through
var_ratio_{S-1}, and the response rates, with alpha when a row
states a moe or rmoe. A quantity equal on every row is also
listed in assumptions, and the print shows the ones that vary in a
table of their own.
Results of n_alloc() have their own summary, described in
summary.svyplan_alloc.
See also
print.svyplan for the compact display, and summary.svyplan_alloc for stratified allocations.
Examples
summary(n_prop(p = 0.3, moe = 0.05, deff = 1.5, resp_rate = 0.8,
N = 10000))
#> Sample size for proportion (wald)
#>
#> Question: the n that gives moe = 0.05 for p = 0.30
#>
#> Sizes
#> Continuous 577.15
#> Field 578
#> Expected respondents 462.4
#> Effective (n / deff) 308.3
#>
#> Precision at the field size
#> SE 0.02549
#> MOE 0.04996
#> Relative MOE 0.1665
#> CV 0.08497
#> Expected cases 138.7
#>
#> Assumptions
#> alpha: 0.05
#> design effect: 1.5
#> response rate: 0.8
#> population size: 10000
# A Wilson interval at the 90 percent level the size was planned for
summary(n_prop(p = 0.1, moe = 0.03, method = "wilson", alpha = 0.10))
#> Sample size for proportion (wilson)
#>
#> Question: the n that gives moe = 0.03 for p = 0.10
#>
#> Sizes
#> Continuous 272.58
#> Field 273
#> Effective (n / deff) 273.0
#>
#> Precision at the field size
#> SE 0.01816
#> MOE 0.02998
#> Relative MOE 0.2998
#> CV 0.1816
#> Expected cases 27.3
#> Interval 0.07395 to 0.1339 (90%)
#>
#> Assumptions
#> alpha: 0.1
#> design effect: 1
#> response rate: 1
indicators <- data.frame(
name = c("stunting", "vaccination", "anemia"),
p = c(0.30, 0.70, 0.10),
moe = c(0.05, 0.05, 0.03),
deff = c(2.0, 1.5, 2.5)
)
summary(n_multi(indicators, resp_rate = 0.9))
#> Multi-indicator sample size
#>
#> Question: the n that meets every indicator's target
#>
#> Sizes
#> Continuous 1067.07
#> Field 1068
#> Expected respondents 961.2
#> Binding anemia (precision)
#>
#> Indicators at the field size
#>
#> Indicator Target Achieved Deff Needs Binding
#> stunting moe 0.05 0.04097 2.00 718
#> vaccination moe 0.05 0.03548 1.50 538
#> anemia moe 0.03 0.02999 2.50 1068 *
#>
#> Assumptions
#> alpha: 0.05
#> response rate: 0.9
#> proportion method: wald
summary(n_cluster(stage_cost = c(500, 50), icc = 0.05, cv = 0.05,
eligibility_rate = 0.95, resp_rate = 0.9))
#> Optimal 2-stage allocation
#>
#> Question: the cheapest design that gives cv = 0.05
#>
#> Field Continuous
#> stage_1 52 49.81
#> stage_2 14 14.91
#> Total n 728 742.59
#> CV 0.0499 0.0500
#> Cost 62400 62036
#>
#> Field design
#> Expected respondents 622.4
#> Net take per PSU 11.97
#> Design effect (no FPC) 1.548
#> Effective n (no FPC) 402.0
#> Design df 51
#>
#> Cost by stage
#> stage_1 26000
#> stage_2 36400
#>
#> Assumptions
#> icc_1: 0.05
#> unit_relvar: 1
#> var_ratio_1: 1
#> response rate: 0.9
#> eligibility rate: 0.95
# Several indicators under one budget, one of them short of its target
cluster_rows <- data.frame(
name = c("a", "b"),
p = c(0.35, 0.40),
cv = c(0.15, 0.03),
icc_1 = 0.05
)
summary(n_cluster(cluster_rows, stage_cost = c(500, 50), budget = 1e5))
#> Multi-indicator optimal 2-stage allocation
#>
#> Question: the most precise design for a budget of 100000
#>
#> Field Continuous
#> stage_1 80 84.09
#> stage_2 15 13.78
#> Total n 1200 1159.10
#> Worst CV 0.0513 0.0512
#> Cost 100000 100000
#>
#> worst cv: 0.0513 (a)
#> binding: b (precision)
#> short of target: b
#>
#> Indicators at the field design
#>
#> Indicator Target Achieved Needs Binding
#> a cv 0.15 0.05129 136
#> b cv 0.03 0.0461 2733 *
#>
#> Cost by stage
#> stage_1 40000
#> stage_2 60000
#>
#> Assumptions
#> icc_1: 0.05
#> var_ratio_1: 1
#> response rate: 1
#> proportion method: wald
#> stage cost: 500, 50
#>
#> Assumptions by indicator
#>
#> Indicator unit_relvar
#> a 1.857
#> b 1.5