print() on a n_twophase() result gives the design as it would be
fielded: the two phase sizes in whole units, the precision and cost they
buy, the per-stratum subsampling fractions, and which of the two designs
to run. summary() gives what that answer was chosen against: the
continuous optimum beside the fielded one, the full stratum table
including the continuous issue, the single-phase comparator with its cost
and whether it reaches the target, and the planning assumptions.
Value
summary() returns an object of class
summary.svyplan_twophase; its print() method returns it invisibly.
See also
n_twophase() for the planner, and print.svyplan for the
printed block this expands on.
Examples
frame <- data.frame(
stratum = c("A", "B", "C", "D"),
N = c(3500, 2500, 2500, 1500),
sd = c(12, 25, 8, 40),
mean = c(40, 70, 35, 90),
unit_cost = c(2, 5, 1, 9)
)
plan <- n_twophase(frame, phase1_cost = 1, budget = 50000)
plan
#> Two-phase allocation (4 phase-2 strata)
#> field design: n_phase1 = 16924 | n_phase2 = 8094
#> cv = 0.0050, cost = 50000
#>
#> stratum share sd unit_cost nu n_int
#> A 0.350 12.00 2.00 0.4154 2462
#> B 0.250 25.00 5.00 0.5474 2316
#> C 0.250 8.00 1.00 0.3917 1659
#> D 0.150 40.00 9.00 0.6528 1657
#>
#> single-phase is better here: n = 14085 at cv 0.0046, so skip phase 1
#> # summary() for the continuous optimum and the comparator
summary(plan)
#> Analysis of a two-phase allocation (4 phase-2 strata)
#>
#> field design: n_phase1 = 16924 | n_phase2 = 8094
#> cv = 0.0050, cost = 50000
#> continuous optimum: n_phase1 = 16925 | n_phase2 = 8092 (cv 0.0050, cost 50000)
#>
#> Strata
#> stratum share sd unit_cost nu n_issued n_int
#> A 0.350 12.00 2.00 0.4154 2461 2462
#> B 0.250 25.00 5.00 0.5474 2316 2316
#> C 0.250 8.00 1.00 0.3917 1657 1659
#> D 0.150 40.00 9.00 0.6528 1657 1657
#>
#> Single-phase comparator: n = 14085, cv = 0.0046, cost = 50000
#> It is the better design here, and it reaches the target
summary(plan)$detail
#> stratum share sd unit_cost nu n_issued n_int
#> 1 A 0.350 12.00 2.00 0.4154 2461 2462
#> 2 B 0.250 25.00 5.00 0.5474 2316 2316
#> 3 C 0.250 8.00 1.00 0.3917 1657 1659
#> 4 D 0.150 40.00 9.00 0.6528 1657 1657