% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/desc_utils.R
\name{process_variable}
\alias{process_variable}
\title{Process variable wrapper}
\usage{
process_variable(
  data,
  var,
  group_var = NULL,
  stats_continuous,
  stats_categorical,
  digits,
  conf_level = 0.95,
  na_include,
  na_label,
  test,
  test_continuous,
  test_categorical,
  total,
  total_label,
  labels,
  na_percent,
  p_per_stat = FALSE,
  marks = NULL,
  ...
)
}
\arguments{
\item{data}{Data.table containing the variable.}

\item{var}{Character string naming the variable to process.}

\item{group_var}{Optional character string naming the grouping variable.}

\item{stats_continuous}{Character vector of statistics for continuous variables.}

\item{stats_categorical}{Character vector of statistics for categorical variables.}

\item{digits}{Integer number of decimal places for continuous statistics.}

\item{conf_level}{Numeric confidence level for survival confidence intervals.}

\item{na_include}{Logical whether to include missing values as a category.}

\item{na_label}{Character string label for missing values.}

\item{test}{Logical whether to perform statistical tests.}

\item{test_continuous}{Character string specifying test type for continuous variables.}

\item{test_categorical}{Character string specifying test type for categorical variables.}

\item{total}{Logical or character controlling total column display.}

\item{total_label}{Character string label for total column.}

\item{labels}{Named character vector of variable labels.}

\item{na_percent}{Logical whether to include NA in percentage denominators.}

\item{p_per_stat}{Logical whether to show separate \emph{p}-values per statistic for
continuous variables. Default \code{FALSE} for better performance.}

\item{marks}{List with \code{big.mark} and \code{decimal.mark} as returned
by \code{\link{resolve_number_marks}}.}

\item{...}{Additional arguments passed to test functions.}
}
\value{
List with 'formatted' and 'raw' data.table components.
}
\description{
Routes variable processing to appropriate handler based on variable type
(continuous, categorical, or survival). Returns both formatted display
strings and raw numeric values.
}
\keyword{internal}
