Skip to contents

Pretty-prints the sampling design configuration for each estimation type in a Survey object, showing PSU, strata, weights, and other design elements in a color-coded, readable format.

Usage

cat_design(self)

Arguments

self

Survey object containing design information

Value

Invisibly returns NULL; called for side effect of printing design info

Details

This function displays design information including:

  • Primary Sampling Units (PSU/clusters)

  • Stratification variables

  • Weight variables for each estimation type

  • Finite Population Correction (FPC) if used

  • Calibration formulas if applied

  • Overall design type classification

Output is color-coded for better readability in supporting terminals.

Examples

# \donttest{
dt <- data.table::data.table(id = 1:20, x = rnorm(20), w = runif(20, 0.5, 2))
svy <- Survey$new(
  data = dt, edition = "2023", type = "demo",
  psu = NULL, engine = "data.table",
  weight = add_weight(annual = "w")
)
cat_design(svy)
#> [1] "\n  Design: Not initialized (lazy initialization - will be created when needed)\n"
# }