This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS Student’s t-test module. It is intended to support computational reproducibility and software transparency. Detailed statistical methodology, mathematical derivations, and user guidance are provided separately in the official module documentation.
Any issues or updates required please comment here
F-test for the ratio of two variances; decision taken at the selected significance level α (default 0.05). Applied for the unpaired design only
Consequence
p < α ⇒ variances not homogeneous, Welch's t-test is applied; p ≥ α ⇒ equal-variance Student's t-test is applied
Two-Sample
t-test
(t.test())
Unpaired design (default)
Independent-groups test; var.equal is set automatically from the F-test (Student's when equal, Welch's when unequal). Assumes normality within each group, homogeneity of variances, and independence of observations
Paired design (paired = TRUE)
Test is computed on the within-pair differences; the variance-homogeneity F-test does not apply and is omitted. Assumes the paired differences are normally distributed and the pairs are independent
Alternative
two.sided by default; less and greater optional
Confidence & scope
Confidence level = 1 − α (default 95%); the grouping variable must contain exactly two levels; results rounded to 4 decimal places
Normality
Assessment
Tests applied
Shapiro-Wilk (shapiro.test(), 3 ≤ n ≤ 5000), Anderson-Darling (nortest::ad.test(), n ≥ 8), and Jarque-Bera (tseries::jarque.bera.test(), n ≥ 3)
Overall decision
Majority rule across the available tests; a per-test result is flagged Not Normal at p < α, and a tie is reported as Not Normal
5 R Code for Key Analytical Steps
The code blocks below demonstrate the exact computation behind each reported result using the sleep dataset from the datasets package.
# --- Unpaired / independent groups (default) ---ttest <-t.test(x, y,var.equal = equal_var, # from the F-test abovealternative ="two.sided", # or "less", "greater"conf.level =1- alpha, # default 95%paired =FALSE)ttest# reported quantitiesmean(x); mean(y); mean(x) -mean(y) # group means and differencettest$statistic # t valuettest$parameter # degrees of freedomttest$p.value # p-valuettest$conf.int # confidence intervalif (equal_var) "Student's t-test"else"Welch's t-test"# --- Paired design (paired = TRUE) ---# x[i] and y[i] are the two measurements on the same unit; the test uses the# within-pair differences, so the F-test / equal-variance step does not applyt.test(x, y,alternative ="two.sided",conf.level =1- alpha,paired =TRUE)
5.3 Normality Testing
library(nortest)library(tseries)z <-na.omit(sleep$extra)n <-length(z)if (n >=3&& n <=5000) shapiro.test(z) # Shapiro-Wilkif (n >=8) nortest::ad.test(z) # Anderson-Darlingif (n >=3) tseries::jarque.bera.test(z) # Jarque-Bera# Overall: each test flags "Not Normal" when its p-value < alpha;# the overall verdict follows the majority, with ties resolved to "Not Normal".
Explore the entire Student’s t-test module in preview mode using our demo datasets. To submit suggestions or report a workflow issue, please use the discussion section below, or visit the official RAISINS website.
6 RAISINS Native Statistical Framework
RAISINS uses R for all its statistical computations. Every package used to generate major results is listed and demonstrated with examples, so results can be reproduced independently. These results are then organized and formatted on the RAISINS website along with visualisation to make them easier to use and interpret. RAISINS also has its own custom-built statistical tools for managing workflows, validating results, and generating reports. Details of these are not fully covered here, they’re shared with outside researchers only on request, and are subject to licensing terms.
7 Package References
R Core Team. (2025). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/
Gross, J., & Ligges, U. (2015). nortest: Tests for Normality (R package version 1.0-4). https://doi.org/10.32614/CRAN.package.nortest
Trapletti, A., & Hornik, K. (2024). tseries: Time Series Analysis and Computational Finance (R package version 0.10-61). https://doi.org/10.32614/CRAN.package.tseries
Allaire, J. J., Xie, Y., Dervieux, C., McPherson, J., Luraschi, J., Ushey, K., Atkins, A., Wickham, H., Cheng, J., Chang, W., & Iannone, R. (2026). rmarkdown: Dynamic Documents for R (R package version 2.31). https://github.com/rstudio/rmarkdown