####=========================================####
#### For CRAN time limitations most lines in the
#### examples are silenced with one '#' mark,
#### remove them and run the examples using
#### command + shift + C |OR| control + shift + C
####=========================================####
data(DT_technow)
DT <- DT_technow
Md <- Md_technow
Mf <- Mf_technow
# Md <- (Md*2) - 1
# Mf <- (Mf*2) - 1
# Ad <- A.mat(Md)
# Af <- A.mat(Mf)
# ###=========================================####
# ###=========================================####
# ans2 <- mmer(GY~1,
# random=~vsr(dent,Gu=Ad) + vsr(flint,Gu=Af),
# rcov=~units,
# data=DT)
# summary(ans2)$varcomp
#
# Adi <- as(solve(Ad + diag(1e-4,ncol(Ad),ncol(Ad))), Class="dgCMatrix")
# Afi <- as(solve(Af + diag(1e-4,ncol(Af),ncol(Af))), Class="dgCMatrix")
# ans2b <- mmec(GY~1,
# random=~vsc(isc(dent),Gu=Adi) + vsc(isc(flint),Gu=Afi),
# rcov=~units,
# data=DT)
# summary(ans2b)$varcomp
# ####=========================================####
# #### multivariate overlayed model
# ####=========================================####
# M <- rbind(Md,Mf)
# A <- A.mat(M)
# ans3 <- mmer(cbind(GY,GM)~1,
# random=~vsr(overlay(dent,flint),Gu=A),
# rcov=~vsr(units,Gtc=diag(2)),
# data=DT)
# summary(ans2)
# cov2cor(ans3$sigma[[1]])
Run the code above in your browser using DataLab