Home / Validation

Validated against R

Every method on FieldTrialHub is compared with R before it is released. This page lists the R functions used as the reference, the test datasets and the results, including the places where an R package and FieldTrialHub differ on purpose.

How each method is checked

  1. Several test datasets are analysed on FieldTrialHub: published example data from the R package agricolae where it has one, and simulated datasets with different sizes, decimals, shuffled row order, missing plots and awkward labels.
  2. The same analyses are run in R with the reference functions listed below.
  3. Every number is compared: sums of squares, degrees of freedom, F and p values, means, standard errors, effects and variance components. Statistics must agree to a relative difference of 10−9; p-values, which depend on the numerical routine for the distribution, to 10−6. Letter groupings must be identical.
  4. The Download R script of each tool is generated for every test case, run in R, and its results compared with the website in the same way.

Reference software: R 4.3.3, agricolae 1.3-8, emmeans 1.10.0, multcompView 0.1.9. Last full run: 3 December 2026.

Rounded display, full-precision comparison

The tables in the tools, in the reports and on this page show rounded values, usually to 4 or 5 decimals. The comparisons with R are made on the full-precision numbers (about 15 significant digits), before any rounding, using the tolerances above.

Two programs that agree to 15 digits can still print a different last digit when a value lies almost exactly halfway between two rounded values. An example from the tests: for the SCA effect of LT-8 × TPS-67, FieldTrialHub computes 0.5187499999999994 and R computes 0.51875, a relative difference of about 10−15. Rounded to four decimals they print as 0.5187 and 0.5188. Such differences in the last printed digit are a property of rounding, not of the method, and the calculations are never adjusted to make printed values look identical.

Results

ToolR referenceTest casesNumbers matching RLetter groupings
ANOVA, factorial, correlation, descriptiveaov, agricolae HSD.test, LSD.test, duncan.test, cor.test, quantile (type 7)CRD and RCBD, balanced and with missing plots; factorial in CRD and RCBD361 of 36114 of 14
Split-plot Proagricolae::sp.plot; HSD.test, LSD.test, duncan.test with Error (a) and Error (b)4 datasets (incl. agricolae plots) × Tukey, LSD, Duncan; α 0.05 and 0.01426 of 42657 of 57
Augmented RCBD Prolm, emmeans, multcompView; ANOVA partitions and standard errors also against agricolae::DAU.test4 datasets (incl. the DAU.test example) × LSD, Tukey4832 of 48328 of 8
Alpha-lattice Prolm (sequential ANOVA), emmeans (adjusted means, pairwise tests), multcompView4 datasets (2 to 4 replications, missing plots, block numbers within or across replications) × LSD, Tukey4378 of 43788 of 8
Line × tester Proaov with the Singh and Chaudhary formulas; internal values of agricolae::lineXtester4 datasets (incl. agricolae heterosis), with and without parents474 of 474–
Multi-location Proagricolae::AMMI, lm, bartlett.test, svd; HSD.test, LSD.test, duncan.test4 datasets (incl. agricolae plrv; 2 to 6 environments) × environments fixed or random1164 of 11646 of 6

Pro methods: 11,274 numbers and 79 letter groupings compared, all matching. The downloadable R scripts reproduced every one of them.

Where FieldTrialHub differs from an R package on purpose

In these cases FieldTrialHub deliberately does not copy the output of an R package, because the package uses a different convention or contains an error. The comparisons above use the corrected or documented reference in each case.

Examples

A few values from the test runs, as computed on the website and in R, rounded for display. Where the last digit differs (SCA below), the full-precision values agree to about 10−15; see Rounded display, full-precision comparison above.

Split-plot (agricolae plots data, Tukey)

ValueFieldTrialHubR
F, main plot A0.10810.1081
F, subplot B3.45813.4581
F, A × B34.890334.8903
p, A × B0.00011190.0001119
CV(a) %24.814424.8144
CV(b) %35.913235.9132

Augmented RCBD (DAU.test example data)

ValueFieldTrialHubR
Treatments adjusted, SS285.09524285.09524
Adjusted mean, entry g73.2500073.25000
Adjusted mean, entry h93.5000093.50000
SE, test entry5.609605.60960
SE of difference, test vs check6.360696.36069

Alpha-lattice (simulated, 30 genotypes, 3 replications)

ValueFieldTrialHubR
Genotypes adjusted, F4.259204.25920
Blocks adjusted, F8.587748.58774
Adjusted mean, G016.045066.04506
SE, G010.222230.22223
Average SE of difference0.321700.32170
Efficiency vs RCBD %222.75903222.75903

Line × tester (agricolae heterosis data)

ValueFieldTrialHubR
Lines, F3.63163.6316
Lines × testers, F7.38927.3892
GCA, line TPS-250.41430.4143
SCA, LT-8 × TPS-670.51870.5188
Cov H.S. (average)0.003870.00387
σ²D, F = 00.112820.11282

Multi-location (agricolae plrv data, 6 environments)

ValueFieldTrialHubR
Environments, F257.03818257.03818
G × E, F4.753074.75307
Bartlett χ²83.0541183.05411
AMMI PC1, % of G × E56.2608856.26088
Stability b, genotype 102.180.707690.70769

Test data

The simulated test datasets can be downloaded and analysed in R: fieldtrialhub-validation-data.zip. The other test datasets are the example data of the agricolae package (plots, heterosis, plrv and the DAU.test example), which you can load in R with data().

Found a result that does not match R? Please tell us with the data and the R code.