data(DT_big)
DT = DT_big
M = apply(M_big,2,as.numeric)
rownames(M) <- rownames(M_big)
# \donttest{
# compute the relationship matrix
MMT <- tcrossprod(M)
m <- sum(diag(MMT))/nrow(MMT)
MMT <- MMT/m
MMT <- MMT + diag(1e-05, ncol(MMT), ncol(MMT))
# let's fit the GxE model (diagonal first)
DT[,"envf_repf"] = paste(DT[,"envf"],DT[,"repf"],sep="_")
# fit the models
mixm2 <- lmebreed(value ~ (1|envf_repf) + (0+envf_repf||id),
data = DT,
relmat = list(id = MMT),
control = lmerControl(
restart_edge = FALSE
), nIters=1000,
verbose=1L, rotation=TRUE
)
vc <- VarCorr(mixm2); print(vc,comp=c("Variance"))
ran2 = ranef(mixm2, condVar=FALSE)
H0 <- ran2$id
# }
Run the code above in your browser using DataLab