Problem 1: Sire Model
Use the following dataset to predict breeding values using a sire
model. The dataset is available from
https://charlotte-ngs.github.io/asmss2023/data/asm_ped_sim_data.csv
Hints
- The variance component \(\sigma_s^2\) of the sire effect can be
assumed to be \(2.25\).
- The variance component \(\sigma_e^2\) of the random resiudals is
\(36\).
- Sex is modelled as a fixed effect.
- The sire pedigree relationship can be computed using the
pedigreemm
package.
Your Solution
Read the data
Compute the inverse sire relationship matrix
Setup the mixed model equations
Solve mixed model equations
Problem 2: Animal Model
Use the same dataset as in Problem 1 to predict breeding values, but
use an animal model instead of a sire model. The dataset is available
from
https://charlotte-ngs.github.io/asmss2023/data/asm_ped_sim_data.csv
Hints
- The variance component \(\sigma_u^2\) of the breeding value can be
assumed to be \(9\).
- The variance component \(\sigma_e^2\) of the random resiudals is
\(36\).
- Sex is modelled as a fixed effect.
- The numerator relationship matrix can be computed using the
pedigreemm
package.
Your Solution
Read the data
Compute the inverse sire relationship matrix
Setup the mixed model equations
Solve mixed model equations
Problem 3: Model Comparison
Compare the order of the predicted breeding values for the sires from
the sire model and from the animal model.
Your Solution
- Compare both ordered vectors of predicted breeding values
Latest Changes: 2023-05-14 09:02:31 (pvr)
LS0tCnRpdGxlOiBBcHBsaWVkIFN0YXRpc3RpY2FsIE1ldGhvZHMgLSBOb3RlYm9vayA2CmF1dGhvcjogUGV0ZXIgdm9uIFJvaHIKZGF0ZTogJzIwMjMtMDUtMTQnCm91dHB1dDogaHRtbF9ub3RlYm9vawpwYXJhbXM6CiAgZG9jdHlwZToKICAgIGxhYmVsOiBEb2N1bWVudCBUeXBlCiAgICB2YWx1ZTogc29sdXRpb24KICAgIGNob2ljZXM6CiAgICAtIGV4ZXJjaXNlCiAgICAtIHNvbHV0aW9uCiAgICAtIG5vdGVib29rCiAgaXNvbmxpbmU6CiAgICBsYWJlbDogT25saW5lICh5L24pCiAgICB2YWx1ZTogdHJ1ZQogICAgY2hvaWNlczoKICAgIC0gdHJ1ZQogICAgLSBmYWxzZQotLS0KCgoK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