This is the main workhorse: given one registry entry and a survey design, it dispatches to the appropriate method based on entry$type and returns a standardised result list.

compute_table(entry, design, data = NULL)

Arguments

entry

A single list element from steps_table_registry().

design

A survey design object (from survey::svydesign()).

data

The cleaned data frame (used for variable availability checks).

Value

A list with:

id

Table identifier.

title

Table title.

type

Table type.

available

Logical: TRUE if the required variable(s) exist.

results

A list of data frames: For proportion: total, by_sex, by_age (each with estimate, lower, upper). For mean: total, by_sex, by_age (each with estimate, lower, upper). For category: total, by_sex, by_age (each with level, estimate, lower, upper). For cascade: named list of proportion results.