Skip to content

Commit 7275fcb

Browse files
author
mhtess
committed
edits to old analysis scripts
1 parent 767e9a7 commit 7275fcb

File tree

3 files changed

+323
-33
lines changed

3 files changed

+323
-33
lines changed

analysis/0_L1.Rmd

+10-5
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,16 @@ d.l1.censored <- left_join(d.l1,
3535
filter(time > 2)
3636
3737
d.l1.comments <- read.csv("../data/0_L1/0_L1-subject_information.csv")
38+
39+
summary(d.l1)
3840
```
3941

4042
```{r}
4143
d.l1 %>%
4244
filter(sentence_type != "Neither ... nor ...") %>%
4345
ggplot(., aes( x = response,
4446
fill = sentence_type))+
45-
geom_histogram(position = position_dodge())+
47+
geom_histogram(position = position_dodge(), bins = 20)+
4648
#geom_density(alpha = 0.3)+
4749
facet_wrap(~sentence_type, nrow = 1)+
4850
scale_fill_solarized()+
@@ -51,8 +53,8 @@ ggplot(., aes( x = response,
5153
scale_x_continuous(limits = c(-0.01, 1.01), breaks = c(0, 1))+
5254
guides(fill = F)
5355
54-
#ggsave("~/Documents/research/talks/vagueness/negAnt_histograms.pdf",
55-
#width = 6, height = 3)
56+
ggsave("~/Documents/research/talks/vagueness/frisem-2018-01/img/negAnt_morpho_explAlt_histograms.pdf",
57+
width = 7, height = 3)
5658
```
5759

5860
```{r}
@@ -87,6 +89,7 @@ d.l1.boot <- d.l1 %>%
8789

8890
```{r}
8991
d.l1.boot %>%
92+
filter(sentence_type != "Neither ... nor ...") %>%
9093
ggplot(., aes(x = sentence_type,
9194
y = mean,
9295
ymin = ci_lower, ymax = ci_upper,
@@ -105,7 +108,7 @@ ggplot(., aes(x = sentence_type,
105108
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))+
106109
guides(fill = F)
107110
108-
#ggsave("~/Documents/research/talks/vagueness/cusp-2017/not-unhappy_bootstrapped.pdf", width = , height = 3.5)
111+
ggsave("~/Documents/research/talks/vagueness/frisem-2018-01/img/negant_morpho_explAlt_bootstrapped.pdf", width = 4, height = 3.5)
109112
```
110113

111114
```{r echo=F, eval=F}
@@ -136,7 +139,8 @@ d.l1.boot.adj <- d.l1 %>%
136139
multi_boot_standard(col = "response")
137140
138141
d.l1.boot.adj %>%
139-
ggplot(., aes(x = positive,
142+
filter(sentence_type != "Neither ... nor ...") %>%
143+
ggplot(., aes(x = positive,
140144
y = mean,
141145
ymin = ci_lower, ymax = ci_upper,
142146
fill = sentence_type,
@@ -153,6 +157,7 @@ ggplot(., aes(x = positive,
153157
scale_y_continuous(limits = c(0,1), breaks = c(0, 0.5,1))+
154158
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))
155159
160+
ggsave("~/Documents/research/talks/vagueness/frisem-2018-01/img/negant_morpho_explAlt_bootstrapped_item.pdf", width = 8, height = 3.5)
156161
```
157162

158163

analysis/2_L1.Rmd

+33-7
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ d.l1 <- read.csv("../data/2_L1_oneslider/2_L1_oneslider-trials.csv") %>%
2929
3030
d.l1.time <- read.csv("../data/2_L1_oneslider/2_L1_oneslider-time.csv")
3131
32+
summary(d.l1)
3233
```
3334

3435

@@ -58,17 +59,17 @@ d.l1 %>%
5859
filter(sentence_type != "Neither ... nor ...") %>%
5960
ggplot(., aes( x = response,
6061
fill = sentence_type))+
61-
geom_histogram(position = position_dodge())+
62+
geom_histogram(position = position_dodge(), bins = 20)+
6263
#geom_density(alpha = 0.3)+
6364
facet_wrap(~sentence_type, nrow = 1)+
6465
scale_fill_solarized()+
6566
ylab("counts")+
6667
xlab("degree ratings")+
67-
scale_x_continuous(limits = c(-0.01, 1.01), breaks = c(0, 1))#+
68-
# guides(fill = F)
68+
scale_x_continuous(limits = c(-0.01, 1.01), breaks = c(0, 1))+
69+
guides(fill = F)
6970
70-
# ggsave("~/Documents/research/talks/vagueness/negAnt_histograms.pdf",
71-
# width = 6, height = 3)
71+
ggsave("~/Documents/research/talks/vagueness/frisem-2018-01/img/negAnt_morpho2_histograms.pdf",
72+
width = 7, height = 3)
7273
```
7374

7475

@@ -87,7 +88,8 @@ d.l1.boot <- d.l1 %>%
8788

8889
```{r}
8990
d.l1.boot %>%
90-
ggplot(., aes(x = sentence_type,
91+
filter(sentence_type != "Neither ... nor ...") %>%
92+
ggplot(., aes(x = sentence_type,
9193
y = mean,
9294
ymin = ci_lower, ymax = ci_upper,
9395
fill = sentence_type,
@@ -105,7 +107,7 @@ ggplot(., aes(x = sentence_type,
105107
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))+
106108
guides(fill = F)
107109
108-
#ggsave("~/Documents/research/talks/vagueness/cusp-2017/not-unhappy_bootstrapped.pdf", width = , height = 3.5)
110+
ggsave("~/Documents/research/talks/vagueness/frisem-2018-01/img/negant_morpho2_bootstrapped.pdf", width = 4, height = 3.5)
109111
```
110112

111113
```{r echo = F, eval = F}
@@ -136,6 +138,7 @@ d.l1.boot.adj <- d.l1 %>%
136138
multi_boot_standard(col = "response")
137139
138140
d.l1.boot.adj %>%
141+
filter(sentence_type != "Neither ... nor ...") %>%
139142
ggplot(., aes(x = positive,
140143
y = mean,
141144
ymin = ci_lower, ymax = ci_upper,
@@ -153,6 +156,7 @@ ggplot(., aes(x = positive,
153156
scale_y_continuous(limits = c(0,1), breaks = c(0, 0.5,1))+
154157
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))
155158
159+
ggsave("~/Documents/research/talks/vagueness/frisem-2018-01/img/negant_morpho2_bootstrapped_item.pdf", width = 8, height = 3.5)
156160
```
157161

158162

@@ -183,3 +187,25 @@ ggplot(., aes(x = positive,
183187
184188
```
185189

190+
191+
First half vs. second half split
192+
193+
```{r}
194+
d.l1.splithalf <- d.l1 %>%
195+
mutate(splitHalf = ifelse(trial_num <= 15, "first", "second")) %>%
196+
#filter(negation == "morphological") %>%
197+
group_by(workerid, sentence_type) %>%
198+
group_by(sentence_type, splitHalf) %>%
199+
multi_boot_standard(col = 'response')
200+
201+
202+
ggplot(d.l1.splithalf, aes(x = splitHalf, fill = sentence_type,
203+
y = mean, ymin = ci_lower,
204+
ymax = ci_upper))+
205+
geom_col(position = position_dodge(), color = 'black')+
206+
geom_errorbar(position = position_dodge())
207+
208+
ggsave("~/Documents/research/negant/analysis/figs/split_half-2_L1.pdf", width =6 , height = 4)
209+
```
210+
211+

0 commit comments

Comments
 (0)