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.
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.
See also
cat_design_type for design type classification
Other survey-objects:
Survey,
cat_design_type(),
get_data(),
get_metadata(),
has_design(),
has_recipes(),
has_steps(),
is_baked(),
set_data(),
survey_empty(),
survey_to_data_frame(),
survey_to_datatable(),
survey_to_tibble()
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"
# }