Problem 1: Regression Model

Use the dataset on weaning weight and fit a regression model of weaning weight on breast circumference. The following tasks are to be completed.

The data set is available from

https://charlotte-ngs.github.io/lbgfs2022/data/beef_data_bc.csv 

Your Solution

  • Regression model in matrix-vector notation: define the vectors and matrices required in the model
  • Read the data into a tibble/data_frame
  • Put information from dataset into the model
  • Compute solution for regression coefficient estimate
  • Use R to verify

Problem 2: Fixed Linear Effects Model

Use the same dataset as in Problem 1 and fit a fixed linear effects model using breast circumference and herd as fixed effects in a model. Use the same path to get to the solution as in Problem 1 and complete the same set of tasks.

Your Solution


Latest Changes: 2022-10-28 08:29:38 (pvr)

LS0tCnRpdGxlOiBMaXZlc3RvY2sgQnJlZWRpbmcgYW5kIEdlbm9taWNzIC0gTm90ZWJvb2sgNgphdXRob3I6IFBldGVyIHZvbiBSb2hyCmRhdGU6ICcyMDIyLTEwLTI4JwpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sKcGFyYW1zOgogIGRvY3R5cGU6CiAgICBsYWJlbDogRG9jdW1lbnQgVHlwZQogICAgdmFsdWU6IHNvbHV0aW9uCiAgICBjaG9pY2VzOgogICAgLSBleGVyY2lzZQogICAgLSBzb2x1dGlvbgogICAgLSBub3RlYm9vawogIGlzb25saW5lOgogICAgbGFiZWw6IE9ubGluZSAoeS9uKQogICAgdmFsdWU6IHRydWUKICAgIGNob2ljZXM6CiAgICAtIHRydWUKICAgIC0gZmFsc2UKLS0tCgoKCmBgYHtyIHNldHVwLCBpbmNsdWRlPUZBTFNFfQprbml0cjo6b3B0c19jaHVuayRzZXQoZWNobyA9IFRSVUUpCmBgYAoKCiMjIFByb2JsZW0gMTogUmVncmVzc2lvbiBNb2RlbApgYGB7ciBsMDZwcm9iMDEtc2V0dXAsIGVjaG89RkFMU0V9CmlmIChwYXJhbXMkaXNvbmxpbmUpewogIHNfZGF0YV9wYXRoIDwtICJodHRwczovL2NoYXJsb3R0ZS1uZ3MuZ2l0aHViLmlvL2xiZ2ZzMjAyMi9kYXRhL2Jl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