knitr::opts_chunk$set(echo = TRUE)
if (params$isonline){
  s_ex07p01_path <- "https://charlotte-ngs.github.io/asmss2022/data/asm_bw_mod_sel.csv" 
} else {
  s_ex07p01_path <- file.path(here::here(), "docs", "data", "asm_bw_mod_sel.csv")
}

Problem 1: Model Selection

Given is a dataset with body weight as a response and different other variables and factors. The columns Breed and BCS (Body Condition Score) are taken as factors. All other columns are taken as predictor variables. The column Animal is not used in any model. Use model selection to find the relevant predictor variables and factors for the best linear fixed effect model. Use the estimated mean square error $C_p$ as a quality measure for a single linear model. The dataset to be analysed can be obtained from

cat(s_ex07p01_path, "\n")

Your Tasks

Your Solution

Because, we need the residual standard deviation of the full model and backward elimination starts with the full model, we start with backward elimination

Start with Backward Elimination

Forward Selection

Problem 2: Verification of Model Selection Results

Use the R-package olsrr to verify the results of Problem 1. Have a look at the documentation of olsrr at https://github.com/rsquaredacademy/olsrr. In a first step, we are going to read the data from

if (params$isonline){
  s_ex07p02_path <- "https://charlotte-ngs.github.io/asmss2022/data/asm_bw_mod_sel.csv" 
} else {
  s_ex07p02_path <- file.path(here::here(), "docs", "data", "asm_bw_mod_sel.csv")
}
cat(s_ex07p02_path, "\n")

Your Solution

cat('\n---\n\n _Latest Changes: ', format(Sys.time(), '%Y-%m-%d %H:%M:%S'), ' (', Sys.info()['user'], ')_\n', sep = '')


charlotte-ngs/asmss2022 documentation built on June 7, 2022, 1:33 p.m.