Tidy a matchatr fit into a coefficient / odds-ratio table
Description
Returns the fitted unmatched case-control logistic regression as a tidy coefficient table — one row per model term — on the log-odds scale by default, or the odds-ratio scale with exponentiate = TRUE.
Logical; report estimate and confidence bounds on the odds-ratio scale. Default FALSE.
robust
Logical; use the Huber-White sandwich standard error instead of the model information matrix. Default FALSE.
…
Unused; present for generic consistency.
Details
Standard errors come from the model information matrix, or the Huber-White sandwich when robust = TRUE. The Wald statistic and p-value are always on the coefficient (log-odds) scale; with exponentiate = TRUE the estimate and the confidence bounds are exponentiated while std.error stays on the log-odds scale (the broom convention). The intercept row is included but is not an interpretable baseline risk: under separate case / control sampling it is offset by the log sampling-fraction ratio (Prentice & Pyke, 1979). Only the parametric coefficients are reported: when the fit is an mgcv::gam, the smooth-basis terms (s(age).1, …) are penalized basis weights, not odds ratios, and are excluded.
Value
A data.table with columns term, estimate, std.error, statistic, p.value, and (when conf.int) conf.low, conf.high. For a polytomous (estimator = “polytomous”) fit the coefficients form one equation per non-reference outcome group, so a leading y.level column names the group each row’s contrast is against the reference.
See Also
matcha(), contrast(), summary.matchatr_fit()
Other tidiers: tidy.matchatr_homogeneity(), tidy.matchatr_result()
Examples
library("matchatr")set.seed(1)df <-data.frame(case =rep(c(1, 0), each =100), x =rbinom(200, 1, 0.4))fit <-matcha(df, outcome ="case", exposure ="x", design =unmatched_cc())tidy(fit, exponentiate =TRUE)