info$varDF not equal to 5.
1/1 mismatches
[1] 4 - 5 == -1

cat("#### Test for wheat76 example with asreml42\n")
## use asremlPlus to analyse the wheat (barley) example from section 8.6 of the asreml manual (Butler et al. 2010)
current.asr <- asreml(yield ~ Rep + WithinColPairs + Variety,
# Load current fit into an asrtests object
current.asrt <- as.asrtests(current.asr, NULL, NULL,
label = "Maximal model", IClikelihood = "full")
# Check for and remove any boundary terms
current.asrt <- rmboundary(current.asrt, IClikelihood = "full")
current.asrt <- testranfix(current.asrt, term = "WithinColPairs",
current.asrt <- testranfix(current.asrt, "units", positive=TRUE, IClikelihood = "full")
current.asrt <- testresidual(current.asrt, "~ Row:ar1(Column)",
# Test Col autocorrelation (depends on whether Row autocorrelation retained)
p <- getTestPvalue(current.asrt, label = "Row autocorrelation")
current.asrt <- testresidual(current.asrt, "~ ar1(Row):Column",
current.asrt <- testresidual(current.asrt, "~ Row:Column",
# Do residuals-versus-fitted values plot
#Produce variogram and variogram faces plot (Stefanaova et al, 2009)
faces <- variofaces(current.asr, V=V, maxit=50, units="addtores",
#Get Variety predictions and all pairwise prediction differences and p-values
Var.diffs <- predictPlus(classify = "Variety",
testthat::expect_silent(plotPvalues(Var.diffs, show.sig = TRUE, alpha = 0.05))
diffs <- predictPlus(classify = "Variety",
cat("#### Test for wheat76 example using AIC with asreml42\n")
## The AIC is used in asremlPlus-package.RD
current.asrt <- changeModelOnIC(current.asrt, addRandom = "units",
current.asrt <- changeModelOnIC(current.asrt, newResidual = "Row:ar1(Column)",
result <- getTestEntry(current.asrt, label = "Row autocorrelation")$action
if (grepl("Unswapped", result) || grepl("Unchanged", result))
current.asrt <- changeModelOnIC(current.asrt, newResidual = "ar1(Row):Column",
current.asrt <- changeModelOnIC(current.asrt, newResidual = "Row:Column",
cat("#### Test for wheat76 addtoSummary with asreml42\n")
list(yield ~ Rep + WithinColPairs + Variety,
ar1.asrt <- as.asrtests(ar1.asr, NULL, NULL,
cColumn <- cColumn - mean(unique(cColumn))
list(yield ~ Rep + cRow + cColumn + WithinColPairs +
ts.asrt <- as.asrtests(ts.asr, NULL, NULL,