data(DT_technow)
DT <- DT_technow
Md <- Md_technow
M <- tcrossprod(Md)
Z = with(DT, redmm(x=dent, M=M, nPC=10))
custom <- (rep(colnames(Z), nrow(DT)))[1:nrow(DT)]
ans <- lmebreed(GY ~ (1|custom),
addmat = list(custom=Z),
data=DT)
vc <- VarCorr(ans); print(vc,comp=c("Variance"))
xx <- with(DT, redmm(x=dent, M=M, nPC=10, returnLam = TRUE))
u = tcrossprod(xx$Lam, t(as.matrix( ranef(ans)[[1]] ) ))
Run the code above in your browser using DataLab