CTPP summary statistics
ctpp_stat.RdCTPP summary statistics
Generate CTPP sums
Generate CTPP medians
Usage
psrc_ctpp_sum(df, group_vars = "category", incl_na = TRUE)
psrc_ctpp_median(df, group_vars = "category", incl_na = TRUE)Value
A table with the variable labels, summary statistic, and margin of error.
Sum summaries return a propagated margin of error. Median summaries preserve the
standard estimate_moe column and fill it with NA_real_, because a
comparable median MOE is not currently computed. If you recode category,
preserve exactly one total row per group so downstream helpers such as
ctpp_shares() can still identify the denominator. Sum summaries with
group_vars = NULL warn when the input still contains a "Total"
row alongside component rows, because that full collapse will add the total to
its parts.