Read the data into R

tbl_data_beef <- readr::read_csv(file = s_data_url)
Rows: 16 Columns: 5
── Column specification ────────────────────────────────────────────────────────────────────────────────────────────────────────────
Delimiter: ","
dbl (5): Animal, Sire, Dam, Herd, Weaning Weight

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
tbl_data_beef

Mixed Linear Effect Model

Animal model

\[y = X\beta + Zu + e\] ### Observations

vec_y <- tbl_data_beef$`Weaning Weight`
vec_y
 [1] 2.61 2.31 2.44 2.41 2.51 2.55 2.14 2.61 2.34 1.99 3.10 2.81 2.14 2.41 2.54 3.16

Design Matrices

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
      [,1] [,2]
 [1,]    1    0
 [2,]    1    0
 [3,]    1    0
 [4,]    1    0
 [5,]    0    1
 [6,]    0    1
 [7,]    0    1
 [8,]    0    1
 [9,]    1    0
[10,]    1    0
[11,]    1    0
[12,]    1    0
[13,]    0    1
[14,]    0    1
[15,]    0    1
[16,]    0    1
tbl_data_beef$Herd
 [1] 1 1 1 1 2 2 2 2 1 1 1 1 2 2 2 2
mat_Z <- matrix(data = c(), ncol=27, byrow = TRUE)
Error in matrix(data = c(), ncol = 27, byrow = TRUE) : 
  'data' must be of a vector type, was 'NULL'

Inverse Numerator Relationship Matrix

Solving MME

Solutions for Fixed Effecs and Breeding Values

LS0tCnRpdGxlOiAiQkxVUCBBbmltYWwgTW9kZWwiCm91dHB1dDogaHRtbF9ub3RlYm9vawotLS0KCmBgYHtyIHByb2IxLWluaXQsIGVjaG89RkFMU0UsIG1lc3NhZ2U9RkFMU0UsIHdhcm5pbmc9RkFMU0V9CnNfZGF0YV91cmwgPC0gImh0dHBzOi8vY2hhcmxvdHRlLW5ncy5naXRodWIuaW8vbGJnZnMyMDIxL2RhdGEvYmVlZl9kYXRhX2JsdXAuY3N2IgpgYGAKClJlYWQgdGhlIGRhdGEgaW50byBSCgpgYGB7cn0KdGJsX2RhdGFfYmVlZiA8LSByZWFkcjo6cmVhZF9jc3YoZmlsZSA9IHNfZGF0YV91cmwpCnRibF9kYXRhX2JlZWYKYGBgCgojIyBNaXhlZCBMaW5lYXIgRWZmZWN0IE1vZGVsCkFuaW1hbCBtb2RlbAoKJCR5ID0gWFxiZXRhICsgWnUgKyBlJCQKIyMjIE9ic2VydmF0aW9ucwoKYGBge3J9CnZlY195IDwtIHRibF9kYXRhX2JlZWYkYFdlYW5pbmcgV2VpZ2h0YAp2ZWNfeQpgYGAKCgojIyMgRGVzaWduIE1hdHJpY2VzCgoKYGBge3J9Cm1hdF9YIDwtIG1hdHJpeChkYXRhID0gYygxLCAwLAogICAgICAgICAgICAgICAgICAgICAgICAgMSwgMCwKICAgICAgICAgICAgICAgICAgICAgICAgIDEsIDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAxLCAwLAogICAgICAgICAgICAgICAgICAgICAgICAgMCwgMSwKICAgICAgICAgICAgICAgICAgICAgICAgIDAsIDEsCiAgICAgICAgICAgICAgICAgICAgICAgICAwLCAxLAogICAgICAgICAgICAgICAgICAgICAgICAgMCwgMSwKICAgICAgICAgICAgICAgICAgICAgICAgIDEsIDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAxLCAwLAogICAgICAgICAgICAgICAgICAgICAgICAgMSwgMCwKICAgICAgICAgICAgICAgICAgICAgICAgIDEsIDAsCiAgICAgICAgICAgICAgICAgICAgICAgICAwLCAxLAogICAgICAgICAgICAgICAgICAgICAgICAgMCwgMSwKICAgICAgICAgICAgICAgICAgICAgICAgIDAsIDEsCiAgICAgICAgICAgICAgICAgICAgICAgICAwLCAxKSwgbmNvbCA9IDIsIGJ5cm93ID0gVFJVRSkKbWF0X1gKYGBgCgoKYGBge3J9CnRibF9kYXR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