-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathindex.Rmd
87 lines (76 loc) · 2.14 KB
/
index.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
---
title: Mixed Models with R
subtitle: Getting started with random effects
author: |
<span class="noem">Michael Clark</span> <br>
[m-clark.github.io](https://m-clark.github.io/)
# date: "`r Sys.Date()`"
site: bookdown::bookdown_site
output:
bookdown::gitbook:
anchor_sections: FALSE
documentclass: book
bibliography: refs.bib
biblio-style: apalike
always_allow_html: true
link-citations: yes
description: "This is an introduction to using mixed models in R. It covers the most common techniques employed, with demonstration primarily via the lme4 package. Discussion includes extensions into generalized mixed models, Bayesian approaches, and realms beyond."
cover-image: 'img/nineteeneightyR.png'
favicon: 'img/R.ico'
url: 'https\://m-clark.github.io/mixed-models-with-R/' # evidently the \: is required or you'll get text in the title/toc area
github-repo: 'm-clark/mixed-models-with-R/'
---
```{r chunk_setup, include=FALSE, eval=TRUE}
knitr::opts_chunk$set(
# code
echo = T,
message = F,
warning = F,
error = F,
comment = NA,
R.options = list(width = 220),
# viz
dev.args = list(bg = 'transparent'),
dev = 'svglite',
fig.align = 'center',
out.width = '75%',
fig.asp = .75,
# cache
cache.rebuild = F,
cache = T
)
options(knitr.kable.NA = '')
```
```{r load_common_packages, echo=FALSE, cache=FALSE, eval=TRUE}
library(visibly)
library(htmltools)
library(forcats)
library(lme4)
library(broom)
library(broom.mixed)
library(mixedup)
library(plotly)
library(tidyverse)
library(kableExtra)
library(patchwork)
kable_df = function(data, digits=3, ...) {
kableExtra::kable(
data,
digits = digits,
format = 'html',
booktabs = T,
# longtable = F,
linesep = "",
...,
) %>%
kableExtra::kable_styling(full_width = F)
}
perc = function(x, digits = 1) paste0(tidyext::rnd(x*100, digits = digits), '%')
```
####
```{r rimg, fig.align='center', out.width=200, echo=FALSE, cache=FALSE}
knitr::include_graphics('img/198R.png', dpi = NA)
```
```{r ccimg, fig.align='center', out.width=0, fig.show='hide', echo=FALSE}
knitr::include_graphics('img/mc_logo.png', dpi = NA)
```