% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/impute_missing.R
\name{impute_mice}
\alias{impute_mice}
\title{Impute missing values via Multiple Imputation (mice)}
\usage{
impute_mice(data, m = 5, cols = NULL, verbose = FALSE, ...)
}
\arguments{
\item{data}{A data.frame or tibble containing missing values.}

\item{m}{Integer; number of imputations to run (passed to mice). Default 5.}

\item{cols}{Optional character vector of numeric columns to impute.
Defaults to all numeric columns with at least one NA.}

\item{verbose}{Logical; if TRUE, prints progress and a completion summary. Default FALSE.}

\item{...}{Additional arguments passed to mice::mice().}
}
\value{
A data.frame/tibble with numeric columns imputed by mice.
}
\description{
Wraps mice to impute only numeric columns; non-numeric columns are untouched.
Requires the mice package to be installed (Suggests). If no numeric columns
contain NAs, \code{data} is returned unchanged.
}
\details{
Notes:
\itemize{
\item At least two numeric columns are typically needed by mice to borrow strength.
\item This function runs \code{m} imputations and returns the first completed dataset.
\item Messages from mice are suppressed; use \code{verbose = TRUE} here for high-level progress.
}
}
\examples{
\donttest{
if (requireNamespace("mice", quietly = TRUE)) {
  df <- tibble::tibble(a = c(1, NA, 3), b = c(2, 4, NA), c = 5)
  impute_mice(df, m = 2, verbose = TRUE)
}
}

}
\references{
\insertRef{rubin1987mi}{HealthMarkers}
\insertRef{vanbuuren2011mice}{HealthMarkers}
}
