s_data_url <- "https://charlotte-ngs.github.io/lbgfs2021/data/beef_data_blup.csv"
Read the data into R
tbl_data_beef <- readr::read_csv(file = s_data_url) tbl_data_beef
Animal model
$$y = X\beta + Zu + e$$
vec_y <- tbl_data_beef$`Weaning Weight` vec_y
mat_X <- matrix(data = c(1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1), ncol = 2, byrow = TRUE) mat_X
tbl_data_beef$Herd
mat_Z <- matrix(data = c(), ncol=27, byrow = TRUE) mat_Z
ped <- pedigreemm::pedigree(sire = c(), dam = c(), label = as.character(1:27)) Ainv <- as.matrix(pedigreemm::getAInv(ped = ped))
lambda <- 1 mat_xtx <- t(mat_X) %*% mat_X mat_xtx
mat_xtx <- crossprod(mat_X) mat_xtx
mat_xtz <- crossprod(mat_X,mat_Z) mat_xtz
mat_ztx <- crossprod(mat_Z,mat_X) mat_ztx <- t(mat_xtz) mat_ztx
mat_ztz <- crossprod(mat_Z) mat_ztz
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.