% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model-selection.R
\name{tl_test_model_difference}
\alias{tl_test_model_difference}
\title{Perform statistical comparison of models using cross-validation}
\usage{
tl_test_model_difference(
  cv_results,
  baseline_model = NULL,
  test = "t.test",
  metric = NULL
)
}
\arguments{
\item{cv_results}{Results from tl_compare_cv function}

\item{baseline_model}{Name of the model to use as baseline for comparison}

\item{test}{Type of statistical test: "t.test" or "wilcox"}

\item{metric}{Name of the metric to compare}
}
\value{
A data frame with columns \code{metric}, \code{model},
\code{baseline}, \code{mean_diff}, \code{p_value}, and
\code{p_adj} (Holm-adjusted p-value) containing pairwise
statistical comparisons against the baseline model.
}
\description{
Perform statistical comparison of models using cross-validation
}
\examples{
\donttest{
m1 <- tl_model(mtcars, mpg ~ wt, method = "linear")
m2 <- tl_model(mtcars, mpg ~ wt + hp, method = "linear")
cv <- tl_compare_cv(mtcars, list(simple = m1, full = m2), folds = 3)
tl_test_model_difference(cv, baseline_model = "simple", metric = "rmse")
}
}
