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") }
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")
Because, we need the residual standard deviation of the full model and backward elimination starts with the full model, we start with backward elimination
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")
ols_step_best_subset
cat('\n---\n\n _Latest Changes: ', format(Sys.time(), '%Y-%m-%d %H:%M:%S'), ' (', Sys.info()['user'], ')_\n', sep = '')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.