Computational Provenance & Reproducibility Record

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

Computational Provenance & Reproducibility Record Randomized Block Design (RBD) · 3.0.0 · DOI pending

Computational Provenance & Reproducibility Record

RAISINS · Randomized Block Design (RBD) Module

This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS Randomized Block Design (RBD) 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 Randomized Block Design (RBD)
Module Version 3.0.0
DOI —–
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
stats 4.5.2 Base R lm(), anova(), manova(), p.adjust()
agricolae 1.3-7 CRAN LSD.test(), HSD.test(), duncan.test()
effectsize 1.0.1 CRAN cohens_f(), eta_squared()
broom 1.0.12 CRAN tidy()
gtools 3.9.5 CRAN mixedsort(), mixedorder()
dplyr 1.1.4 CRAN group_by(), summarise()
tidyr 1.3.2 CRAN pivot_longer()

3 Statistical Function Registry

Analytical Role Primary Function(s)
Blocked linear model stats::lm(y ~ Treatment + Block)
ANOVA table stats::anova(model)
Effect size (Cohen’s f) effectsize::cohens_f(model) (partial, reported for the treatment term)
Post-hoc mean separation agricolae::LSD.test() (default), agricolae::HSD.test(), agricolae::duncan.test()
P-value adjustment (LSD) agricolae::LSD.test(..., p.adj =); alternatively stats::p.adjust()
Grouping-letter ordering gtools::mixedsort()
Multivariate analysis stats::manova(), broom::tidy(), effectsize::eta_squared()
Treatment means & summaries dplyr::group_by(), dplyr::summarise(), tidyr::pivot_longer()

4 Default Methods & Parameters

Analysis Step / Parameter Default Method / Value
Two-way additive ANOVA
(lm() + anova())
Model y ~ Treatment + Block (both taken as factors; no treatment × block interaction, which is the standard RBD assumption). One model fitted per response variable
Sums of squares Sequential (Type I). For the balanced, orthogonal RBD layout this is identical to Type II and Type III
Error mean square (MSE) Residual SS ÷ residual df, i.e. row 3 of the ANOVA table; reused by every post-hoc test
Block term Reported with its own mean square, F and significance marker; blocks are treated as a nuisance factor and receive no post-hoc comparison
Effect size
(effectsize::cohens_f())
Treatment effect size Partial Cohen's f for the treatment term
Significance & rounding Significance level (α) 0.05 default (user-selectable: 0.05, 0.01)
Significance stars ** for p ≤ 0.01, * for p ≤ 0.05, NS otherwise (fixed thresholds, independent of the selected α; applied to both the treatment and the block row)
Rounding 2 decimal places default (user-adjustable digit control, 1–4)
Mean comparison / post-hoc
(agricolae)
Default method LSD — agricolae::LSD.test() (alternatives: Tukey HSD HSD.test(); DMRT duncan.test())
Inputs to the test Pooled MSerror = MSE and DFerror = residual df from the blocked model; alpha = α. Comparisons are made on treatment means only
Grouping display Letters and the CD value are shown only when the treatment p ≤ α; group labels ordered with gtools::mixedsort(); grouping is suppressed when the number of treatments exceeds 80
Critical value reported CD/LSD (LSD), HSD (Tukey), or Duncan critical ranges (DMRT). The trait-wise Individual ANOVA table reports CD at both 5% and 1%
P-value adjustment
(LSD only, LSD.test(p.adj =))
Method none default (user-selectable: bonferroni, holm, BH)
Reporting under adjustment A single CD/critical difference is not defined once comparisons are adjusted, so the CD row is omitted; the adjusted result is carried by the grouping letters
Standard errors SEM sqrt(MSE / r), where r is the number of blocks (= replications per treatment)
SED sqrt(2 × MSE / r)
Data transformations
(optional, per variable)
Logarithmic log10(x); if any value ≤ 0, log10(x - min(x) + 1)
Square-root sqrt(x); if any value = 0, sqrt(x + 0.5); blocked on negative values
Arcsine asin(sqrt(x)) on proportions in [0, 1]; 0 and 1 replaced by 1/(4n) and 1 - 1/(4n)
MANOVA
(multi-response mode)
Model & test statistic manova(Y ~ Treatment + Block); Pillai's trace (the stats::manova() default), tidied with broom::tidy(), with partial η² for both terms
Requirement At least two response variables, and the number of treatments must exceed the number of response variables

