Frequentist Student's t-tests with exact p-values via the regularised incomplete beta function. More...


Go to the source code of this file.
Classes | |
| struct | STSLIB::StatsTtestResult |
| Per-call output of a Student t-test: t-statistics, p-values and degrees of freedom. More... | |
| class | STSLIB::StatsTtest |
| One-sample, paired and independent two-sample Student t-tests with exact p-values via the regularised incomplete beta function. More... | |
Namespaces | |
| namespace | STSLIB |
| Statistical testing (t-tests, F-tests, cluster permutation, multiple comparison correction). | |
Frequentist Student's t-tests with exact p-values via the regularised incomplete beta function.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
Provides the three single-sample / paired / two-sample independent variants of Student's t-test that the rest of STSLIB needs. All three test the null hypothesis that the mean (or mean difference) equals mu, with the alternative selected via STSLIB::StatsTailType (left, right, both). The statistic is the textbook \(t = (\bar{x}-\mu) / (s/\sqrt{n})\) with n-1 / n-1 / n_A+n_B-2 degrees of freedom; columns of the input matrix are tested in parallel so a (n_obs x n_features) array produces a single row of t-values and p-values in one call.
The p-value is computed from the exact Student-t CDF, evaluated via the regularised incomplete beta function \(I_x(a,b)\) with the Lentz continued-fraction recursion of Numerical Recipes 6.4; no normal-approximation fallback is used. The CDF and incomplete-beta routines are exposed as public so STSLIB::StatsFtest can reuse them for its F-distribution implementation.
References: Student (1908), Biometrika 6(1); Press et al., Numerical Recipes 3rd ed., section 6.4.
Definition in file sts_ttest.h.