## AUGMENTED DESIGN EXAMPLE
data(DT_augment)
DT <- DT_augment
head(DT)
# \donttest{
############## sommer ##################
if(requireNamespace("sommer")){
library(sommer)
mix1 <- mmes(TSW ~ Check.Gen,
random = ~ Block + Genotype:Check,
data=DT)
summary(mix1)$varcomp
}
############## lme4breeding ##################
if(requireNamespace("lme4breeding")){
library(lme4breeding)
## fit the mixed model and check summary
mix <- lmeb(TSW ~ Check.Gen + (1|Block) + (1|Genotype:Check),
data=DT)
vc <- VarCorr(mix); print(vc,comp=c("Variance"))
sigma(mix)^2 # error variance
BLUP <- ranef(mix, condVar=TRUE)
condVAR <- lapply(BLUP, function(x){attr(x, which="postVar")}) # take sqrt() for SEs
}
############## end ##################
# }
Run the code above in your browser using DataLab