v2.0.0
Loading...
Searching...
No Matches
STSLIB::StatsTtest Class Reference

T-test statistical testing. More...

#include <sts_ttest.h>

Static Public Member Functions

static StatsTtestResult oneSample (const Eigen::MatrixXd &data, double mu=0.0, StatsTailType tail=StatsTailType::Both)
static StatsTtestResult paired (const Eigen::MatrixXd &dataA, const Eigen::MatrixXd &dataB, StatsTailType tail=StatsTailType::Both)
static StatsTtestResult independent (const Eigen::MatrixXd &dataA, const Eigen::MatrixXd &dataB, StatsTailType tail=StatsTailType::Both)
static double tCdf (double t, int df)
static double regularizedBeta (double x, double a, double b)

Detailed Description

T-test statistical testing.

Provides t-test implementations: one-sample, paired, and independent two-sample.

Definition at line 74 of file sts_ttest.h.

Member Function Documentation

◆ independent()

StatsTtestResult StatsTtest::independent ( const Eigen::MatrixXd & dataA,
const Eigen::MatrixXd & dataB,
StatsTailType tail = StatsTailType::Both )
static

Independent two-sample t-test.

Parameters
[in]dataAMatrix of observations for group A (rows = observations, cols = variables).
[in]dataBMatrix of observations for group B (same number of columns as dataA).
[in]tailTail type for the test.
Returns
StatsTtestResult with t-statistics, p-values, and degrees of freedom.

Definition at line 94 of file sts_ttest.cpp.

◆ oneSample()

StatsTtestResult StatsTtest::oneSample ( const Eigen::MatrixXd & data,
double mu = 0.0,
StatsTailType tail = StatsTailType::Both )
static

One-sample t-test. Each column of data is tested against mu.

Parameters
[in]dataMatrix of observations (rows = observations, cols = variables).
[in]muHypothesized mean (default 0.0).
[in]tailTail type for the test.
Returns
StatsTtestResult with t-statistics, p-values, and degrees of freedom.

Definition at line 55 of file sts_ttest.cpp.

◆ paired()

StatsTtestResult StatsTtest::paired ( const Eigen::MatrixXd & dataA,
const Eigen::MatrixXd & dataB,
StatsTailType tail = StatsTailType::Both )
static

Paired t-test. Tests dataA - dataB against 0.

Parameters
[in]dataAMatrix of observations for condition A.
[in]dataBMatrix of observations for condition B (same dimensions as dataA).
[in]tailTail type for the test.
Returns
StatsTtestResult with t-statistics, p-values, and degrees of freedom.

Definition at line 87 of file sts_ttest.cpp.

◆ regularizedBeta()

double StatsTtest::regularizedBeta ( double x,
double a,
double b )
static

Regularized incomplete beta function I_x(a, b). Public because it is also used by StatsFtest.

Definition at line 162 of file sts_ttest.cpp.

◆ tCdf()

double StatsTtest::tCdf ( double t,
int df )
static

Compute the CDF of the t-distribution using the regularized incomplete beta function.

Parameters
[in]tThe t-value.
[in]dfDegrees of freedom.
Returns
The probability P(T <= t).

Definition at line 130 of file sts_ttest.cpp.


The documentation for this class was generated from the following files: