Skip to contents

Formats output of lx_ppc() for a single model and a cohort set into a one-sheet spreadsheet summary.

The renderer keeps one row per subgroup and packs component metrics into two df-columns (raw_p_public and raw_p_private).

Tail diagnostics and CRPS receive background fills to help scan for problematic rows.

Usage

lx_ppc_render(summary, wb = NULL, sheet_name = NULL)

Arguments

summary

Output of lx_ppc() when called with cohorts as a cohort_set.

wb

Optional openxlsx workbook to append to.

sheet_name

Sheet name to write into. If NULL, uses metadata field experiment from summary (if available), otherwise "PPC".

Value

An openxlsx workbook.

Examples

if (FALSE) { # \dontrun{
cohort_set <- example_srv_lx |>
  g6tr.cohorts::create_cohort_set(
    id_col = response_id,
    grp_cols = c(d_gender),
    weight_col = weight
  )

ppc <- lx_ppc(example_lx_model, cohorts = cohort_set)
wb <- lx_ppc_render(ppc)
} # }