Computational Provenance & Reproducibility Record

RAISINS - R and AI Solutions for INferential Statistics · Online Statistical Analysis Platform for Agricultural Research

Computational Provenance & Reproducibility Record repeated-measures one-way ANOVA · 1.0.0 · DOI 10.5281/zenodo.23013600

Computational Provenance & Reproducibility Record

RAISINS · Repeated-Measures One-Way ANOVA Module

This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS Repeated-Measures One-Way ANOVA 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

Go to the App from here

1 Module Metadata

Parameter Specification
Module Repeated-Measures One-Way ANOVA
Module Version 1.0.0
DOI 10.5281/zenodo.23013600
Document Type Computational workflow
Statistical Engine R
R Version 4.5.2
Reproducibility Execution Environment: Posit Connect · GCR · renv-locked

2 Statistical Dependency Manifest

Package Version Repository Core Statistical Functions
afex 1.5-1 CRAN aov_car()
car 3.1-5 CRAN Anova() (sphericity tests and GG / HF epsilon, via afex)
emmeans 2.0.3 CRAN emmeans(), pairs()
multcomp 1.4-30 CRAN cld()
moments 0.14.1 CRAN skewness(), kurtosis()
nortest 1.0-4 CRAN ad.test()
factoextra 2.1.0 CRAN get_eigenvalue()
scales 1.4.0 CRAN rescale()
gtools 3.9.5 CRAN mixedsort(), mixedorder()
stats 4.5.2 Base R aov(), lm(), qt(), qtukey(), prcomp(), shapiro.test(), ks.test()

3 Statistical Function Registry

Analytical Role Primary Function(s)
Repeated-measures ANOVA model fit afex::aov_car()
Mauchly’s test of sphericity summary(afex_model$Anova)$sphericity.tests (car)
Sphericity correction (GG / HF) afex::aov_car(anova_table = list(correction = ...))
Effect size Generalized eta-squared, afex::aov_car(anova_table = list(es = "ges"))
Complete stratified ANOVA table (SS, MSS) stats::aov(y ~ Day + Error(Subject/Day))
Estimated marginal means emmeans::emmeans()
Pairwise comparisons emmeans::pairs()
Compact letter display (grouping) multcomp::cld()
Critical difference (LSD / Tukey HSD) stats::qt(), stats::qtukey()
Descriptive statistics mean(), sd(), moments::skewness(), moments::kurtosis()
Residual normality (QQ plot) stats::lm(), stats::shapiro.test(), nortest::ad.test(), stats::ks.test()
PCA-based index score stats::prcomp(), factoextra::get_eigenvalue(), scales::rescale()
Result ordering gtools::mixedsort(), gtools::mixedorder()

4 Default Methods & Parameters

Analysis Step / Parameter Default Method / Value
Repeated-Measures
One-Way ANOVA

(afex::aov_car())
Model Fitted separately for each selected response as response ~ Day + Error(Subject/Day), where Day is the single within-subject (repeated) factor and Subject is the unit measured at every time point. There is no between-subject factor, so no interaction term
Sphericity test Mauchly's test for the Day effect, reported for every response; sphericity is flagged as violated when p < α. Not reported when Day has only two levels (sphericity then holds automatically)
Sphericity correction Default none; optional Greenhouse–Geisser (GG) or Huynh–Feldt (HF) correction of the numerator and denominator degrees of freedom. A Huynh–Feldt epsilon above 1 is set to 1
Effect size Generalized eta-squared (es = "ges")
Multiple
Comparison
Test Default LSD (adjust = "none"); TUKEY optional (adjust = "tukey"). Applied to the estimated marginal means of Day
Significance level α Default 0.05; 0.01 optional
Letter Grouping
(multcomp::cld())
Method cld(…, Letters = letters, adjust = test, alpha = α, decreasing = TRUE), so the letter a goes to the highest mean. Computed when Day has ≤ 30 levels
Display rule Letters are shown only when the Day p-value ≤ α; otherwise the grouping is left blank
Critical
Difference (CD)
LSD qt(1 − α/2, df) × SE(d), computed for each pair
Tukey (HSD) qtukey(1 − α, nmeans, df) × SE(d) / √2, computed for each pair
Residual
Normality
QQ plot tests Residuals of lm(response ~ Day + Subject); Shapiro–Wilk by default (3 ≤ n ≤ 5000), Anderson–Darling and Kolmogorov–Smirnov optional
Transformation Options Log10 (shifted by −min + 1 when any value ≤ 0); square root (√(x + 0.5) when zeros are present); arcsine asin(√p) for proportions, with 0 and 1 replaced by 1/(4n) and 1 − 1/(4n)
Reporting The analysis is run on the transformed values; the table shows original-scale means with transformed means in parentheses
PCA Index Method prcomp(center = TRUE, scale = TRUE) on the Day means of the selected responses (at least three); PC1 and PC2 scores rescaled to 0–1
Rounding Displayed decimals Controlled by the "Digits after decimal" input (default 2, range 1–4)

