# ####=========================================####
# #### For CRAN time limitations most lines in the
# #### examples are silenced with one '#' mark,
# #### remove them and run the examples
# ####=========================================####
# ####=========================================####
# ####=========================================####
# #### EXAMPLE 1
# #### simple example
# ####=========================================####
# ####=========================================####
# data(DT_btdata)
# DT <- DT_btdata
# head(DT)
# mix4 <- mmer(tarsus ~ sex,
# random = ~ dam + fosternest,
# rcov=~units,
# data = DT)
# summary(mix4)$varcomp
#
# mix5 <- mmec(tarsus ~ sex,
# random = ~ dam + fosternest,
# rcov=~units,
# data = DT)
# summary(mix5)$varcomp
#
# ####=========================================####
# ####=========================================####
# ####=========================================####
# #### EXAMPLE 2
# #### more complex multivariate model
# ####=========================================####
# ####=========================================####
# data(DT_btdata)
# DT <- DT_btdata
# mix3 <- mmer(cbind(tarsus, back) ~ sex,
# random = ~ vsr(dam) + vsr(fosternest),
# rcov= ~ vsr(units, Gtc=diag(2)),
# data = DT)
# summary(mix3)
# #### calculate the genetic correlation
# cov2cor(mix3$sigma$`u:dam`)
# cov2cor(mix3$sigma$`u:fosternest`)
Run the code above in your browser using DataLab