Skip to contents

Reports the components, their membership columns and seeds, and how the sampled rows fall across the domains: the frame sets units belong to. A domain holding no rows is not shown, because absence from a sample is not evidence that the domain is empty in the population.

Usage

# S3 method for class 'frame_stack'
summary(object, ...)

# S3 method for class 'summary_frame_stack'
print(x, ...)

Arguments

object

A frame_stack produced by stack_frames().

...

Must be empty.

x

A summary_frame_stack object.

Value

A summary_frame_stack object, which prints the summary below. Its fields hold the figures the print shows: n_frames, n_rows, key (the key columns), frames (a tibble with one row per component, its frame name, rows, membership column and seed, NA when the component has none), domains (a tibble with the rows of each domain that holds some, in the printed order) and coverage. It is NULL unless a component shares weights, and otherwise holds the coverage status ("known", "incompatible" or "unknown") and the orphan_clusters that no frame reaches when it is known. stack is the summarized stack itself.

Details

The counts are rows, not distinct units. A unit listed in two frames and selected from both appears twice, once per frame that selected it, which is exactly the double count a composite weight has to resolve.

Examples

population <- data.frame(
  person_id = 1:60,
  in_landline = rep(c(TRUE, FALSE), times = c(40, 20)),
  in_cell = rep(c(FALSE, TRUE), times = c(10, 50))
)

frames <- stack_frames(
  landline = sampling_design() |>
    draw(n = 10) |>
    execute(population[population$in_landline, ], seed = 1),
  cell = sampling_design() |>
    draw(n = 12) |>
    execute(population[population$in_cell, ], seed = 2),
  membership = c(landline = "in_landline", cell = "in_cell"),
  key = person_id
)

summary(frames)
#> ── Frame Stack Summary ─────────────────────────────────────────────────────────
#> 
#> ℹ 2 frames | 22 rows | key person_id
#> 
#> Frames
#> • landline: 10 rows | in_landline | seed 1
#> • cell: 12 rows | in_cell | seed 2
#> 
#> Domains
#> • cell: 3 rows
#> • cell+landline: 17 rows
#> • landline: 2 rows
#> 
#> ℹ A unit listed in two frames is counted once per frame that selected it.
#>