generate_CSU_site: One-shot site summaries for COLA-GLMM
Description
Produces the **lossless**, pattern-level sufficient statistics for a single site:
pattern counts `Ck`, outcome sums `Sk = \(\sum y\)`, squared sums `S2k = \(\sum y^2\)`, and the
corresponding pattern matrix `X0`. Works for both binomial and Poisson outcomes
(for Bernoulli, `S2k == Sk`).
`X0` (matrix) pattern design matrix aligned to `Ck/Sk/S2k`
Arguments
df_site
Data frame for one site. Must include outcome column named `y`
and the fixed-effect covariates in `x_names`. If `intercept = TRUE`, the
function will add an `Intercept` column when missing.
x_names
Character vector of fixed-effect names (binary covariates; may
include `"Intercept"` if `intercept = TRUE`).
intercept
Logical; include a fixed intercept in the pattern matrix.