forked from Pakillo/LM-GLM-GLMM-intro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGLMs2pdf.Rmd
124 lines (76 loc) · 2.19 KB
/
GLMs2pdf.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
title: "Linear, Generalized, and Mixed/Multilevel models in R"
author: "Francisco Rodríguez-Sánchez"
date: "https://frodriguezsanchez.net"
aspectratio: 43 # use 169 for wide format
fontsize: 10pt
output:
binb::metropolis:
keep_tex: no
incremental: yes
fig_caption: no
pandoc_args: ["--lua-filter=hideslide.lua"]
urlcolor: blue
linkcolor: blue
header-includes:
- \definecolor{shadecolor}{RGB}{230,230,230}
# - \setbeamercolor{frametitle}{bg=black}
---
```{r knitr_setup, include=FALSE, cache=FALSE}
library("knitr")
### Chunk options ###
## Text results
opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE, size = 'tiny')
## Code decoration
opts_chunk$set(tidy = FALSE, comment = NA, highlight = TRUE, prompt = FALSE, crop = TRUE)
# ## Cache
# opts_chunk$set(cache = TRUE, cache.path = "knitr_output/cache/")
# ## Plots
# opts_chunk$set(fig.path = "knitr_output/figures/")
opts_chunk$set(fig.align = 'center', out.width = '90%')
### Hooks ###
## Crop plot margins
knit_hooks$set(crop = hook_pdfcrop)
## Reduce font size
## use tinycode = TRUE as chunk option to reduce code font size
# see http://stackoverflow.com/a/39961605
knit_hooks$set(tinycode = function(before, options, envir) {
if (before) return(paste0("\n \\", options$size, "\n\n"))
else return("\n\n \\normalsize \n")
})
```
# GLM as unified framework for data analysis
```{r child = 'framework.Rmd'}
```
# Introduction to linear models
```{r child = 'lm_intro.Rmd'}
```
# Linear models
```{r child = 'lm.Rmd'}
```
# Variable and model selection
```{r child = 'model_selection.Rmd'}
```
# Model comparison
```{r child = 'model_comparison_trees.Rmd'}
```
# Generalised Linear Models
# Binomial GLM (logistic regression)
```{r child = 'glm_binomial.Rmd'}
```
# GLM for count data: Poisson regression
```{r child = 'glm_count.Rmd'}
```
# Modelling zero-inflated count data
```{r child = 'glm_count_zeroinfl.Rmd'}
```
# Mixed / Multilevel models
```{r child = 'mixed_models.Rmd'}
```
-----
```{r echo=FALSE, out.width="100%"}
knitr::include_graphics("images/flowchart.png")
```
## END
![](images/CClogo.png)
Source code and materials: https://github.com/Pakillo/LM-GLM-GLMM-intro