Computational Provenance & Reproducibility Record

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

Computational Provenance & Reproducibility Record ANCOVA in CRD · 2.0.0 · DOI ⟨VERIFY — Zenodo DOI not yet minted⟩

Computational Provenance & Reproducibility Record

RAISINS · ANCOVA (CRD)

This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS ANCOVA (CRD). 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 ANCOVA (CRD)
Module Version 2.0.0
DOI ⟨VERIFY — Zenodo DOI not yet minted⟩
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
car 3.1-3 CRAN Anova() (Type III ANCOVA table)
emmeans 1.11.2 CRAN emmeans(), pairs()
multcomp 1.4-28 CRAN cld() (compact letter display)
multcompView 0.1-10 CRAN letter-grouping backend for cld()
effectsize 1.0.1 CRAN eta_squared()
broom 1.0.8 CRAN tidy()

3 Statistical Function Registry

Analytical Role Primary Function(s)
ANCOVA model fitting stats::aov(response ~ treatment + covar)
Covariate-adjusted ANCOVA table (Type III SS) car::Anova(..., type = "III")
Adjusted (estimated marginal) means emmeans::emmeans(model, "treatment")
Pairwise comparison of adjusted means emmeans::pairs()
Multiple-comparison letter groupings multcomp::cld() (via multcompView)

4 Default Methods & Parameters

Analysis Step / Parameter Default Method / Value
ANCOVA
Model

(aov() +
car::Anova())
Model formula One-way ANCOVA: response ~ treatment + covar, a single continuous covariate, main-effects only. No treatment×covariate interaction term is fitted.
Sums of squares Type III, via car::Anova(model, type = "III")
Significance flags Significance level α selectable (choices 0.05 and 0.01, default 0.05). Stars from the p-value: ** when p ≤ 0.01, * when p ≤ 0.05, otherwise NS
Adjusted
Means

(emmeans())
Estimate Estimated marginal means for treatment at the mean of the covariate, reported with their standard errors (SE)
Multiple
Comparisons

(pairs(),
cld())
Test Choice of LSD (default) or Tukey's HSD. LSD uses pairs(emm, adjust = padj); Tukey uses adjust = "tukey"
p-adjustment (LSD only) User-selectable: none (default), bonferroni, holm, or BH. Tukey uses its own "tukey" adjustment
Critical difference CD for each treatment pair computed as SE(d) × |t ratio|
Letter groupings Compact letter display via multcomp::cld(emm, Letters = letters, alpha = α); letters are shown only when the Treatment effect is significant (p ≤ α), otherwise the grouping column is left blank
Transformations
(response
variables only)
Logarithmic log10(x); if any value ≤ 0, an offset is applied as log10(x − min(x) + 1)
Square root sqrt(x); if any value = 0, sqrt(x + 0.5); negative values are rejected with a warning
Arcsine asin(sqrt(p)) for proportions in [0, 1]; boundary values corrected by 1/(4n) (0 → 1/(4n), 1 → 1 − 1/(4n)); values outside [0, 1] are rejected

5 R Code for Key Analytical Steps

The code blocks below demonstrate the exact computation behind each reported result. The ANCOVA and adjusted-means steps use the ToothGrowth dataset from the base datasets package (supp as the treatment, dose as the continuous covariate, len as the response); the multivariate step uses iris (Species as the treatment) to illustrate the several-trait case that the index requires.

5.1 Covariate-adjusted ANCOVA table

data(ToothGrowth)
tg <- ToothGrowth
tg$treatment <- factor(tg$supp)   # treatment factor
tg$covar     <- tg$dose           # continuous covariate

# One-way ANCOVA: main effects only (common slope assumed)
fit <- aov(len ~ treatment + covar, data = tg)

# Type III ANCOVA table, as reported (Intercept / Treatment / Covariate / Error)
tab <- car::Anova(fit, type = "III")
tab$MS <- tab$`Sum Sq` / tab$Df   # mean squares
tab

5.2 Adjusted means and multiple comparisons

library(emmeans)
library(multcomp)

alpha <- 0.05

emm <- emmeans(fit, "treatment")   # estimated marginal (adjusted) means
summary(emm)                       # adjusted means + SE

# Pairwise comparisons (LSD-style default: adjust = "none")
pw <- as.data.frame(pairs(emm, adjust = "none"))
pw$CD <- pw$SE * abs(pw$t.ratio)   # critical difference, per pair
pw

# Compact letter display (groupings); shown only when Treatment is significant
cld(emm, Letters = letters, adjust = "none", alpha = alpha)

# Tukey's HSD alternative:
# pairs(emm, adjust = "tukey"); cld(emm, Letters = letters, adjust = "tukey", alpha = alpha)

Explore the entire ANCOVA in CRD 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/

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

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

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

Graves, S., Piepho, H.-P., & Selzer, L. (2024). multcompView: Visualizations of Paired Comparisons (R package version 0.1-10). https://doi.org/10.32614/CRAN.package.multcompView

Ben-Shachar, M. S., Lüdecke, D., & Makowski, D. (2020). effectsize: Estimation of Effect Size Indices and Standardized Parameters (R package version 1.0.1). https://doi.org/10.32614/CRAN.package.effectsize

Robinson, D., Hayes, A., & Couch, S. (2025). broom: Convert Statistical Objects into Tidy Tibbles (R package version 1.0.8). https://doi.org/10.32614/CRAN.package.broom

Kassambara, A., & Mundt, F. (2020). factoextra: Extract and Visualize the Results of Multivariate Data Analyses (R package version 1.0.7). 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

Schloerke, B., Cook, D., Larmarange, J., Briatte, F., Marbach, M., Thoen, E., Elberg, A., & Crowley, J. (2024). GGally: Extension to ‘ggplot2’ (R package version 2.2.1). https://doi.org/10.32614/CRAN.package.GGally

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

Feedback & Discussion