1
1
---
2
- title : " 4_L1 "
2
+ title : " Analysis for Expt. 2 in 'Not unreasonable' (cogsci) "
3
3
output : github_document
4
4
---
5
5
@@ -12,11 +12,11 @@ library(lme4)
12
12
library(lmerTest)
13
13
theme_set(theme_few())
14
14
project.prefix <- "4_L1_1slider"
15
- #project.prefix.lex <- "7_1slider_lex"
16
15
17
16
orange.purple.color.palette <-
18
17
c("#e66101", "#b2abd2", "#fdb863", "#5e3c99")
19
18
```
19
+ # Load Data
20
20
21
21
``` {r loadDataAndTime}
22
22
d.l1.7 <- read.csv(paste("../data/", project.prefix,"/",project.prefix,"-trials.csv",
@@ -30,10 +30,10 @@ d.l1.7 <- read.csv(paste("../data/", project.prefix,"/",project.prefix,"-trials.
30
30
"positive")))
31
31
32
32
d.l1.7.time <- read.csv(paste("../data/", project.prefix,"/",project.prefix,"-time.csv", sep = ""))
33
- summary(d.l1.7)
33
+ # summary(d.l1.7)
34
34
```
35
35
36
- Table of items
36
+ #### Table of items
37
37
38
38
``` {r itemTable}
39
39
d.items.lex <- d.l1.7 %>%
@@ -42,7 +42,7 @@ d.items.lex <- d.l1.7 %>%
42
42
select(adj_pair) %>%
43
43
distinct()
44
44
45
- d.items.lex <- data.frame(adj_pair = d.items.lex[with(d.items.lex, order(adj_pair)), ]) %>% rename("Negative opposites " = adj_pair)
45
+ d.items.lex <- data.frame(adj_pair = d.items.lex[with(d.items.lex, order(adj_pair)), ]) %>% rename("Lexical antonyms " = adj_pair)
46
46
47
47
48
48
d.items.morph <- d.l1.7 %>%
@@ -52,42 +52,33 @@ d.items.morph <- d.l1.7 %>%
52
52
distinct()
53
53
54
54
d.items.morph <- data.frame(adj_pair = d.items.morph[with(d.items.morph, order(adj_pair)), ])%>%
55
- rename("Antonym opposites " = adj_pair)
55
+ rename("Morphological antonyms " = adj_pair)
56
56
57
57
58
- # d.items <- d.items[with(d.items, order(positive)),] %>%
59
- # rename("Positive adjective" = positive, "Morphological antonym" = morphant,
60
- # "Lexical antonym" = lexant)
61
-
62
58
tab1 <- xtable::xtable(
63
59
cbind(as.matrix(d.items.morph), as.matrix(d.items.lex)),
64
60
caption = "Items in Experiment 1.")
65
- save(tab1, file = "../cached_results/item_table_e12.RData")
66
- #print(tab1, type="latex", comment = F, table.placement = "H", include.rownames=FALSE)
67
- #d.items
68
- #d.items.morph
69
61
70
- #tab1
62
+ #save( tab1, file = "../cached_results/item_table_e12.RData")
71
63
72
64
```
73
65
74
66
75
- Time to complete task
67
+ #### Time to complete task
76
68
77
69
``` {r fig_timeInMinutes}
78
-
79
70
d.expt1.time.summary <- d.l1.7.time %>%
80
71
summarize(aveTime = mean(time),
81
72
sdTime = sd(time))
82
73
83
- s#ave(d.expt1.time.summary, file = "../cached_results/time_summary_e1.RData")
84
- #
74
+ #save(d.expt1.time.summary, file = "../cached_results/time_summary_e1.RData")
85
75
86
76
ggplot(d.l1.7.time, aes(x = time)) +
87
77
geom_histogram()+
88
78
xlab("time in minutes")
89
79
```
90
80
81
+ #### Participant comments
91
82
92
83
``` {r subjectComments}
93
84
d.l1.7.comments <- read.csv(paste("../data/",
@@ -98,7 +89,7 @@ d.l1.7.comments <- read.csv(paste("../data/",
98
89
d.l1.7.comments %>% select(comments) %>% filter(comments != "") %>% kable()
99
90
```
100
91
101
- Self-reported native language
92
+ #### Self-reported native language
102
93
103
94
``` {r selfReportEnglishNative}
104
95
d.l1.7.nativeEnglish <- d.l1.7.comments %>%
@@ -128,11 +119,14 @@ d.l1.natEng <- left_join(
128
119
## check that i've done the filtering correctly
129
120
length(unique(d.l1.natEng$workerid))
130
121
```
122
+
123
+ #### Number of ratings per item
124
+
131
125
``` {r}
132
126
table(d.l1.natEng$positive, d.l1.natEng$adjective_type)
133
127
```
134
128
135
- Normalize ratings (by subject, subject off mean and divide by SD)
129
+ #### Normalize ratings (by subject, subject off mean and divide by SD)
136
130
137
131
``` {r}
138
132
d.l1.natEng <- d.l1.natEng %>%
@@ -153,29 +147,21 @@ Raw histograms
153
147
d.l1.natEng %>%
154
148
ggplot(., aes( x = normalizedResponse,
155
149
fill = adjective_type))+
156
- #geom_histogram(position = position_dodge(), bins = 20)+
157
150
geom_density(alpha = 0.5)+
158
151
facet_wrap(~antonym_type, scales = 'free')+
159
152
scale_fill_manual(values = orange.purple.color.palette)+
160
- #facet_grid(antonym_type~adjective_type, scales = 'free')+
161
- #scale_fill_manual(values = orange.purple.color.palette)+
162
- #ylab("counts")+
163
153
xlab("slider ratings")
164
-
165
- ggsave(paste(
166
- "~/Documents/research/negant/analysis/figs/cogsci_expt1_densities.pdf", sep = ""),
167
- width = 6, height = 3)
168
-
169
- ##scale_x_continuous(limits = c(-0.01, 1.01), breaks = c(0, 1))+
170
- guides(fill = F)
154
+ #
171
155
# ggsave(paste(
172
- # "~/Documents/research/talks/vagueness/frisem-2018-01/img/", project.prefix, "_histograms.pdf", sep = ""),
173
- # width = 7, height = 3)
156
+ # "~/Documents/research/negant/analysis/figs/cogsci_expt1_densities.pdf", sep = ""),
157
+ # width = 6, height = 3)
158
+
174
159
```
175
160
176
- By item histograms
161
+ #### Exploratory: By item histograms
177
162
178
163
``` {r}
164
+ # how many participants rate a morphological negated antonym below average?
179
165
d.l1.natEng %>%
180
166
filter(adjective_type == "neg_antonym",
181
167
antonym_type == "morphological") %>%
@@ -203,7 +189,7 @@ d.l1.natEng %>%
203
189
```
204
190
205
191
206
- Bootstrapped CIs
192
+ #### Bootstrapped CIs
207
193
208
194
``` {r fig_bootstrappedCIs}
209
195
d.l1.4.boot <- d.l1.natEng %>%
@@ -249,10 +235,9 @@ d.l1.4.boot %>%
249
235
# width = 6, height = 3.75)
250
236
```
251
237
252
- By item
238
+ #### By item
253
239
254
240
``` {r fig.width = 7, fig.height = 5}
255
-
256
241
d.l1.7.boot.adj <- d.l1.natEng %>%
257
242
group_by(positive, adjective, adjective_type) %>%
258
243
multi_boot_standard(col = "normalizedResponse") %>%
@@ -266,11 +251,6 @@ d.l1.7.boot.adj <- d.l1.natEng %>%
266
251
"positive")))
267
252
268
253
269
- # %>%
270
- # filter(adjective_type %in% c("lexant",
271
- # "morphant",
272
- # "neg_positive"))
273
-
274
254
d.l1.7.boot.adj %>%
275
255
ggplot(., aes(x = adjective,
276
256
y = mean,
@@ -303,23 +283,6 @@ d.l1.7.boot.adj %>%
303
283
304
284
Helmert coding, maximal model, and model comparison to simpler model.
305
285
306
- ``` {r}
307
-
308
- summary(lmer(
309
- response ~ adjective_type +
310
- (1 | workerid) +
311
- (1 | positive),
312
- data = d.l1.natEng %>%
313
- mutate(adjective_type = factor(adjective_type,
314
- levels = c("neg_positive",
315
- "lexant",
316
- "morphant",
317
- "neg_lexant",
318
- "neg_morphant",
319
- "positive")))
320
- ))
321
-
322
- ```
323
286
324
287
325
288
``` {r}
@@ -362,25 +325,23 @@ summary(rs.7.helmert)
362
325
# "../cached_results/regression_antTypeXadjType_expt1.RData")
363
326
364
327
365
-
366
-
328
+ ## more limited random effects structure
367
329
rs.7.helmert.0 <- lmer(response ~ antonym_type * st +
368
330
(1 + st | workerid) +
369
331
(1 | positive),
370
332
data = d.l1.natEng.rescaled)
371
333
# extra random effect of sentence_type by item accounts for significantly more variance
372
334
anova(rs.7.helmert.0, rs.7.helmert)
373
-
374
- # try model with inverse random effect structure?
375
335
```
376
336
337
+ Examine residuals
338
+
377
339
``` {r}
378
340
plot(rs.7.helmert)
379
341
qqnorm(residuals(rs.7.helmert))
380
342
```
381
343
382
-
383
- "Simple effects"
344
+ ### "Simple effects"
384
345
385
346
``` {r reg.simple.morph}
386
347
@@ -451,7 +412,6 @@ ggplot(d.l1.4.splithalf,
451
412
### First vs. last rating
452
413
453
414
``` {r}
454
-
455
415
d.l1.4.first.last <- bind_rows(
456
416
d.l1.4 %>%
457
417
group_by(workerid, negation, sentence_type) %>%
@@ -475,5 +435,4 @@ ggplot(d.l1.4.first.last.summary, aes(x = presentation, fill = sentence_type,
475
435
geom_errorbar(position = position_dodge())+
476
436
facet_wrap(~negation)
477
437
478
- #ggsave("~/Documents/research/negant/analysis/figs/split_half-3_L1.pdf", width =6 , height = 4)
479
438
```
0 commit comments