Produces a detailed summary of a sample including design specification, execution details, per-stage stratum allocation tables, and weight diagnostics.
# S3 method for class 'tbl_sample'
summary(object, ...)A tbl_sample object produced by execute().
Additional arguments (ignored).
Invisibly returns object. Called for its side effect of
printing a summary.
The summary has four sections:
Design — the sampling specification (method, strata, clusters, allocation) for each stage.
Execution — seed, stages executed, timestamp, and total sample size.
Allocation — per-stage stratum tables showing population size
(N_h), sample size (n_h), and sampling fraction (f_h). Requires
.fpc_k columns to be present (produced by samplyr >= 0.2.0).
Weights — range, mean, coefficient of variation, Kish design effect, and effective sample size.
print.tbl_sample() for the compact print method,
as_survey_design() for exporting to the survey package
sample <- sampling_design() |>
stratify_by(facility_type, alloc = "proportional") |>
draw(n = 300) |>
execute(kenya_health, seed = 42)
summary(sample)
#> == Sample Summary ==
#>
#> --- Design ---
#>
#> Stage 1
#> Stratify by: facility_type (proportional)
#> Method: srswor
#>
#> --- Execution ---
#> Stages: 1 of 1
#> Total sample size: 300
#> Seed: 42
#> Executed at: 2026-02-07 02:02:20
#>
#> --- Allocation ---
#>
#> Stage 1:
#> facility_type N_h n_h f_h
#> Referral Hospital 33 3 0.0909
#> County Hospital 80 8 0.1000
#> Sub-County Hospital 176 17 0.0966
#> Health Centre 448 43 0.0960
#> Dispensary 1420 137 0.0965
#> Clinic 780 76 0.0974
#> Maternity Home 161 16 0.0994
#> Total 3098 300 0.0968
#>
#> --- Weights ---
#> Range: 10 - 11
#> Mean: 10.3267
#> CV: 0.0115
#> Kish DEFF: 1.0001
#> Effective n: 300
#>