Computational Provenance & Reproducibility Record

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

Computational Provenance & Reproducibility Record Pooled Line x Tester · 1.0.0 · DOI 10.5281/zenodo.21787614

Computational Provenance & Reproducibility Record

RAISINS · Pooled Line x Tester Module

This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS Pooled Line x Tester 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 Pooled Line x Tester
Module Version 1.0.0
DOI 10.5281/zenodo.21787614
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 aov(), anova(), pf(), pt(), lm()
lme4 2.0-1 CRAN lmer(), VarCorr(), ranef(), isSingular(), fixef()
lmerTest 3.2-1 CRAN lmer(), ranova()
agricolae 1.3-7 CRAN LSD.test(), HSD.test(), duncan.test()
gtools 3.9.5 CRAN mixedsort()

3 Statistical Function Registry

Analytical Role Primary Function(s)
Classical combined ANOVA (Kempthorne, 1957) stats::aov(Y ~ Env + Rep(Env) + Treatments + Treatments:Env), stats::anova()
F-tests against Environment interaction stats::pf()
REML variance components (GCA / SCA / G x E) lme4::lmer(REML = TRUE), lme4::VarCorr()
Significance of random terms (likelihood-ratio test) lmerTest::ranova(), stats::anova() (model comparison)
GCA / SCA as BLUPs lme4::ranef()
GCA / SCA classical effects + standard errors cross-mean contrasts, stats::pt()
Combining-ability & heterosis standard errors stats::pt()
Post-hoc mean comparison (letter grouping) agricolae::LSD.test(), agricolae::HSD.test(), agricolae::duncan.test()
Natural ordering of treatment labels gtools::mixedsort()

4 Default Methods & Parameters

Analysis Step / Parameter Default Method / Value
Input data Layout Long format: Environment, Line, Tester, Replication + one numeric column per trait
Entry coding Crosses have both Line and Tester filled; parents are line-only (Tester blank) or tester-only (Line blank), repeated in every environment
Classical combined ANOVA
(aov())
Partition Environments, Rep(Env), Treatments (Parents, Parents-vs-Crosses, Crosses → Lines, Testers, Line×Tester) and each × Environment
F-test denominator f_test = "interaction" (default): combining-ability effects tested against their × Environment interaction; environments treated as random
REML mixed model
(lmer())
Effect structure Line, Tester, Line:Tester and their Env interactions random; REML = TRUE
Environment env_fixed = FALSE (default): (1|Env) + (1|Rep:Env) random. Fixed option removes these variance components
Singular-fit control lmerControl(check.nobs.vs.nlev = "ignore", check.nobs.vs.nRE = "ignore")
Genetic parameters Broad-sense heritability Entry-mean basis: h² = σ²g / (σ²g + σ²ge/e + σ²e/(e·r))
Genetic advance Selection differential k = 2.06 (5% selection intensity)
Heterosis Estimators Mid-parent, better-parent (heterobeltiosis) and (optional) standard heterosis; computed only when parent rows are present
Test error term Residual variance, pooled over reps × environments (e·r)

5 R Code for Key Analytical Steps

The code blocks below demonstrate the exact computation behind each reported result on a small, self-contained, fully deterministic example dataset (2 environments, 3 lines, 2 testers, 2 replications, one response variable) built to mirror the pooled Line x Tester structure the module expects. The response is constructed from fixed effects with no random numbers, so re-running the code returns identical results on any machine. To reproduce a specific analysis, run the same steps on that dataset — the method is unchanged.

5.1 Model Dataset (Pooled Line x Tester)

e <- 2; r <- 2
lines   <- paste0("L", 1:3)
testers <- paste0("T", 1:2)
envs    <- paste0("E", 1:e)

# Section 1 - crosses: both Line and Tester filled
crosses <- expand.grid(Env = envs, Rep = 1:r, Line = lines, Tester = testers,
                       stringsAsFactors = FALSE)

# Section 2 - line parents: Tester blank
line_par <- expand.grid(Env = envs, Rep = 1:r, Line = lines, Tester = "",
                        stringsAsFactors = FALSE)

