% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stats_tests.R
\name{adaptive.t.test}
\alias{adaptive.t.test}
\title{Perform Adaptive T-Test}
\usage{
adaptive.t.test(df, alpha = 0.05)
}
\arguments{
\item{df}{A data frame containing at least two columns:
\describe{
\item{expression}{Numeric vector of gene expression values.}
\item{group}{Character or factor vector with exactly two group labels.}
}}

\item{alpha}{Numeric. Significance level for the variance equality test
(\code{var.test()}). Default is \code{0.05}.}
}
\value{
A named list with three elements:
\describe{
\item{variance.test}{The result object from \code{var.test()} or
\code{oneway.test()}, depending on the branch taken.}
\item{t.test}{The result object from \code{t.test()}.}
\item{p.value}{Numeric. The p-value from the t-test.}
}
}
\description{
Automatically selects between Welch's and Student's t-test based on the
result of a variance equality test, then returns a unified result structure
regardless of which branch was taken.
}
\details{
If \code{var.test()} returns a p-value below \code{alpha}, variances are
considered unequal and Welch's t-test (\code{var.equal = FALSE}) is used.
Otherwise, Student's t-test (\code{var.equal = TRUE}) is applied alongside
a one-way ANOVA as a confirmatory check. The returned list is consumed
internally by \code{analyze.gene()}.
}
\examples{
\donttest{
# Build a minimal example data frame
analysis.df <- data.frame(
  expression = c(1.2, 2.3, 1.8, 2.1, 3.4, 2.9, 3.1, 2.7),
  group = rep(c("normal", "RCC"), each = 4)
)
result <- adaptive.t.test(analysis.df, alpha = 0.05)
result$p.value
}

}
