Computational Provenance & Reproducibility Record

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

Computational Provenance & Reproducibility Record 3FRBD · 2.0.0 · DOI 10.5281/zenodo.22209966

Computational Provenance & Reproducibility Record

RAISINS · Three-Factor Factorial RBD Module

This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS Three-Factor Factorial RBD module. It is intended to support computational reproducibility and software transparency. Detailed statistical methodology, 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 Three-Factor Factorial RBD (3FRBD)
Module Version 2.0.0
DOI 10.5281/zenodo.22209966
Document Type Computational workflow
Statistical Engine R
R Version 4.5.2
Reproducibility GCP · renv-locked

2 Statistical Dependency Manifest

Package Version Repository Core Statistical Functions
car 3.1-5 CRAN Anova (Type II sums of squares)
agricolae 1.3-7 CRAN LSD.test, HSD.test, duncan.test
effectsize 1.0.3 CRAN eta_squared
phia 0.3-2 CRAN interactionMeans
nortest 1.0-4 CRAN ad.test
moments 0.14.1 CRAN skewness, kurtosis
broom 1.0.13 CRAN tidy
gtools 3.9.5 CRAN mixedsort
Base R (stats) 4.5.2 Base R lm, manova, prcomp, cor, aov

3 Statistical Function Registry

Analytical Role Primary Function(s)
Analysis of variance (three-factor factorial in RBD) lm, car::Anova
Mean separation / post-hoc agricolae::LSD.test, agricolae::HSD.test, agricolae::duncan.test
Effect size (univariate) Cohen’s f = sqrt(SS_effect / SS_error) (base R)
Multivariate analysis of variance (MANOVA) manova, broom::tidy, effectsize::eta_squared
Principal component analysis prcomp
Interaction (adjusted) means phia::interactionMeans
Normality assessment nortest::ad.test
Descriptive statistics mean, sd, moments::skewness, moments::kurtosis
Correlation cor
Ordered factor-level handling gtools::mixedsort

4 Default Methods & Parameters

Analysis Step / Parameter Default Method / Value
Analysis of Variance
(lm() + car::Anova())
Model Block + A + B + C + A:B + A:C + B:C + A:B:C
Sum-of-squares type Type II (type = "II")
Mean Separation (Post-hoc)
(agricolae::LSD.test() / HSD.test() / duncan.test())
Default method Fisher's LSD (options: Tukey's HSD, Duncan's DMRT)
Significance level (α) 0.05 (option: 0.01)
Error term Residual mean square & df from the ANOVA table
Effect Size (univariate) Cohen's f (partial) √(SSeffect / SSerror)
MANOVA
(manova())
Test statistic Pillai's trace
Effect size Partial η² (effectsize::eta_squared())

5 R Code for Key Analytical Steps

The code blocks below demonstrate the exact computation behind each reported result using a small self-contained balanced three-factor factorial RBD constructed inline.

5.1 Three-Factor Factorial ANOVA & Mean Separation

# --- self-contained balanced 3-factor factorial RBD (a=2, b=2, c=3, r=4 blocks) ---
set.seed(1)
d <- expand.grid(
  FactorC = factor(paste0("c", 1:3)),
  FactorB = factor(paste0("b", 1:2)),
  FactorA = factor(paste0("a", 1:2)),
  Block   = factor(paste0("R", 1:4))
)
d$Yield <- rnorm(nrow(d), mean = 50, sd = 5)

# --- ANOVA: three-factor factorial in RBD, Type II sums of squares ---
fit <- lm(Yield ~ Block + FactorA + FactorB + FactorC +
            FactorA:FactorB + FactorA:FactorC + FactorB:FactorC +
            FactorA:FactorB:FactorC, data = d)
aov_tab <- car::Anova(fit, type = "II")
aov_tab

# --- error term for post-hoc (last row = Residuals) ---
DFerror <- aov_tab["Residuals", "Df"]
MSerror <- aov_tab["Residuals", "Sum Sq"] / DFerror

# --- post-hoc: Fisher's LSD on Factor A (critical difference + letter grouping) ---
lsd_A <- agricolae::LSD.test(d$Yield, d$FactorA,
                             DFerror = DFerror, MSerror = MSerror, alpha = 0.05)
lsd_A$statistics   # includes CD (critical difference), CV, MSE
lsd_A$groups       # mean-separation letters

# --- effect size: Cohen's f (partial) = sqrt(SS_effect / SS_error) ---
# index the ANOVA table by [term, "Sum Sq"] so the row labels are kept
# (extracting the column with [, "Sum Sq"] would drop the names -> NA on lookup)
sqrt(aov_tab["FactorA", "Sum Sq"] / aov_tab["Residuals", "Sum Sq"])

5.2 Multivariate Summaries (MANOVA & PCA)

# a second response variable for a multivariate illustration
d$Yield2 <- rnorm(nrow(d), mean = 30, sd = 4)

# --- MANOVA across the response matrix, Pillai's trace ---
man <- manova(cbind(Yield, Yield2) ~ FactorA + FactorB + FactorC +
                FactorA:FactorB + FactorA:FactorC + FactorB:FactorC +
                FactorA:FactorB:FactorC, data = d)
summary(man, test = "Pillai")
effectsize::eta_squared(man)          # partial eta-squared per source

# --- PCA on standardised treatment-combination means ---
mc  <- aggregate(cbind(Yield, Yield2) ~ FactorA + FactorB + FactorC,
                 data = d, FUN = mean)
pca <- prcomp(mc[, c("Yield", "Yield2")], center = TRUE, scale. = TRUE)
summary(pca)

Explore the entire Three-Factor Factorial 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). An R Companion to Applied Regression (3rd ed.) [car: Companion to Applied Regression, R package version 3.1-5]. Sage. https://CRAN.R-project.org/package=car

de Mendiburu, F. (2023). agricolae: Statistical Procedures for Agricultural Research (R package version 1.3-7). https://CRAN.R-project.org/package=agricolae

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

De Rosario-Martinez, H. (2015). phia: Post-Hoc Interaction Analysis (R package version 0.3-2). https://CRAN.R-project.org/package=phia

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

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

Robinson, D., Hayes, A., & Couch, S. (2025). broom: Convert Statistical Objects into Tidy Tibbles (R package version 1.0.13). https://CRAN.R-project.org/package=broom

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

Feedback & Discussion