# Section 3 - tester parents: Line blank
tester_par <- expand.grid(Env = envs, Rep = 1:r, Line = "", Tester = testers,
                          stringsAsFactors = FALSE)

dat <- rbind(crosses, line_par, tester_par)

# Deterministic response (NO random numbers) so the record reproduces EXACTLY
# on any machine and R version: fixed additive line / tester / environment /
# block effects plus a small repeating within-plot pattern.
dat$Yield <-
  100 +
  ifelse(dat$Line   == "", 0, c(L1 = 2, L2 = 5, L3 = -3)[dat$Line]) +
  ifelse(dat$Tester == "", 0, c(T1 = 1, T2 = -1)[dat$Tester]) +
  c(E1 = 0, E2 = 4)[dat$Env] +
  (dat$Rep - 1.5) * 2 +
  ((seq_len(nrow(dat)) %% 5) - 2)

dat$RepEnv <- factor(paste(dat$Env, dat$Rep))   # replication within environment

5.2 Classical Pooled Combined ANOVA

datos        <- dat
datos$Env    <- factor(datos$Env)
datos$RepEnv <- factor(paste(datos$Env, datos$Rep))          # replication within environment
datos$G      <- factor(paste(datos$Line, datos$Tester))       # genotype (all entries)

cr  <- droplevels(subset(datos, Line != "" & Tester != ""))   # crosses
par <- droplevels(subset(datos, Line == "" | Tester == ""))   # parents (line- or tester-only)
cr$Line <- factor(cr$Line); cr$Tester <- factor(cr$Tester)
par$Par <- factor(paste(par$Line, par$Tester))

# 1. Top-level combined model: Env, Rep(Env), Treatments (G) and Treatments x Env
A      <- as.matrix(anova(aov(Yield ~ Env + RepEnv + G + Env:G, data = datos)))
ss_env <- A["Env", 2];       df_env <- A["Env", 1]
ss_rep <- A["RepEnv", 2];    df_rep <- A["RepEnv", 1]
ss_G   <- A["G", 2];         df_G   <- A["G", 1]               # Treatments
ss_eG  <- A["Env:G", 2];     df_eG  <- A["Env:G", 1]           # E x Treatments
ss_err <- A["Residuals", 2]; df_err <- A["Residuals", 1]      # Error

# 2. Treatments partition -> Parents / Parents-vs-Crosses / Crosses (Lines, Testers, L x T)
mp <- as.matrix(anova(aov(Yield ~ Par, data = par)))
ss_par <- mp["Par", 2]; df_par <- mp["Par", 1]
mc <- as.matrix(anova(aov(Yield ~ Line * Tester, data = cr)))
ss_line <- mc["Line", 2]; ss_test <- mc["Tester", 2]; ss_lt <- mc["Line:Tester", 2]
df_line <- mc["Line", 1]; df_test <- mc["Tester", 1]; df_lt <- mc["Line:Tester", 1]
ss_cross <- ss_line + ss_test + ss_lt; df_cross <- df_line + df_test + df_lt
ss_pvc <- ss_G - ss_par - ss_cross;    df_pvc   <- df_G - df_par - df_cross

# 3. Treatments x Environment partition
mcE <- as.matrix(anova(aov(Yield ~ Env * Line * Tester, data = cr)))
ss_eline <- mcE["Env:Line", 2]; ss_etest <- mcE["Env:Tester", 2]; ss_elt <- mcE["Env:Line:Tester", 2]
df_eline <- mcE["Env:Line", 1]; df_etest <- mcE["Env:Tester", 1]; df_elt <- mcE["Env:Line:Tester", 1]
ss_ecross <- ss_eline + ss_etest + ss_elt; df_ecross <- df_eline + df_etest + df_elt
mpE <- as.matrix(anova(aov(Yield ~ Env * Par, data = par)))
ss_epar <- mpE["Env:Par", 2]; df_epar <- mpE["Env:Par", 1]
ss_epvc <- ss_eG - ss_epar - ss_ecross; df_epvc <- df_eG - df_epar - df_ecross

