-
Notifications
You must be signed in to change notification settings - Fork 1
/
6_supplementary_analyses.qmd
1954 lines (1742 loc) · 71.4 KB
/
6_supplementary_analyses.qmd
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
toc-title: "Supplementary Analyses"
toc-expand: 1
---
```{r}
#| label: supplementary-setup
#| include: false
library(tidyverse) # data wrangling
library(magrittr)
library(sjmisc)
options(dplyr.group.inform = FALSE, dplyr.summarise.inform = FALSE)
library(lme4) # stats
library(lmerTest)
library(buildmer)
library(brms)
library(insight) # model results
library(broom.mixed)
library(flextable) # tables
library(sjPlot)
library(patchwork) # plots
library(RColorBrewer)
library(ggtext)
library(png)
source("resources/formatting/aesthetics.R") # plot and table themes
source("resources/data-functions/demographics.R")
source("resources/data-functions/exp1_load_data.R")
source("resources/data-functions/exp2_load_data.R")
source("resources/data-functions/exp3_load_data.R")
source("resources/data-functions/exp4_load_data.R")
```
# Supplementary Analyses
## Experiment 1 {#sec-supplementary-exp1}
```{r}
#| label: load-workspace-exp1
load("r_data/exp1.RData")
```
### Experiment 1A: Additional Results {#sec-supplementary-exp1a}
In addition to whether the characters used he/him, she/her, or they/them, participants were also asked about the characters' jobs and pets (@fig-exp1a-job-pet). Accuracy matching the 12 jobs to the 12 characters was lower (*M* = `r exp1a_r_job$mean`, *SD* = `r exp1a_r_job$sd`) than for the 3 pets (*M* = `r exp1a_r_pet_means['all', 'mean']`, *SD* = `r exp1a_r_pet_means['all', 'sd']`) and 3 pronouns (*M* = `r exp1a_r_memory_means['all', 'mean']`, *SD* = `r exp1a_r_memory_means['all', 'sd']`), but not at floor. Neither job nor pet accuracy varied based on the character's pronouns. Accuracy for the characters' pets (cat, dog, or fish) was designed as a comparison to pronoun accuracy, and the two were compared in a model including the Character's Pronouns (contrast coded as in the main analyses) and Question Type (pronoun vs pet, mean-center effects coded) as fixed effects. The most complex model that converged included by-participant random slopes for Question Type (@tbl-exp1a-pet). Averaging across the three character pronouns, participants were significantly more accurate for pronoun questions than pet questions (`r exp1a_r_pet['M_Type=Pet_Pronoun', 'Text']`). The interaction between Character Pronoun (they/them vs he/him + she/her) and Question Type was significant (`r exp1a_r_pet['M_Type=Pet_Pronoun:CharPronoun=They_HeShe', 'Text']`), reflecting that the character pronouns affected accuracy for the pronoun question, but not the pet question. Probing this interaction indicated that for they/them characters, there was no significant difference in accuracy between pronouns and pets (`r exp1a_r_pet_they['M_Type=Pet_Pronoun', 'Text']`), but that for he/him + she/her characters, pronoun accuracy was higher than pet accuracy (`r exp1a_r_pet_heshe['M_Type=Pet_Pronoun', 'Text']`).
```{r}
#| label: fig-exp1a-job-pet
#| fig-cap: "Experiment 1A: By-participant mean accuracy in the multiple-choice memory task for each character's pronouns, pet, and job, with colors indicating the character's pronouns. Error bars indicate 95% CIs calculated over the by-participant means."
#| fig-asp: 0.6
#| output: true
#| cache: true
read.csv("data/exp1a_data.csv", stringsAsFactors = TRUE) %>%
filter(Task == "memory") %>%
group_by(SubjID, M_Type, Pronoun) %>%
summarise(M_Acc_Subj = mean(M_Acc)) %>% # by-subject means
ggplot(aes(x = M_Type, y = M_Acc_Subj, fill = Pronoun, color = Pronoun)) +
geom_point(
position = position_jitterdodge(
dodge.width = 0.9, jitter.width = 0.6, jitter.height = 0.01, seed = 1
),
size = 0.15, key_glyph = "rect" # make legend full saturation colors
) +
stat_summary(
fun.data = mean_cl_boot, geom = "bar",
position = position_dodge(width = 0.9), alpha = 0.4, color = NA
) +
stat_summary(
fun.data = mean_cl_boot, geom = "errorbar",
position = position_dodge(width = 0.9),
color = "black", linewidth = 0.5, width = 0.5
) +
scale_color_brewer(palette = "Dark2", guide = guide_none()) +
scale_fill_brewer(palette = "Dark2") +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0.01, 0.01)) +
theme_classic() +
dissertation_plot_theme +
theme(legend.margin = margin(l = -5)) +
guides(fill = guide_legend(byrow = TRUE)) +
labs(
title = "Experiment 1A: All Memory Questions",
x = "Question Type",
y = "By-Participant Mean Accuracy",
fill = "Character\nPronouns"
)
```
| |
|------------------------------------------------|
| **Experiment 1A: Memory for Pronouns vs Pets** |
: Experiment 1A: Model results for the effects of Character Pronoun and Question Type (character's pronoun or pet) on Memory Accuracy. Character Pronoun is contrast-coded as in the main analysis. {#tbl-exp1a-pet .borderless}
```{r}
#| label: table-exp1a-pet
#| output: true
exp1a_tb_pets_all <- tab_model(
model = exp1a_m_pet@model,
transform = NULL, show.stat = TRUE, string.stat = "z",
show.ci = FALSE, show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, digits = 3, digits.re = 3,
dv.labels = "Memory Accuracy",
pred.labels = c(
"M_Type=Pet_Pronoun" =
"<b>Question Type: Pet</b> (-.5) <b>vs Pronoun</b> (+.5)",
exp1_tb_fixed_labels
),
wrap.labels = 80, CSS = table_css
)
exp1a_tb_pets_all$knitr %<>% exp1_tb_random_labels() %>% drop_sigma()
exp1a_tb_pets_all
```
The memory and production tasks were compared directly by creating a model predicting accuracy in both tasks, with Task as a mean-center effects coded fixed effect (@tbl-exp1a-task). The main effect of Task was not significant (`r exp1a_r_task['Task=M_P', 'Text']`), but the interaction between Pronoun (They vs He + She) was significant (`r exp1a_r_task['Pronoun=They_HeShe:Task=M_P', 'Text']`). Probing this interaction indicated that memory was more accurate than production for they/them characters (`r exp1a_r_task_they['Task=M_P', 'Text']`). Conversely, memory was less accurate than production for he/him and she/her characters (`r exp1a_r_task_heshe['Task=M_P', 'Text']`).
| |
|-------------------------------------------------------------|
| **Experiment 1A: Comparing Memory and Production Accuracy** |
: Experiment 1A: Model results for the effects of Pronoun and Task (memory vs production) on Accuracy. {#tbl-exp1a-task .borderless}
```{r}
#| label: table-exp1a-task
#| output: true
exp1a_tb_task <- tab_model(
model = exp1a_m_task@model,
transform = NULL, show.stat = TRUE, string.stat = "z",
show.ci = FALSE, show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, digits = 3, digits.re = 3,
dv.labels = "Accuracy",
pred.labels = c(
"Task=M_P" = "Task: Memory (-.5) vs Production (+.5)",
exp1_tb_fixed_labels
),
wrap.labels = 80, CSS = table_css
)
exp1a_tb_task$knitr %<>%
exp1_tb_random_labels() %>%
str_replace( # bug with tab_model() makes it drop random slope labels
"ρ<sub>01</sub>",
"ρ<sub>01 Pronoun (They vs He + She) | Participant</sub>"
) %>%
str_replace(
'bottom:0.1cm;"></td>',
'bottom:0.1cm;">ρ<sub>01 Pronoun (He vs She) | Participant</sub></td>'
) %>%
drop_sigma()
exp1a_tb_task
```
### Experiment 1B: Additional Results {#sec-supplementary-exp1b}
| |
|---------------------------|
| **Experiment 1B: Memory** |
: Experiment 1B: Model results for the effect of Pronoun on Memory Accuracy, when the memory task was completed after the production task. {#tbl-exp1b-mem .borderless}
```{r}
#| label: table-exp1b-mem
#| output: true
exp1b_tb_mem <- tab_model(
model = exp1b_m_memory@model,
transform = NULL, # show log-odds not odds ratios
show.stat = TRUE, string.stat = "z", # show z
show.ci = FALSE, # show SE instead of CI
show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, # don't make sense for logistic models
# shows intercept, p values, random effects, n group, n obs by default
digits = 3, digits.re = 3, # round to 3
dv.labels = "Memory Accuracy", # labels
pred.labels = exp1_tb_fixed_labels,
wrap.labels = 80,
CSS = table_css
)
exp1b_tb_mem$knitr %<>% drop_sigma()
exp1b_tb_mem
```
| |
|-------------------------------|
| **Experiment 1B: Production** |
: Experiment 1B: Model results for the effect of Pronoun on Production Accuracy, when the memory task was completed after the production task. {#tbl-exp1b-prod .borderless}
```{r}
#| label: table-exp1b-prod
#| output: true
exp1b_tb_prod <- tab_model(
model = exp1b_m_prod@model,
transform = NULL, show.stat = TRUE, string.stat = "z",
show.ci = FALSE, show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, digits = 3, digits.re = 3,
dv.labels = "Production Accuracy", pred.labels = exp1_tb_fixed_labels,
wrap.labels = 80, CSS = table_css
)
exp1b_tb_prod$knitr %<>% drop_sigma()
exp1b_tb_prod
```
| |
|-------------------------------------------------|
| **Experiment 1B: Memory Predicting Production** |
: Experiment 1B: Model results for the effect of Pronoun on Production Accuracy, when the memory task was completed after the production task. {#tbl-exp1b-both .borderless}
```{r}
#| label: table-exp1b-mp
#| results: asis
exp1b_tb_mp <- tab_model(
model = exp1b_m_mp@model,
transform = NULL, show.stat = TRUE, string.stat = "z",
show.ci = FALSE, show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, digits = 3, digits.re = 3,
dv.labels = "Production Accuracy", pred.labels = exp1_tb_fixed_labels,
wrap.labels = 80, CSS = table_css
)
exp1b_tb_mp$knitr %<>% drop_sigma()
cat(exp1b_tb_mp$knitr)
```
```{r}
#| label: fig-exp1b-job-pet
#| fig-cap: "Experiment 1B: By-participant mean accuracy in the multiple-choice memory task for each character's pronouns, pet, and job, with colors indicating the character's pronouns. Error bars indicate 95% CIs calculated over the by-participant means."
#| fig-asp: 0.6
#| output: true
#| cache: true
read.csv("data/exp1b_data.csv", stringsAsFactors = TRUE) %>%
filter(Task == "memory") %>%
group_by(SubjID, M_Type, Pronoun) %>%
summarise(M_Acc_Subj = mean(M_Acc)) %>% # by-subject means
ggplot(aes(x = M_Type, y = M_Acc_Subj, fill = Pronoun, color = Pronoun)) +
geom_point(
position = position_jitterdodge(
dodge.width = 0.9, jitter.width = 0.6, jitter.height = 0.01, seed = 1
),
size = 0.15, key_glyph = "rect" # make legend full saturation colors
) +
stat_summary(
fun.data = mean_cl_boot, geom = "bar",
position = position_dodge(width = 0.9), alpha = 0.4, color = NA
) +
stat_summary(
fun.data = mean_cl_boot, geom = "errorbar",
position = position_dodge(width = 0.9),
color = "black", linewidth = 0.5, width = 0.5
) +
scale_color_brewer(palette = "Dark2", guide = guide_none()) +
scale_fill_brewer(palette = "Dark2") +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0.01, 0.01)) +
theme_classic() +
dissertation_plot_theme +
theme(legend.margin = margin(l = -5)) +
guides(fill = guide_legend(byrow = TRUE)) +
labs(
title = "Experiment 1B: All Memory Questions",
x = "Question Type",
y = "By-Participant Mean Accuracy",
fill = "Character\nPronouns"
)
```
| |
|------------------------------------------------|
| **Experiment 1B: Memory for Pronouns vs Pets** |
: Experiment 1B: Model results for the effects of Character Pronoun and Question Type (character’s pronoun or pet) on Memory Accuracy, when the memory task was completed after the production task. {#tbl-exp1b-pet .borderless}
```{r}
#| label: table-exp1b-pet
#| output: true
exp1b_tb_pets_all <- tab_model(
model = exp1b_m_pet@model,
transform = NULL, show.stat = TRUE, string.stat = "z",
show.ci = FALSE, show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, digits = 3, digits.re = 3,
dv.labels = "Memory Accuracy",
pred.labels = c(
"M_Type=Pet_Pronoun" =
"<b>Question Type: Pet</b> (-.5) <b>vs Pronoun</b> (+.5)",
exp1_tb_fixed_labels
),
wrap.labels = 80, CSS = table_css
)
exp1b_tb_pets_all$knitr %<>% exp1_tb_random_labels() %>% drop_sigma()
exp1b_tb_pets_all
```
### Comparing Experiments 1A & 1B {#sec-supplementary-exp1ab}
```{r}
#| label: fig-exp1ab-panel1
#| fig-cap: "Experiments 1A & 1B. Memory accuracy, distribution of memory responses, production accuracy, and distribution of production responses, comparing between task orders. Points indicate by-participant means, and error bars indicate 95% CIs calculated over the by-participant means."
#| fig-asp: 0.8
#| output: true
#| cache: true
## Memory distribution----
exp1b_p_memory_dist <- exp1_d %>%
ggplot(aes(x = Experiment, fill = M_Response, alpha = Experiment)) +
geom_bar(position = "fill") +
facet_wrap(~Pronoun, strip.position = "bottom") +
scale_alpha_manual(
values = c(1, 1),
labels = c("1A:\nMemory\nFirst", "1B:\nProduction\nFirst")
) +
scale_fill_brewer(palette = "Dark2") +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0)) +
theme_classic() +
dissertation_plot_theme +
grouped_strip_theme + # hack to group labels
theme(
axis.text.y = element_text(size = 8), # smaller text
plot.title = element_text(size = 11),
strip.text = element_text(face = "plain")
) +
guides(
alpha = guide_legend(
byrow = TRUE, override.aes = theme(fill = NA),
label.position = "left", label.hjust = 0
),
fill = guide_none()
) +
labs(
title = "Memory Distribution",
x = element_blank(),
y = "Proportion of Trials",
fill = "Pronoun\nSelected",
alpha = "Experiment"
)
## Memory accuracy----
exp1b_p_memory_acc <- exp1_d %>%
group_by(Experiment, Participant, Pronoun) %>%
summarise(M_Acc_Subj = mean(M_Acc)) %>%
ggplot(aes(x = Experiment, y = M_Acc_Subj, fill = Pronoun, color = Pronoun)) +
stat_summary(
fun.data = mean_cl_boot, geom = "bar", alpha = 0.4, color = "NA"
) +
geom_point(
position = position_jitter(width = 0.35, height = 0.02, seed = 1),
size = 0.15
) +
stat_summary(
fun.data = mean_cl_boot, geom = "errorbar",
color = "black", linewidth = 0.5, width = 0.5
) +
facet_wrap(~Pronoun, strip.position = "bottom") +
scale_fill_brewer(palette = "Dark2") +
scale_color_brewer(palette = "Dark2") +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0.02, 0.02)) +
guides(fill = guide_none(), color = guide_none()) +
theme_classic() +
dissertation_plot_theme +
grouped_strip_theme + # hack to group labels
theme(
axis.text.y = element_text(size = 8), # smaller text
plot.title = element_text(size = 11),
strip.text = element_text(face = "plain")
) +
labs(
title = "Memory Accuracy",
x = element_blank(),
y = "By-Participant Mean Accuracy"
)
## Production distribution----
exp1b_p_prod_dist <- exp1_d %>%
ggplot(aes(x = Experiment, fill = P_Response)) +
geom_bar(position = "fill") +
facet_wrap(~Pronoun, strip.position = "bottom") +
scale_fill_brewer(palette = "Dark2") +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0)) +
theme_classic() +
dissertation_plot_theme +
grouped_strip_theme + # hack to group labels
theme(
axis.text.y = element_text(size = 8), # smaller text
plot.title = element_text(size = 11),
strip.text = element_text(face = "plain")
) +
labs(
title = "Production Distribution",
x = element_blank(),
y = "Proportion of Trials",
fill = "Pronoun\nSelected"
)
## Production accuracy----
exp1b_p_prod_acc <- exp1_d %>%
group_by(Experiment, Participant, Pronoun) %>%
summarise(P_Acc_Subj = mean(P_Acc)) %>%
ggplot(aes(x = Experiment, y = P_Acc_Subj, fill = Pronoun, color = Pronoun)) +
stat_summary(
fun.data = mean_cl_boot, geom = "bar", alpha = 0.4, color = "NA"
) +
geom_point(
position = position_jitter(width = 0.35, height = 0.02, seed = 1),
size = 0.15
) +
stat_summary(
fun.data = mean_cl_boot, geom = "errorbar",
color = "black", linewidth = 0.5, width = 0.5
) +
facet_wrap(~Pronoun, strip.position = "bottom") +
scale_fill_brewer(palette = "Dark2") +
scale_color_brewer(palette = "Dark2") +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0.02, 0.02)) +
guides(fill = guide_none(), color = guide_none()) +
theme_classic() +
dissertation_plot_theme +
grouped_strip_theme + # hack to group labels
theme(
axis.text.y = element_text(size = 8), # smaller text
plot.title = element_text(size = 11),
strip.text = element_text(face = "plain")
) +
labs(
title = "Production Accuracy",
x = element_blank(),
y = "By-Participant Mean Accuracy"
)
## Combine----
exp1b_p_memory_acc +
exp1b_p_memory_dist +
guides(fill = guide_none()) +
exp1b_p_prod_acc +
exp1b_p_prod_dist +
plot_layout(guides = "collect") +
plot_annotation(
title = "Comparing Experiments 1A & 1B",
theme = patchwork_theme
)
```
```{r}
#| label: fig-exp1ab-panel2
#| fig-cap: "Experiments 1A & 1B. Distribution of combined memory and production accuracy, then production accuracy split by memory accuracy, comparing between task orders. Error bars indicate 95% CIs calculated over trials."
#| fig-asp: 1
#| output: true
#| cache: true
## Memory & production----
exp1b_p_compare <- exp1_d %>%
mutate(MP_Acc =
case_when(
M_Acc == 1 & P_Acc == 1 ~ "Both Right",
M_Acc == 1 & P_Acc == 0 ~ "Memory Only",
M_Acc == 0 & P_Acc == 1 ~ "Production Only",
M_Acc == 0 & P_Acc == 0 ~ "Both Wrong"
) %>%
factor(levels = c(
"Memory Only", "Production Only", "Both Wrong", "Both Right"
))
) %>%
ggplot(aes(x = Experiment, fill = MP_Acc, alpha = Experiment)) +
geom_bar(position = "fill") +
facet_wrap(~Pronoun, strip.position = "bottom") +
scale_alpha_manual(
values = c(1, 1),
labels = c("1A:\nMemory First", "1B:\nProduction First")
) +
scale_fill_manual(values = c("pink3", "#E6AB02", "tomato3", "#367ABF")) +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0)) +
theme_classic() +
dissertation_plot_theme +
grouped_strip_theme + # hack to group labels
theme(
axis.text.y = element_text(size = 8), # smaller text
plot.title = element_text(size = 11),
strip.text = element_text(face = "plain")
) +
guides(
alpha = guide_legend( # to add Experiment as a legend
byrow = TRUE, label.position = "left", label.hjust = 0,
override.aes = theme(fill = NA)),
fill = guide_legend(order = 1)) +
labs(
title = "Combined Accuracy",
x = element_blank(),
y = "Proportion of Characters",
alpha = "Experiment",
fill = "Accuracy Pattern"
)
## Production split by memory----
exp1b_p_split <- exp1_d %>%
ggplot(aes(x = Experiment, y = P_Acc, fill = Pronoun, alpha = M_Acc_Factor)) +
stat_summary(fun.data = mean_cl_boot, geom = "bar", position = "dodge") +
stat_summary(
fun.data = mean_cl_boot, geom = "errorbar",
position = position_dodge(width = 0.9),
color = "black", linewidth = 0.5, width = 0.5
) +
scale_alpha_discrete(
range = c(0.5, 1), labels = c("Memory\nIncorrect", "Memory\nCorrect")
) +
scale_fill_brewer(palette = "Dark2") +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0), limits = c(0, 1)) +
facet_wrap(~Pronoun, strip.position = "bottom") +
theme_classic() +
dissertation_plot_theme +
grouped_strip_theme + # hack to group labels
theme(
axis.text.y = element_text(size = 8), # smaller text
plot.title = element_text(size = 11),
strip.text = element_text(face = "plain")
) +
guides(
alpha = guide_legend(override.aes = theme(color = NA)),
fill = guide_none()
) +
labs(
title = "Production Accuracy\nSplit By Memory Accuracy",
x = element_blank(),
y = "Production Accuracy",
alpha = "Memory Accuracy"
)
## Combine----
exp1b_p_compare / exp1b_p_split +
plot_layout(guides = "collect") +
plot_annotation(
title = "Comparing Experiments 1A & 1B",
theme = patchwork_theme
) +
plot_annotation(theme = theme( # then move legend over a bit
legend.box.margin = margin(l = 0.15, r = -0.15, unit = "in")
))
```
| |
|------------------------------------------------------------------------|
| **Comparing Experiments 1A (Memory First) & 1B (Production First):**<br>**Memory** |
: Experiments 1A & 1B: Model results for the effects of Pronoun and Task Order on Memory Accuracy. {#tbl-exp1-mem .borderless}
```{r}
#| label: table-exp1-mem
#| output: true
exp1_tb_mem <- tab_model(
model = exp1_m_memory@model,
transform = NULL, # show log-odds not odds ratios
show.stat = TRUE, string.stat = "z", # show z
show.ci = FALSE, # show SE instead of CI
show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, # don't make sense for logistic models
# shows intercept, p values, random effects, n group, n obs by default
digits = 3, digits.re = 3, # round to 3
dv.labels = "Memory Accuracy", # labels
pred.labels = exp1_tb_fixed_labels,
wrap.labels = 80,
CSS = table_css
)
exp1_tb_mem$knitr %<>% drop_sigma()
exp1_tb_mem
```
| |
|------------------------------------------------------------------------|
| **Comparing Experiments 1A (Memory First) & 1B (Production First):**<br>**Production** |
: Experiments 1A & 1B: Model results for the effects of Pronoun and Task Order on Production Accuracy. {#tbl-exp1-prod .borderless}
```{r}
#| label: table-exp1-prod
#| results: asis
exp1_tb_prod <- tab_model(
model = exp1_m_prod,
transform = NULL, show.stat = TRUE, string.stat = "z",
show.ci = FALSE, show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, digits = 3, digits.re = 3,
dv.labels = "Production Accuracy",
pred.labels = c(
"Pronoun=They_HeShe:Experiment=A_B" = "<b>Pronoun (They vs He+She) * Order",
exp1_tb_fixed_labels
),
wrap.labels = 80, CSS = table_css
)
exp1_tb_prod$knitr %<>% drop_sigma()
cat(exp1_tb_prod$knitr)
```
| |
|------------------------------------------------------------------------|
| **Comparing Experiments 1A (Memory First) & 1B (Production First):**<br>**Memory Predicting Production** |
: Experiments 1A & 1B: Model results for the effects of Pronoun, Memory Accuracy, and Task Order on Production Accuracy. {#tbl-exp1-both .borderless}
```{r}
#| label: table-exp1-mp
#| results: asis
exp1_tb_mp <- tab_model(
model = exp1_m_mp,
transform = NULL, show.stat = TRUE, string.stat = "z",
show.ci = FALSE, show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, digits = 3, digits.re = 3,
dv.labels = "Production Accuracy", pred.labels = exp1_tb_fixed_labels,
wrap.labels = 80, CSS = table_css
)
exp1_tb_mp$knitr %<>% drop_sigma()
cat(exp1_tb_mp$knitr)
```
| |
|------------------------------------------------------------------|
| **Comparing Experiments 1A (Memory First) & 1B (Production First):**<br>**By-Participant Differences Between Memory & Production** |
: Experiments 1A & 1B: Model results for the effects of Pronoun and Task Order on the difference between memory accuracy and production accuracy for each participant. {#tbl-exp1-task .borderless}
```{r}
#| label: table-exp1-task
#| results: asis
exp1_tb_diff <- tab_model(
model = exp1_m_diff,
show.stat = TRUE, string.stat = "z",
show.ci = FALSE, show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, digits = 3, digits.re = 3,
dv.labels = "Difference Score",
pred.labels = c(
"(Intercept)" = "(Intercept)",
exp1_tb_fixed_labels
),
wrap.labels = 70, CSS = table_css
)
exp1_tb_diff$knitr %<>% drop_sigma()
cat(exp1_tb_diff$knitr)
```
```{r}
#| label: fig-exp1-reliability
#| fig-cap: "Experiments 1A & 1B: Correlations between by-participant random slopes <br>for the effect of Pronoun in each half of the data, for the memory and production tasks."
#| fig-asp: 1
#| out-width: "70%"
#| output: true
#| cache: true
exp1_d_reliability <- bind_rows(.id = "Task",
"Memory" = bind_rows(.id = "Experiment",
"1A" = exp1a_m_mem_reliability %>%
ranef() %>%
purrr::pluck(1) %>%
as_tibble() %>%
select(contains("Estimate.Pronoun")),
"1B" = exp1b_m_mem_reliability %>%
ranef() %>%
purrr::pluck(1) %>%
as_tibble() %>%
select(contains("Estimate.Pronoun"))
),
"Production" = bind_rows(.id = "Experiment",
"1A" = exp1a_m_prod_reliability %>%
ranef() %>%
purrr::pluck(1) %>%
as_tibble() %>%
select(contains("Estimate.Pronoun")),
"1B" = exp1b_m_prod_reliability %>%
ranef() %>%
purrr::pluck(1) %>%
as_tibble() %>%
select(contains("Estimate.Pronoun"))
)) %>%
mutate(Correlation = case_when(
Experiment == "1A" & Task == "Memory" ~
str_c("<i>r = ", exp1_r_reliability["1A memory", "estimate"]),
Experiment == "1B" & Task == "Memory" ~
str_c("<i>r = ", exp1_r_reliability["1B memory", "estimate"]),
Experiment == "1A" & Task == "Production" ~
str_c("<i>r = ", exp1_r_reliability["1A production", "estimate"]),
Experiment == "1B" & Task == "Production" ~
str_c("<i>r = ", exp1_r_reliability["1B production", "estimate"])
))
(
ggplot() +
geom_point(
data = exp1_d_reliability %>% filter(Task == "Memory"),
aes(x = Estimate.Pronoun_Even, y = Estimate.Pronoun_Odd),
color = "#3288BD", size = 0.75
) +
geom_richtext(
data = exp1_d_reliability %>%
filter(Task == "Memory") %>%
select(Experiment, Correlation) %>%
unique(),
aes(label = Correlation, x = 0.65, y = -1)
) +
facet_wrap(~Experiment) +
theme_classic() +
dissertation_plot_theme +
gray_facet_theme +
labs(title = "Memory", x = "Even Trials", y = "Odd Trials")
) / (
ggplot() +
geom_point(
data = exp1_d_reliability %>% filter(Task == "Production"),
aes(x = Estimate.Pronoun_Even, y = Estimate.Pronoun_Odd),
color = "#3288BD", size = 0.75
) +
geom_richtext(
data = exp1_d_reliability %>%
filter(Task == "Production") %>%
select(Experiment, Correlation) %>%
unique(),
aes(label = Correlation, x = 2.5, y = -5)
) +
facet_wrap(~Experiment) +
theme_classic() +
dissertation_plot_theme +
gray_facet_theme +
labs(title = "Production", x = "Even Trials", y = "Odd Trials")
) +
plot_annotation(
title = "Experiments 1A & 1B: By-Participant Slope Estimates for Pronoun",
theme = patchwork_theme
)
```
## Experiment 2 {#sec-supplementary-exp2}
```{r}
#| label: load-workspace-exp2
load("r_data/exp2.RData")
```
### Pet & Job Questions {#sec-supplementary-exp2-pet-job}
As in Experiments 1A & 1B, memory for the characters' 12 jobs was analyzed in order to make sure the task did not show floor effects, and memory for the characters' 3 pets was analyzed as a less marked comparison to pronouns (@fig-exp2-job-pet). Averaged across conditions, accuracy for jobs (*M* = `r exp2_r_job$mean`) was numerically higher than in Experiments 1A (*M* = `r exp1a_r_job$mean`) and 1B (*M* = `r exp1b_r_job$mean`). Accuracy for pets was also higher in Experiment 2 (*M* = `r exp2_r_pet_means$mean`) than in Experiments 1A (*M* = `r exp1a_r_pet_means['all', 'mean']`) and 1B (*M* = `r exp1b_r_pet_means['all', 'mean']`). Job and pet accuracy did not vary based on the characters' pronouns or the PSA and Biography conditions.
Pronoun and pet questions were compared in a model including the Character's Pronouns (contrast coded as in the main analyses), the Question Type (mean-center effects coded), and the PSA and Biography conditions as fixed effects. The initial model included interactions between Character Pronoun, PSA, and Biography as in the main analyses; the interaction between Character Pronoun and Question Type; by-participant and by-item intercepts; and by-participant and by-item slopes for Character Pronoun and Question Type. In addition to the subset of interactions between fixed effects listed above, the most complex model that converged included by-participant intercepts, by-item intercepts, and by-item slopes for Question Type (@tbl-exp2-pet). Participants were significantly more accurate for pronoun questions than pet questions (`r exp2_r_pet['M_Type=Pet_Pronoun', 'Text']`), and the interaction between Character Pronoun (they/them vs he/him + she/her) and Question Type was significant (`r exp2_r_pet['M_Type=Pet_Pronoun:CharPronoun=They_HeShe', 'Text']`). Probing this interaction indicated that there was no significant difference in accuracy between pronouns and pets for they/them characters (`r exp2_r_pet_they['M_Type=Pet_Pronoun', 'Text']`), only for he/him + she/her characters (`r exp2_r_pet_heshe['M_Type=Pet_Pronoun', 'Text']`). This resembles the pattern of results in Experiment 1.
```{r}
#| label: fig-exp2-job-pet
#| fig-cap: "Experiment 2: Mean accuracy in the multiple-choice memory task for pronouns, pets, and jobs, with colors indicating the character’s pronouns. By-participant means are shown as points; error bars indicate 95% CIs calculated over the by-participant means."
#| fig-asp: 0.6
#| output: true
#| cache: true
exp2_d_all %>%
group_by(Participant, M_Type, Pronoun) %>%
summarise(M_Acc_Subj = mean(M_Acc)) %>% # by-subject means
ggplot(aes(x = M_Type, y = M_Acc_Subj, fill = Pronoun, color = Pronoun)) +
geom_point(
position = position_jitterdodge(
dodge.width = 0.9, jitter.width = 0.6, jitter.height = 0.01, seed = 1
),
size = 0.25, key_glyph = "rect" # make legend full saturation colors
) +
stat_summary(
fun.data = mean_cl_boot, geom = "bar",
position = position_dodge(width = 0.9), alpha = 0.4, color = NA
) +
stat_summary(
fun.data = mean_cl_boot, geom = "errorbar",
position = position_dodge(width = 0.9),
color = "black", linewidth = 0.5, width = 0.5
) +
scale_color_brewer(palette = "Dark2", guide = guide_none()) +
scale_fill_brewer(palette = "Dark2") +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0.02, 0.02)) +
theme_classic() +
dissertation_plot_theme +
theme(
legend.margin = margin(l = -10),
plot.margin = margin(t = 10, b = 5, l = 5, r = 5)
) +
guides(fill = guide_legend(byrow = TRUE)) +
labs(
title = "Experiment 2: All Memory Questions",
x = "Question Type",
y = "By-Participant Mean Accuracy",
fill = "Character\nPronouns"
)
```
| |
|-----------------------------------------------|
| **Experiment 2: Memory for Pronouns vs Pets** |
: Experiment 2: Model results for the effects of Character Pronoun, PSA, Biography, and Question Type (pronoun vs pet) on Memory Accuracy. {#tbl-exp2-pet .borderless}
```{r}
#| label: table-exp2-pet
#| output: true
exp2_tb_pets <- tab_model(
model = exp2_m_pet@model,
transform = NULL, show.stat = TRUE, string.stat = "z",
show.ci = FALSE, show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, digits = 3, digits.re = 3,
dv.labels = "Memory Accuracy",
pred.labels = c(
"M_Type=Pet_Pronoun" =
"<b>Question Type: Pet</b> (-.5) <b>vs Pronoun</b> (+.5)",
exp2_tb_fixed_labels
),
wrap.labels = 80, CSS = table_css
)
exp2_tb_pets$knitr %<>% exp2_tb_random_labels() %>%
str_replace("Name.M_Type=Pet_Pronoun", "Question Type | Name") %>%
drop_sigma()
exp2_tb_pets
```
### Additional Figures {#sec-supplementary-exp2-figures}
```{r}
#| label: fig-exp2-dist
#| fig-cap: "Experiment 2: Distribution of memory and production responses."
#| fig-asp: 1.25
#| output: true
#| cache: true
# memory
exp2_p_memory_dist <- exp2_d %>%
ggplot(aes(x = Pronoun, fill = M_Response)) +
geom_bar(position = "fill") +
facet_grid(Biography ~ PSA, labeller = labeller(
PSA = c("GenLang" = "Gendered Language PSA", "Unrelated" = "Unrelated PSA"),
Biography = c("They" = "They Bios", "HeShe" = "He/She Bios")
)) +
scale_fill_brewer(palette = "Dark2") +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0)) +
theme_classic() +
dissertation_plot_theme +
gray_facet_theme +
theme(legend.text = element_text(size = 11)) +
labs(
title = "Memory",
x = "Correct Pronoun",
y = "Proportion of Trials",
fill = "Pronoun\nSelected"
)
# production
exp2_p_prod_dist <- exp2_d %>%
ggplot(aes(x = Pronoun, fill = P_Response)) +
geom_bar(position = "fill") +
facet_grid(Biography ~ PSA, labeller = labeller(
PSA = c("GenLang" = "Gendered Language PSA", "Unrelated" = "Unrelated PSA"),
Biography = c("They" = "They Bios", "HeShe" = "He/She Bios")
)) +
scale_fill_brewer(palette = "Dark2") +
scale_x_discrete(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0)) +
theme_classic() +
dissertation_plot_theme +
gray_facet_theme +
theme(legend.text = element_text(size = 11)) +
labs(
title = "Production",
x = "Correct Pronoun",
y = "Proportion of Trials",
fill = "Pronoun\nProduced"
)
exp2_p_memory_dist / exp2_p_prod_dist +
plot_annotation(
title = "Experiment 2: Distribution of Responses",
tag_levels = "A",
theme = patchwork_theme
) +
plot_annotation(theme = theme(
plot.margin = margin(t = 5, b = 0, l = 5, r = -5)
))
```
### Additional Model Results {#sec-supplementary-exp2-tables}
| |
|------------------------------------------------|
| **Experiment 2: Memory Predicting Production** |
: Experiment 2: Model results for the effects of Pronoun, PSA, Biography, and Memory Accuracy on Production Accuracy. {#tbl-exp2-both .borderless}
```{r}
#| label: table-exp2-both
#| output: true
exp2_tb_mp <- tab_model(
model = exp2_m_mp@model,
transform = NULL, show.stat = TRUE, string.stat = "z",
show.ci = FALSE, show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, digits = 3, digits.re = 3,
dv.labels = "Production Accuracy", pred.labels = exp2_tb_fixed_labels,
wrap.labels = 80, CSS = table_css
)
exp2_tb_mp$knitr %<>% drop_sigma()
exp2_tb_mp
```
| |
|-------------------------------------------------|
| **Experiment 2: Production of Singular *They*** |
: Experiment 2: Model results for the effects of PSA and Biography on whether each participant produced singular *they* at least once. Participants were coded with a 1 if they produced singular *they* at least once in the written sentence completion task, regardless of accuracy, and with a 0 if they did not. {#tbl-exp2-prod-they .borderless}
```{r}
#| label: table-exp2-use-they
#| results: asis
exp2_tb_use_they <- tab_model(
model = exp2_m_use_they,
transform = NULL, show.stat = TRUE, string.stat = "z",
show.ci = FALSE, show.se = TRUE, string.se = "SE",
show.r2 = FALSE, show.icc = FALSE, digits = 3, digits.re = 3,
dv.labels = "Produce They/Them",
pred.labels = c(
"PSA=GenLang" =
"<b>PSA: Unrelated</b> (-.5) <b>vs PSA: Gendered Language</b> (+.5)",
exp2_tb_fixed_labels
),
wrap.labels = 80, CSS = table_css
)
cat(exp2_tb_use_they$knitr)
```
## Experiment 3 {#sec-supplementary-exp3}
```{r}
#| label: load-workspace-exp3
rm(list = ls(pattern = "exp1")) # clear 1 & 2 first
rm(list = ls(pattern = "exp2"))
load("r_data/exp3.RData")
```
### Norming Study {#sec-supplementary-norming}
| |
|--|
| |
: Image Norming: Results. Counts and proportions <br>of they/them, he/him, she/her, and no pronoun responses for <br>each [image](https://github.com/bethanyhgardner/dissertation/blob/main/materials/exp3/images.md) in the norming study. {#tbl-norming .borderless}
```{r ft.align="left"}
#| output: true
exp3_d_norming %>%
count(Pronoun, Image) %>% # count instances of pronouns for each image
pivot_wider(
names_from = Image, # pivot to have images as columns
values_from = n, # and pronouns as rows
values_fill = 0
) %>%
group_by(Pronoun) %>% # total for each pronoun across all images
mutate(Count = sum(across(starts_with("GS")))) %>%
ungroup() %>%
# proportion for each pronoun
mutate(Proportion = Count / sum(across(starts_with("GS")))) %>%
# rotate back to have images/total as rows
sjmisc::rotate_df(cn = TRUE, rn = "Image") %>%
mutate(.before = Image, Group = case_when( # sort into images used in study
str_detect(Image, "4|6|8|9|11|12") ~ "Images Included",
str_detect(Image, "01|02|3|5|7|10") ~ "Images Not Included",
str_detect(Image, "Count|Prop") ~ "Totals"
)) %>%
mutate(Image = str_remove(Image, ".png")) %>% # drop file extension
arrange(Group, `he/him`, desc(`she/her`)) %>% # order rows and cols for table
select(Group, Image, `they/them`, `he/him`, `she/her`, none) %>%
as_grouped_data(groups = "Group") %>%
flextable() %>% # table
set_header_labels(Group = "", Image = "Image Code") %>% # table labels
add_header_lines("Norming Study: Pronouns Produced") %>%
colformat_double(i = c(1:14, 17), digits = 0) %>% # rounding
colformat_double(i = 16, digits = 2) %>%
merge_h_range(i = c(1, 8, 15), j1 = 1, j2 = 6, part = "body") %>% # style
bold(i = 1, part = "header") %>%
italic(i = 2, part = "header") %>%