-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotes-Schad-et-al-2020.Rmd
256 lines (209 loc) · 6.45 KB
/
Notes-Schad-et-al-2020.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
---
title: "Schad et al (2020)に学ぶ名義尺度のコーディング"
subtitle: "Schad et al (2020)日本語注解"
author: "小川雅貴"
institute: "東京大学"
date: "2021/12/17 (updated: `r Sys.Date()`)"
output:
#revealjs::revealjs_presentation:
# theme: "night"
xaringan::moon_reader:
lib_dir: libs
# css: [default, hygge, ninjutsu]
# css: [default, hygge, ninjutsu, robot-fonts]
# css: [ninjutsu]
css:
- default
- hygge
- ninjutsu
- robot
- "assets/fonts.css"
nature:
ratio: 16:9
highlightStyle: github
#highlightStyle: magula
highlightLanguage: r
highlightLines: true
highlightSpans: false
countIncrementalSlides: false
slideNumberFormat: '%current%/%total%'
navigation:
scroll: false
touch: true
click: false
includes:
after_body: doc-creation/assets/remarkjs_extended.html
pdflink: "https://htmlpreview.github.io/?https://github.com/CLRafaelR/factor_coding/blob/main/Notes-Schad-et-al-2020.html"
---
```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
knitr::opts_chunk$set(
#include = FALSE,
fig.path = "figures/",
fig.width = 8, #6
fig.height = 6, #4
fig.align = "center",
fig.retina = 2,
echo = TRUE,
warning = FALSE,
message = FALSE,
comment = "",
cache = FALSE,
#cache.extra = knitr::rand_seed,
#set.seed(2021),
cache.path = "cache/",
dev.args = list(family = "Roboto Medium"),
dev = "CairoPNG",
fig.path = 'figures/Notes-Schad-etal-2020-'
)
library(flipbookr)
```
class: middle center hide-slide-number
```{r, include = FALSE, cache = FALSE}
basename <- ifelse(
exists("basename"),
basename,
"slide"
)
```
.info-box.w-50.bg-white.f3[
このHTMLスライドをご覧になる際は,
ChromeまたはFirefoxをお使いになることをお勧めいたします。
また,HTMLスライドの中身が正しく読み込まれない場合には,
ブラウザの更新ボタンを押して,再度スライドを読み込んでください。
なお,本スライドのPDF版は
<a href=`r rmarkdown::metadata$pdflink`>こちら<i class="fas fa-file-pdf"></i></a>
にございます。
]
<br>
.white[**右矢印➝**を押すと次のスライドに移ります]
---
class: inverse, middle, center
# 必要なパッケージ・関数の読み込み
<!-- get a flipbook version of the my_cars code chunk - pauses are where parentheses are balanced -->
---
`r chunk_reveal("load-packages-sources", display_type = c("code", "md"), md = c("次のパッケージ群を呼び出す \n- **ggplot2**: データ可視化・図生成 \n- **dplyr**: データ操作 \n- **tidyr**: データ整然化 \n- **readr**: データ読み込み \n- **purrr**: 関数型プログラミング \n- **tibble**: 現代的データフレームtibbles \n- **stringr**: 文字列処理 \n- **forcats**: カテゴリ変数の操作", "統計モデルの解析結果をtibbleで表示", "一般化線形混合モデルの構築", "対比行列の構築", "「仮説」行列の構築", "Rでの動的文書生成", "mixedDesign()の読み込み \n \nRmarkdownをknitする際には,**source()**の項で**local = knitr::knit_global()**を指定する \nhttps://bookdown.org/yihui/rmarkdown-cookbook/source-script.html", "Schad et al (2020)の元コードは[こちら](http://read.psych.uni-potsdam.de/pmr2/attachments/article/188/SchadEtAlJML2019.R)", "乱数の固定", "指数表記の回避・有効数字2桁に設定"))`
<!--
Rmarkdownをknitする際には,\`source()\`の項\`local = knitr::knit_global()\`を指定する"
-->
```{r load-packages-sources, include = FALSE, eval = TRUE, cache = FALSE}
library(tidyverse)
library(broom)
library(lme4)
library(MASS)
library(hypr)
library(knitr)
source(
"http://read.psych.uni-potsdam.de/attachments/article/188/mixedDesign.v0.6.3.R",
local = knitr::knit_global()
)
#source("http://read.psych.uni-potsdam.de/pmr2/attachments/article/188/SchadEtAlJML2019.R")
set.seed(1212)
options(
scipen = 999,
digits = 2
)
```
```{r ggplot2-theme-settings, echo = FALSE, eval = TRUE, cache = FALSE}
theme_set(
theme_bw() +
theme(
#legend.position = "top",
legend.text = element_text(size = 12),
legend.title = element_text(size = 16),
axis.title.x = element_text(
vjust = 0.5,
size = 16,
margin = margin(
t = 10,
r = 0,
b = 0,
l = 0
)
),
axis.title.y = element_text(
vjust = 0.5,
size = 16,
margin = margin(
t = 0,
r = 10,
b = 0,
l = 0
)
),
axis.text = element_text(
size = rel(1.2)
),
strip.text.x = element_text(
size = rel(1.5)
)
)
)
library(gghighlight)
```
---
```{r child = "manuscripts/02-conceptual-explanation/00-conceptual-explanation.Rmd"}
```
---
```{r child = "manuscripts/03-basic-concepts/01-basic-concepts.Rmd"}
```
---
```{r child = "manuscripts/04-default-contrast/00-default-contrast.Rmd"}
```
---
```{r child = "manuscripts/05-hypothesis-matrix/00-hypothesis-matrix.Rmd"}
```
---
```{r child = "manuscripts/06-further-examples/00-further-examples.Rmd"}
```
---
```{r child = "manuscripts/07-good-set/00-good-set.Rmd"}
```
---
```{r child = "manuscripts/08-hypothesis-and-contrast-matrices/00-hypothesis-and-contrast-matrices.Rmd"}
```
---
<!-- adjust font size in this css code chunk, currently 80 -->
```{css, eval = TRUE, echo = FALSE}
.remark-code{line-height: 1.5; font-size: 80%}
@media print {
.has-continuation {
display: block;
}
}
code.r.hljs.remark-code{
position: relative;
overflow-x: hidden;
}
code.r.hljs.remark-code:hover{
overflow-x:visible;
width: 500px;
border-style: solid;
}
.highlight-last-item > ul > li,
.highlight-last-item > ol > li {
opacity: 0.5;
}
.highlight-last-item > ul > li:last-of-type,
.highlight-last-item > ol > li:last-of-type {
opacity: 1;
}
.column:first-of-type {float:left}
.column:last-of-type {float:right}
.split-30 .column:first-of-type {width: 30%}
.split-30 .column:last-of-type {width: 70%}
.split-40 .column:first-of-type {width: 40%}
.split-40 .column:last-of-type {width: 60%}
.split-50 .column:first-of-type {width: 50%}
.split-50 .column:last-of-type {width: 50%}
.split-60 .column:first-of-type {width: 60%}
.split-60 .column:last-of-type {width: 40%}
.split-70 .column:first-of-type {width: 70%}
.split-70 .column:last-of-type {width: 30%}
.pull-right + * {
clear: both;
}
.pull-right + * {
clear: both;
}
```