% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fit_utils.R
\name{format_model_table}
\alias{format_model_table}
\title{Format model results for publication-ready display}
\usage{
format_model_table(
  data,
  effect_col = NULL,
  digits = 2,
  p_digits = 3,
  labels = NULL,
  show_n = TRUE,
  show_events = TRUE,
  reference_label = "reference",
  exponentiate = NULL,
  conf_level = 0.95,
  marks = NULL
)
}
\arguments{
\item{data}{Data.table containing raw model results with coefficient columns.}

\item{effect_col}{Optional character string specifying the effect column name.
If \code{NULL}, auto-detects from OR, HR, RR, or Estimate columns.}

\item{digits}{Integer number of decimal places for effect estimates.}

\item{p_digits}{Integer number of decimal places for \emph{p}-values.}

\item{labels}{Optional named character vector mapping variable names to display labels.
Supports automatic labeling of interaction terms.}

\item{show_n}{Logical whether to include sample size column.}

\item{show_events}{Logical whether to include events column (ignored for linear models).}

\item{reference_label}{Character string to display for reference categories.}

\item{exponentiate}{Optional logical to force exponentiated (TRUE) or raw (FALSE)
coefficient display. If \code{NULL}, uses existing columns.}
}
\value{
Formatted data.table with publication-ready columns.
}
\description{
Transforms raw model coefficient data into a formatted table suitable for
publication. Handles effect measure formatting (OR, HR, RR, Estimate),
confidence intervals, \emph{p}-values, sample sizes, and variable labels.
Supports interaction terms and mixed-effects models.
}
\keyword{internal}
