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 RBD · 1.0.0 · DOI ⟨VERIFY — Zenodo DOI not yet minted⟩

Computational Provenance & Reproducibility Record

RAISINS · ANCOVA (RBD)

This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS ANCOVA (RBD) module, the two-way analysis of covariance for a Randomized Block Design. 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 (RBD)
Module Version 1.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()
gtools 3.9.5 CRAN mixedsort() (natural ordering of treatment rows)
effectsize 1.0.1 CRAN eta_squared() (multivariate step)
broom 1.0.8 CRAN tidy() (multivariate step)

3 Statistical Function Registry

Analytical Role Primary Function(s)
ANCOVA model fitting (RBD) stats::aov(response ~ treatment + Block + 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)
Natural ordering of treatment labels gtools::mixedsort()
Multivariate index (several traits) stats::manova(), effectsize::eta_squared(), broom::tidy()

4 Default Methods & Parameters

Analysis Step / Parameter Default Method / Value
ANCOVA
Model

(aov() +
car::Anova())
Model formula Two-way ANCOVA (RBD): response ~ treatment + Block + covar, a single continuous covariate, main-effects only.
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 CO2 dataset from the base datasets package (Treatment as the treatment, Type as the block/replication, conc as the continuous covariate, uptake 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 (RBD)

data(CO2)
d <- CO2
d$treatment <- factor(d$Treatment)   # treatment factor
d$Block     <- factor(d$Type)        # block / replication factor
d$covar     <- d$conc                # continuous covariate

# Two-way ANCOVA for a Randomized Block Design: main effects only (common slope)
fit <- aov(uptake ~ treatment + Block + covar, data = d)

# Type III ANCOVA table, as reported (Intercept / Treatment / Block / 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 (RBD) 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

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

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

Feedback & Discussion