5 R Code for Key Analytical Steps

The code blocks below demonstrate the computation behind each reported result using the built-in Loblolly dataset from the datasets package. The height of each of 14 loblolly pine trees (Seed) was measured at the same six ages (3, 5, 10, 15, 20 and 25 years). This gives a balanced one-way repeated-measures design that mirrors the module’s structure: Seed is the subject, age is the within-subject (repeated) factor, the “Day” of the module, and height is the response.

5.1 Repeated-Measures One-Way ANOVA

library(afex)

data(Loblolly)
dat <- as.data.frame(Loblolly)
dat$Seed <- factor(as.character(dat$Seed))   # subject
dat$age  <- factor(dat$age)                  # repeated within-subject factor ("Day")

afmod <- afex::aov_car(
  height ~ age + Error(Seed / age),   # mirrors: y ~ Day + Error(Subject/Day)
  data        = dat,
  anova_table = list(correction = "none",  # "GG" or "HF" for sphericity correction
                     es         = "ges")   # generalized eta-squared
)

as.data.frame(afmod$anova_table)   # num Df, den Df, MSE, F, ges and p for age

5.2 Mauchly’s Test & Sphericity Correction

s <- summary(afmod$Anova)
s$sphericity.tests    # Mauchly's W and p-value
s$pval.adjustments    # GG and HF epsilon with corrected p-values

# Refit with the Greenhouse-Geisser correction
afmod_gg <- afex::aov_car(height ~ age + Error(Seed / age), data = dat,
                          anova_table = list(correction = "GG", es = "ges"))
as.data.frame(afmod_gg$anova_table)

5.3 Complete ANOVA Table

# Sums of squares and mean squares for age and its within-subject error
summary(aov(height ~ age + Error(Seed / age), data = dat))

5.4 Estimated Marginal Means & Letter Grouping

library(emmeans)

alpha         <- 0.05
adjust_method <- "none"   # "none" = LSD (default) ; "tukey" = TUKEY

emm <- emmeans(afmod, "age")
summary(emm)              # emmean and SE per age

multcomp::cld(emm, Letters = letters, adjust = adjust_method,
              alpha = alpha, decreasing = TRUE)

5.5 Pairwise Comparisons & Critical Difference

pw <- as.data.frame(pairs(emm, adjust = adjust_method))
pw   # contrast, estimate, SE, df, t.ratio, p.value

# --- LSD (adjust = "none") ---
pw$CD_LSD   <- qt(1 - alpha / 2, pw$df) * pw$SE

# --- Tukey (adjust = "tukey") ---
n_means     <- nrow(as.data.frame(emm))
pw$HSD      <- qtukey(1 - alpha, nmeans = n_means, df = pw$df) * pw$SE / sqrt(2)

pw

5.6 Residual Normality

res <- residuals(lm(height ~ age + Seed, data = dat))
shapiro.test(res)
nortest::ad.test(res)

Explore the entire Repeated-Measures One-Way ANOVA 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/

Singmann, H., Bolker, B., Westfall, J., Aust, F., & Ben-Shachar, M. S. (2025). afex: Analysis of Factorial Experiments (R package version 1.5-1). https://doi.org/10.32614/CRAN.package.afex

Fox, J., & Weisberg, S. (2026). car: Companion to Applied Regression (R package version 3.1-5). https://doi.org/10.32614/CRAN.package.car

Lenth, R. V. (2026). emmeans: Estimated Marginal Means, aka Least-Squares Means (R package version 2.0.3). https://doi.org/10.32614/CRAN.package.emmeans

Hothorn, T., Bretz, F., & Westfall, P. (2026). multcomp: Simultaneous Inference in General Parametric Models (R package version 1.4-30). https://doi.org/10.32614/CRAN.package.multcomp

Komsta, L., & Novomestky, F. (2022). moments: Moments, Cumulants, Skewness, Kurtosis and Related Tests (R package version 0.14.1). https://doi.org/10.32614/CRAN.package.moments

Gross, J., & Ligges, U. (2015). nortest: Tests for Normality (R package version 1.0-4). https://doi.org/10.32614/CRAN.package.nortest

Kassambara, A., & Mundt, F. (2020). factoextra: Extract and Visualize the Results of Multivariate Data Analyses (R package version 2.1.0). https://doi.org/10.32614/CRAN.package.factoextra

Wickham, H., Pedersen, T. L., & Seidel, D. (2025). scales: Scale Functions for Visualization (R package version 1.4.0). https://doi.org/10.32614/CRAN.package.scales

Warnes, G. R., Bolker, B., & Lumley, T. (2023). gtools: Various R Programming Tools (R package version 3.9.5). https://doi.org/10.32614/CRAN.package.gtools

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

Feedback & Discussion