# 4.parents-included pooled ANOVA (published row order)
mk  <- function(df, ss) c(df, ss, ss / df, NA, NA)
tab <- rbind(
  `Environment (E)`        = mk(df_env,    ss_env),
  `Rep / Env`              = mk(df_rep,    ss_rep),
  Treatments               = mk(df_G,      ss_G),
  Parents                  = mk(df_par,    ss_par),
  `Parents vs Crosses`     = mk(df_pvc,    ss_pvc),
  Crosses                  = mk(df_cross,  ss_cross),
  Lines                    = mk(df_line,   ss_line),
  Testers                  = mk(df_test,   ss_test),
  `Line x Tester`          = mk(df_lt,     ss_lt),
  `E x Treatments`         = mk(df_eG,     ss_eG),
  `E x Parents`            = mk(df_epar,   ss_epar),
  `E x Parents vs Crosses` = mk(df_epvc,   ss_epvc),
  `E x Crosses`            = mk(df_ecross, ss_ecross),
  `E x Lines`              = mk(df_eline,  ss_eline),
  `E x Testers`            = mk(df_etest,  ss_etest),
  `E x Line x Tester`      = mk(df_elt,    ss_elt),
  Error                    = mk(df_err,    ss_err))
colnames(tab) <- c("Df", "Sum Sq", "Mean Sq", "F value", "Pr(>F)")

# 5. F-tests -- environments RANDOM (f_test = "interaction"): each combining-ability
denom <- c(
  "Environment (E)" = "Error", "Rep / Env" = "Error",
  "Treatments" = "E x Treatments", "Parents" = "E x Parents",
  "Parents vs Crosses" = "E x Parents vs Crosses", "Crosses" = "E x Crosses",
  "Lines" = "E x Lines", "Testers" = "E x Testers", "Line x Tester" = "E x Line x Tester",
  "E x Treatments" = "Error", "E x Parents" = "Error",
  "E x Parents vs Crosses" = "Error", "E x Crosses" = "Error",
  "E x Lines" = "Error", "E x Testers" = "Error", "E x Line x Tester" = "Error")
for (rn in names(denom)) {
  d <- denom[[rn]]; ms <- tab[d, "Mean Sq"]; dd <- tab[d, "Df"]
  if (is.na(ms) || ms <= 0) next
  tab[rn, "F value"] <- tab[rn, "Mean Sq"] / ms
  tab[rn, "Pr(>F)"]  <- pf(tab[rn, "F value"], tab[rn, "Df"], dd, lower.tail = FALSE)
}

ANOVA_full <- as.data.frame(tab)   # full parents-included pooled combined ANOVA
ANOVA_full

5.3 REML Mixed Model (Variance Components, LRT, BLUPs)

library(lme4)
library(lmerTest)

cr$RepEnv <- droplevels(factor(paste(cr$Env, cr$Rep)))

# Env & Rep(Env) random (multi-environment view); genotype terms + G x E random
fit <- lmer(
  Yield ~ 1 + (1 | Env) + (1 | RepEnv) +
              (1 | Line) + (1 | Tester) + (1 | Line:Tester) +
              (1 | Env:Line) + (1 | Env:Tester) + (1 | Env:Line:Tester),
  data = cr, REML = TRUE,
  control = lmerControl(check.nobs.vs.nlev = "ignore",
                        check.nobs.vs.nRE  = "ignore"))

VarCorr(fit)                 # REML variance components (GCA, SCA, G x E, residual)
isSingular(fit, tol = 1e-4)  # TRUE when a component sits on the zero boundary
ranova(fit)                  # likelihood-ratio test for each random term
ranef(fit)                   # GCA (Line, Tester) and SCA (Line:Tester) as BLUPs

Explore the entire Pooled Line x Tester 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/

Bates, D., Mächler, M., Bolker, B., & Walker, S. (2015). Fitting Linear Mixed-Effects Models Using lme4. Journal of Statistical Software, 67(1), 1–48. (R package version 2.0-1). https://doi.org/10.18637/jss.v067.i01

Kuznetsova, A., Brockhoff, P. B., & Christensen, R. H. B. (2017). lmerTest Package: Tests in Linear Mixed Effects Models. Journal of Statistical Software, 82(13), 1–26. (R package version 3.2-1). https://doi.org/10.18637/jss.v082.i13

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

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