knitr::opts_chunk$set(echo = FALSE)
# rmdhelp::show_knit_hook_call()
knitr::knit_hooks$set(hook_convert_odg = rmdhelp::hook_convert_odg)

Why

\begin{align} E(\text{BW Angus}) &= b_0 + b_1 \notag \ E(\text{BW Limousin}) &= b_0 + 2b_1 \notag \ E(\text{BW Simmental}) &= b_0 + 3b_1 \notag \end{align}

Linear Regression in Genomic Analysis

Single Locus Model

#rmdhelp::use_odg_graphic(ps_path = "odg/single-locus-model.odg")
knitr::include_graphics(path = "odg/single-locus-model.png")

Modified Single Locus Model

#rmdhelp::use_odg_graphic(ps_path = "odg/mod-slm.odg")
knitr::include_graphics(path = "odg/mod-slm.png")

Relationships

\begin{align} E(G_2G_2) &= b_0 + 0 * b_1 \notag \ E(G_1G_2) &= b_0 + 1 * b_1 \notag \ E(G_1G_1) &= b_0 + 2 * b_1 \notag \end{align}

$$E(G_1G_2) - E(G_2G_2) = E(G_1G_1) - E(G_1G_2) = b_1$$ $$E(G_1G_1) - E(G_2G_2) = 2b_1$$

Example Dataset

Regression On Dummy Variables

Levels To Independent Variables

Use "separate" $x$-variable for each level, hence each of the breeds

s_data_dir <- file.path(here::here(), "docs", "data")
s_flem_path <- file.path(s_data_dir, "asm_bw_flem.csv")
tbl_flem <- readr::read_csv(file = s_flem_path)
tbl_breed_assign <- tibble::tibble(Breed = c(unique(sort(tbl_flem$Breed))),
                                   `Independent Variable`= c("$x_1$", "$x_2$", "$x_3$"))

knitr::kable(tbl_breed_assign,
             booktabs = TRUE,
             longtable = TRUE,
             escape = FALSE)

Model

\begin{align} y_{11} &= b_0 + b_1 * 1 + b_2 * 0 + b_3 * 0 + e_{11} \notag \ y_{12} &= b_0 + b_1 * 1 + b_2 * 0 + b_3 * 0 + e_{12} \notag \ \cdots &= \cdots \notag \ y_{33} &= b_0 + b_1 * 0 + b_2 * 0 + b_3 * 1 + e_{33} \notag \end{align}

Matrix - Vector Notation

\begin{equation} \mathbf{y} = \mathbf{X}\mathbf{b} + \mathbf{e} \notag \end{equation}



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