5 R Code for Key Analytical Steps

The code blocks below demonstrate the exact computation behind each reported result using immer (from the MASS package, which ships with R): Immer’s barley trial, a textbook randomized block design in which 5 varieties are grown at 6 locations acting as blocks, one plot per variety per block, with yields recorded in two years (Y1, Y2).

5.1 Two-Way Additive ANOVA and Effect Size

d <- MASS::immer                                 # 5 varieties x 6 locations (blocks), 30 plots

treatment <- factor(d$Var)                       # treatment factor
block     <- factor(d$Loc)                       # block factor
y         <- d$Y1                                # response variable

# Blocked linear model and ANOVA table (mirrors the module; one model per response)
model  <- lm(y ~ treatment + block)
result <- anova(model)
result                                           # treatment F = 4.23, p = 0.0121
                                                 # block     F = 21.89, p = 1.75e-07

# Error (residual) mean square and df, reused by the post-hoc tests
MSE   <- result[3, 3]                            # 162.89
dferr <- result[3, 1]                            # 20

# Partial Cohen's f effect size; the module reports the treatment row
effectsize::cohens_f(model)[1, 2]                # 0.9199

5.2 Post-hoc Mean Comparison (LSD default; Tukey / DMRT alternatives)

alpha <- 0.05                                    # default significance level

# Least Significant Difference (default): agricolae uses the pooled MSE and
# residual df from the blocked model; grouping letters ordered with mixedsort.
out <- agricolae::LSD.test(y, treatment, DFerror = dferr, MSerror = MSE,
                           alpha = alpha, p.adj = "none")

out$groups[gtools::mixedsort(rownames(out$groups)), ]
out$statistics                                   # MSerror, Df, Mean, CV, t.value, LSD (= CD)

# Letters and the CD value are printed only when the treatment effect is significant:
if (result[1, 5] > alpha) out$groups[, 2] <- ""

# Optional p-value adjustment for LSD (default "none"; selectable: bonferroni, holm, BH).
# agricolae applies the correction internally and recomputes the grouping letters.
agricolae::LSD.test(y, treatment, DFerror = dferr, MSerror = MSE, alpha = alpha,
                    p.adj = "bonferroni")$groups

# Alternatives selectable in the app (same DFerror / MSerror / alpha arguments):
#   Tukey HSD -> agricolae::HSD.test(y, treatment, DFerror = dferr, MSerror = MSE, alpha = alpha)
#   DMRT      -> agricolae::duncan.test(y, treatment, DFerror = dferr, MSerror = MSE, alpha = alpha)

# Standard errors from the pooled MSE (r = number of blocks)
r   <- out$means[1, 3]                           # 6
SEM <- sqrt(MSE / r)                             # 5.2104
SED <- sqrt(2 * MSE / r)                         # 7.3686

5.3 MANOVA Across Multiple Responses (multi-response mode)

# The app's MANOVA mode requires >= 2 response columns (one per measured trait)
# and more treatments than response variables. Both factors are carried over
# from the univariate model, so the block effect is estimated as well.
Y <- as.matrix(d[, c("Y1", "Y2")])

res.man <- manova(Y ~ treatment + block)
broom::tidy(res.man)                             # Pillai's trace per term
effectsize::eta_squared(res.man)                 # partial eta-squared per term

Explore the entire Randomized Block Design (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/

de Mendiburu, F. (2023). agricolae: Statistical Procedures for Agricultural Research (R package version 1.3-7). https://doi.org/10.32614/CRAN.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.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.12). https://doi.org/10.32614/CRAN.package.broom

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

Wickham, H., François, R., Henry, L., Müller, K., & Vaughan, D. (2023). dplyr: A Grammar of Data Manipulation (R package version 1.1.4). https://doi.org/10.32614/CRAN.package.dplyr

Wickham, H., Vaughan, D., & Girlich, M. (2025). tidyr: Tidy Messy Data (R package version 1.3.2). https://doi.org/10.32614/CRAN.package.tidyr

Venables, W. N., & Ripley, B. D. (2002). Modern Applied Statistics with S (4th ed.). Springer. (MASS R package version 7.3-65). https://doi.org/10.32614/CRAN.package.MASS

Feedback & Discussion