# ####=========================================####
# #### 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 <- mmes(tarsus ~ sex,
# random = ~ dam + fosternest,
# rcov=~units,
# data = DT)
# summary(mix4)$varcomp
# MULTI-TRAIT EXAMPLE
# head(DT)
# DT2 <- stackTrait(DT, traits = c("tarsus","back"))
# head(DT2$long)
# DT2$long=DT2$long[with(DT2$long, order(trait)), ]
#
# mix3 <- mmes(valueS ~ trait:sex - 1, henderson=TRUE,
# random = ~ vsm(usm(trait),ism(dam)) +
# vsm(usm(trait), ism(fosternest)),
# rcov= ~ vsm(dsm(trait),ism(units)),
# data = DT2$long)
#
#
# summary(mix3)$varcomp
# #### calculate the genetic correlation
# cov2cor(mix3$theta[[1]])
# cov2cor(mix3$theta[[2]])
Run the code above in your browser using DataLab