% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/easy_ttest.R
\name{easy_ttest}
\alias{easy_ttest}
\title{Run an Independent-Samples t-Test with Automated Narrative Reporting}
\usage{
easy_ttest(
  x,
  y = NULL,
  data = NULL,
  mu = 0,
  var.equal = FALSE,
  conf.level = 0.95,
  alpha = 0.05
)
}
\arguments{
\item{x}{A numeric vector, OR a formula of the form \code{outcome ~ group}
when \code{data} is provided.}

\item{y}{A numeric vector (second group) when \code{x} is not a formula.
Ignored when \code{x} is a formula.}

\item{data}{A data frame. Required when \code{x} is a formula.}

\item{mu}{Null hypothesis value for the mean (one-sample test). Default \code{0}.}

\item{var.equal}{Logical; assume equal variances? Default \code{FALSE} (Welch).}

\item{conf.level}{Confidence level. Default \code{0.95}.}

\item{alpha}{Significance threshold for narrative. Default \code{0.05}.}
}
\value{
An object of class \code{"easystat_result"} with:
  \describe{
    \item{\code{test_type}}{Character: \code{"ttest"}}
    \item{\code{formula_str}}{Description of the comparison}
    \item{\code{raw_model}}{The raw \code{htest} object}
    \item{\code{coefficients_table}}{Group means and confidence interval}
    \item{\code{model_fit_table}}{t-statistic, df, and p-value}
    \item{\code{explanation}}{Plain-language narrative string}
  }
}
\description{
Executes a two-sample (or one-sample) t-test using \code{stats::t.test()},
extracts key metrics via \code{broom}, and generates a plain-language
narrative via the Narrative Generator Module.
}
\examples{
result <- easy_ttest(mpg ~ am, data = mtcars)
print(result)

}
