# NOT RUN {
data(Wheat.dat)
current.asr <- asreml(yield ~ Rep + WithinColPairs + Variety,
random = ~ Row + Column + units,
residual = ~ ar1(Row):ar1(Column),
data=Wheat.dat)
current.asrt <- as.asrtests(current.asr, NULL, NULL,
label = "Maximal model")
current.asrt <- rmboundary(current.asrt)
# Drop both Row and Column terms
current.asrt <- changeModelOnIC(current.asrt,
dropRandom = "Row + Column",
checkboundaryonly = TRUE,
which.IC = "AIC", IClikelihood = "full")
current.asrt <- iterate(current.asrt)
# Add and drop both fixed and random terms
current.asrt <- changeModelOnIC(current.asrt,
addFixed = "vRow", dropFixed = "WithinColPairs",
addRandom = "spl(vRow)", dropRandom = "units",
checkboundaryonly = TRUE,
which.IC = "AIC", IClikelihood = "full")
# Replace residual with model without Row autocorrelation
current.asrt <- changeModelOnIC(current.asrt,
newResidual = "Row:ar1(Column)",
label="Row autocorrelation",
IClikelihood = "full")
# }
Run the code above in your browser using DataLab