Problem 1: Milk Dataset

Use the dataset milk from package pedigreemm and fit a sire model to each of the response variables (milk, fat, prot and scs) in the data. The dataset can be loaded using the command pedigreemm::milk. The other variables like lact and herd can be used as fixed effects. The sire column is used as a random effect. For this analysis, we assume that sires are unrelated.

Your Tasks

  • Analyse the milk dataset from package pedigreemm using the function lme4::lmer() for all given response variables. You can use the same model for each of the responses.
  • Compute the estimated heritability for each response variable, using the fact that the heritability \(h^2\) can be computed from the variance \(\sigma_s^2\) of the sire effects and the phenotypic variance \(\sigma_p^2\) with the formula

\[h^2 = \frac{4* \sigma_s^2}{\sigma_p^2} \]

  • Compute the summary statistic using the function summary() of all the predicted sire breeding values. Solutions for the sire breeding values are obtained using the function ranef()

Your Solution

  • Assign milk dataset to a tibble
  • Analyse the data for each of the responses
  • Compute estimated heritability
  • Obtain summary statistics for predicted sire breeding values

Latest Changes: 2022-05-06 07:35:37 (pvr)

LS0tCnRpdGxlOiBBcHBsaWVkIFN0YXRpc3RpY2FsIE1ldGhvZHMgLSBOb3RlYm9vayA5CmF1dGhvcjogUGV0ZXIgdm9uIFJvaHIKZGF0ZTogJzIwMjItMDUtMDInCm91dHB1dDogaHRtbF9ub3RlYm9vawpwYXJhbXM6CiAgZG9jdHlwZToKICAgIGxhYmVsOiBEb2N1bWVudCBUeXBlCiAgICB2YWx1ZTogc29sdXRpb24KICAgIGNob2ljZXM6CiAgICAtIGV4ZXJjaXNlCiAgICAtIHNvbHV0aW9uCiAgICAtIG5vdGVib29rCiAgaXNvbmxpbmU6CiAgICBsYWJlbDogT25saW5lICh5L24pCiAgICB2YWx1ZTogdHJ1ZQogICAgY2hvaWNlczoKICAgIC0gdHJ1ZQogICAgLSBmYWxzZQotLS0KCgoKYGBge3Igc2V0dXAsIGluY2x1ZGU9RkFMU0V9CmtuaXRyOjpvcHRzX2NodW5rJHNldChlY2hvID0gVFJVRSkKYGBgCgoKIyMgUHJvYmxlbSAxOiBNaWxrIERhdGFzZXQKVXNlIHRoZSBkYXRhc2V0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