-
Notifications
You must be signed in to change notification settings - Fork 0
/
Four_protocols.html
19449 lines (19415 loc) · 842 KB
/
Four_protocols.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="Léa de Carolis & Christophe Coupé" />
<title>Analysis of sound symbolic associations across experimental protocols</title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css" data-origin="pandoc">
a.sourceLine { display: inline-block; line-height: 1.25; }
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
a.sourceLine:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode { white-space: pre; position: relative; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
code.sourceCode { white-space: pre-wrap; }
a.sourceLine { text-indent: -1em; padding-left: 1em; }
}
pre.numberSource a.sourceLine
{ position: relative; left: -4em; }
pre.numberSource a.sourceLine::before
{ content: attr(title);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; pointer-events: all; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
a.sourceLine::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
for (var j = 0; j < rules.length; j++) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") continue;
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') continue;
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<style type="text/css">body {
background-color: #fff;
margin: 1em auto;
max-width: 700px;
overflow: visible;
padding-left: 2em;
padding-right: 2em;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.35;
}
#TOC {
clear: both;
margin: 0 0 10px 10px;
padding: 4px;
width: 400px;
border: 1px solid #CCCCCC;
border-radius: 5px;
background-color: #f6f6f6;
font-size: 13px;
line-height: 1.3;
}
#TOC .toctitle {
font-weight: bold;
font-size: 15px;
margin-left: 5px;
}
#TOC ul {
padding-left: 40px;
margin-left: -1.5em;
margin-top: 5px;
margin-bottom: 5px;
}
#TOC ul ul {
margin-left: -2em;
}
#TOC li {
line-height: 16px;
}
table {
margin: 1em auto;
border-width: 1px;
border-color: #DDDDDD;
border-style: outset;
border-collapse: collapse;
}
table th {
border-width: 2px;
padding: 5px;
border-style: inset;
}
table td {
border-width: 1px;
border-style: inset;
line-height: 18px;
padding: 5px 5px;
}
table, table th, table td {
border-left-style: none;
border-right-style: none;
}
table thead, table tr.even {
background-color: #f7f7f7;
}
p {
margin: 0.5em 0;
}
blockquote {
background-color: #f6f6f6;
padding: 0.25em 0.75em;
}
hr {
border-style: solid;
border: none;
border-top: 1px solid #777;
margin: 28px 0;
}
dl {
margin-left: 0;
}
dl dd {
margin-bottom: 13px;
margin-left: 13px;
}
dl dt {
font-weight: bold;
}
ul {
margin-top: 0;
}
ul li {
list-style: circle outside;
}
ul ul {
margin-bottom: 0;
}
pre, code {
background-color: #f7f7f7;
border-radius: 3px;
color: #333;
white-space: pre-wrap;
}
pre {
border-radius: 3px;
margin: 5px 0px 10px 0px;
padding: 10px;
}
pre:not([class]) {
background-color: #f7f7f7;
}
code {
font-family: Consolas, Monaco, 'Courier New', monospace;
font-size: 85%;
}
p > code, li > code {
padding: 2px 0px;
}
div.figure {
text-align: center;
}
img {
background-color: #FFFFFF;
padding: 2px;
border: 1px solid #DDDDDD;
border-radius: 3px;
border: 1px solid #CCCCCC;
margin: 0 5px;
}
h1 {
margin-top: 0;
font-size: 35px;
line-height: 40px;
}
h2 {
border-bottom: 4px solid #f7f7f7;
padding-top: 10px;
padding-bottom: 2px;
font-size: 145%;
}
h3 {
border-bottom: 2px solid #f7f7f7;
padding-top: 10px;
font-size: 120%;
}
h4 {
border-bottom: 1px solid #f7f7f7;
margin-left: 8px;
font-size: 105%;
}
h5, h6 {
border-bottom: 1px solid #ccc;
font-size: 105%;
}
a {
color: #0033dd;
text-decoration: none;
}
a:hover {
color: #6666ff; }
a:visited {
color: #800080; }
a:visited:hover {
color: #BB00BB; }
a[href^="http:"] {
text-decoration: underline; }
a[href^="https:"] {
text-decoration: underline; }
code > span.kw { color: #555; font-weight: bold; }
code > span.dt { color: #902000; }
code > span.dv { color: #40a070; }
code > span.bn { color: #d14; }
code > span.fl { color: #d14; }
code > span.ch { color: #d14; }
code > span.st { color: #d14; }
code > span.co { color: #888888; font-style: italic; }
code > span.ot { color: #007020; }
code > span.al { color: #ff0000; font-weight: bold; }
code > span.fu { color: #900; font-weight: bold; }
code > span.er { color: #a61717; background-color: #e3d2d2; }
</style>
</head>
<body>
<h1 class="title toc-ignore">Analysis of sound symbolic associations across experimental protocols</h1>
<h4 class="author">Léa de Carolis & Christophe Coupé</h4>
<h4 class="date">Thu Sep 03 20:37:14 2020</h4>
<div id="TOC">
<ul>
<li><a href="#preparatory-steps-introduction">0. Preparatory steps & Introduction</a><ul>
<li><a href="#seeting-document-options">0.1. Seeting document options</a></li>
<li><a href="#loading-libraries">0.2. Loading libraries</a></li>
<li><a href="#hypotheses-tested-across-protocols">0.3. Hypotheses tested across protocols</a></li>
<li><a href="#a-word-of-cautious-regarding-the-statistical-analyses">0.4. A word of cautious regarding the statistical analyses</a></li>
<li><a href="#generic-functions-for-the-analyses">0.5. Generic functions for the analyses</a><ul>
<li><a href="#computations-of-mckelvey-zavoina-pseudo-r²-for-glm-and-polr-models">0.5.2. Computations of Mckelvey Zavoina pseudo-R² for glm and polr models</a></li>
<li><a href="#logistic-regressions">0.5.2. Logistic regressions</a></li>
<li><a href="#ordered-logistic-regressions">0.5.3. Ordered logistic regressions</a></li>
</ul></li>
<li><a href="#storing-the-main-results">0.6 Storing the main results</a></li>
</ul></li>
<li><a href="#x2-data">1. 2x2 data</a><ul>
<li><a href="#preparation-of-the-data">1.1. Preparation of the data</a></li>
<li><a href="#statistical-analyses">1.2. Statistical analyses</a><ul>
<li><a href="#hyp.-1-voiced-c---large-voiceless-c---small">Hyp. 1: Voiced C - large & Voiceless C - small</a></li>
<li><a href="#hyp.-2-i---small-a---large">Hyp. 2: [i] - small & [a] - large</a></li>
<li><a href="#hyp.-3-fricatives---fish-plosives---bird">Hyp. 3: Fricatives - fish & Plosives - bird</a></li>
<li><a href="#hyp.-4-a-or-u---fish-i---bird">Hyp. 4: [a] or [u] - fish & [i] - bird</a></li>
<li><a href="#hyp.-5-plosives-repulsive-sonorants-attractive">Hyp. 5: Plosives – repulsive & Sonorants – attractive</a></li>
<li><a href="#hyp.-6-a---repulsive-i---attractive">Hyp. 6: [a] - repulsive & [i] - attractive</a></li>
<li><a href="#hyp.-7-back-v---dangerous-front-v---harmless">Hyp. 7: Back V - dangerous & Front V - harmless</a></li>
<li><a href="#hyp.-8-voiced-c---dangerous-voiceless-c---harmless">Hyp. 8: Voiced C - dangerous & Voiceless C - harmless</a></li>
<li><a href="#hyp.-9-plosives---dangerous-sonorants---harmless">Hyp. 9: Plosives - dangerous & Sonorants - harmless</a></li>
<li><a href="#hyp.-10-back-c---dangerous-front-c---harmless">Hyp. 10: Back C - dangerous & Front C - harmless</a></li>
</ul></li>
</ul></li>
<li><a href="#x1-data">2. 2x1 data</a><ul>
<li><a href="#preparation-of-the-data-1">2.1. Preparation of the data</a></li>
<li><a href="#statistical-analyses-1">2.2. Statistical analyses</a><ul>
<li><a href="#hyp.-1-voiced-c---large-voiceless-c---small-1">Hyp. 1: Voiced C - large & Voiceless C - small</a></li>
<li><a href="#hyp.-2-i---small-a---large-1">Hyp. 2: [i] - small & [a] - large</a></li>
<li><a href="#hyp.-3-fricatives---fish-plosives---bird-1">Hyp. 3: Fricatives - fish & Plosives - bird</a></li>
<li><a href="#hyp.-4-a-or-u---fish-i---bird-1">Hyp. 4: [a] or [u] - fish & [i] - bird</a></li>
<li><a href="#hyp.-5-plosives-repulsive-sonorants-attractive-1">Hyp. 5: Plosives – repulsive & Sonorants – attractive</a></li>
<li><a href="#hyp.-6-a---repulsive-i---attractive-1">Hyp. 6: [a] - repulsive & [i] - attractive</a></li>
<li><a href="#hyp.-7-back-v---dangerous-front-v---harmless-1">Hyp. 7: Back V - dangerous & Front V - harmless</a></li>
<li><a href="#hyp.-8-voiced-c---dangerous-voiceless-c---harmless-1">Hyp. 8: Voiced C - dangerous & Voiceless C - harmless</a></li>
<li><a href="#hyp.-9-plosives---dangerous-sonorants---harmless-1">Hyp. 9: Plosives - dangerous & Sonorants - harmless</a></li>
<li><a href="#hyp.-10-back-c---dangerous-front-c---harmless-1">Hyp. 10: Back C - dangerous & Front C - harmless</a></li>
</ul></li>
</ul></li>
<li><a href="#x2-data-1">3. 1x2 data</a><ul>
<li><a href="#preparation-of-the-data-2">3.1. Preparation of the data</a></li>
<li><a href="#statistical-analyses-2">3.2. Statistical analyses</a><ul>
<li><a href="#hyp.-1-voiced-c---large-voiceless-c---small-2">Hyp. 1: Voiced C - large & Voiceless C - small</a></li>
<li><a href="#hyp.-2-i---small-a---large-2">Hyp. 2: [i] - small & [a] - large</a></li>
<li><a href="#hyp.-3-fricatives---fish-plosives---bird-2">Hyp. 3: Fricatives - fish & Plosives - bird</a></li>
<li><a href="#hyp.-4-a-or-u---fish-i---bird-2">Hyp. 4: [a] or [u] - fish & [i] - bird</a></li>
<li><a href="#hyp.-5-plosives-repulsive-sonorants-attractive-2">Hyp. 5: Plosives – repulsive & Sonorants – attractive</a></li>
<li><a href="#hyp.-6-a---repulsive-i---attractive-2">Hyp. 6: [a] - repulsive & [i] - attractive</a></li>
<li><a href="#hyp.-7-back-v---dangerous-front-v---harmless-2">Hyp. 7: Back V - dangerous & Front V - harmless</a></li>
<li><a href="#hyp.-8-voiced-c---dangerous-voiceless-c---harmless-2">Hyp. 8: Voiced C - dangerous & Voiceless C - harmless</a></li>
<li><a href="#hyp.-9-plosives---dangerous-sonorants---harmless-2">Hyp. 9: Plosives - dangerous & Sonorants - harmless</a></li>
<li><a href="#hyp.-10-back-c---dangerous-front-c---harmless-2">Hyp. 10: Back C - dangerous & Front C - harmless</a></li>
</ul></li>
</ul></li>
<li><a href="#x1-data-1">4. 1x1 data</a><ul>
<li><a href="#preparation-of-the-data-3">4.1. Preparation of the data</a></li>
<li><a href="#statistical-analyses-3">4.2. Statistical analyses</a><ul>
<li><a href="#hyp.-1-voiced-c---large-voiceless-c---small-3">Hyp. 1: Voiced C - large & Voiceless C - small</a></li>
<li><a href="#hyp.-2-i---small-a---large-3">Hyp. 2: [i] - small & [a] - large</a></li>
<li><a href="#hyp.-3-fricatives---fish-plosives---bird-3">Hyp. 3: Fricatives - fish & Plosives - bird</a></li>
<li><a href="#hyp.-4-a-or-u---fish-i---bird-3">Hyp. 4: [a] or [u] - fish & [i] - bird</a></li>
<li><a href="#hyp.-5-plosives-repulsive-sonorants-attractive-3">Hyp. 5: Plosives – repulsive & Sonorants – attractive</a></li>
<li><a href="#hyp.-6-a---repulsive-i---attractive-3">Hyp. 6: [a] - repulsive & [i] - attractive</a></li>
<li><a href="#hyp.-7-back-v---dangerous-front-v---harmless-3">Hyp. 7: Back V - dangerous & Front V - harmless</a></li>
<li><a href="#hyp.-8-voiced-c---dangerous-voiceless-c---harmless-3">Hyp. 8: Voiced C - dangerous & Voiceless C - harmless</a></li>
<li><a href="#hyp.-9-plosives---dangerous-sonorants---harmless-3">Hyp. 9: Plosives - dangerous & Sonorants - harmless</a></li>
<li><a href="#hyp.-10-back-c---dangerous-front-c---harmless-3">Hyp. 10: Back C - dangerous & Front C - harmless</a></li>
</ul></li>
</ul></li>
<li><a href="#synthesis-of-results">5. Synthesis of results</a><ul>
<li><a href="#tables-of-main-results">5.1 Tables of main results</a></li>
<li><a href="#comparison-of-effect-sizes-across-protocols">5.2 Comparison of effect sizes across protocols</a></li>
<li><a href="#comparison-of-within-trial-and-between-trial-conditions-in-2x2-and-1x2">5.3 Comparison of within-trial and between-trial conditions in 2x2 and 1x2</a></li>
<li><a href="#figures-for-the-interactions-between-target-contrast-and-context">5.4 Figures for the interactions between target contrast and context</a></li>
<li><a href="#distribution-of-answers-in-1x1">5.5 Distribution of answers in 1x1</a></li>
<li><a href="#comparisons-of-different-measures-of-effect-size">5.6 Comparisons of different measures of effect size</a></li>
</ul></li>
</ul>
</div>
<div id="preparatory-steps-introduction" class="section level1">
<h1>0. Preparatory steps & Introduction</h1>
<div id="seeting-document-options" class="section level2">
<h2>0.1. Seeting document options</h2>
<pre><code>## Warning: package 'knitr' was built under R version 4.0.2</code></pre>
<pre><code>Registered S3 method overwritten by 'pryr':
method from
print.bytes Rcpp</code></pre>
<pre><code>For best results, restart R session and update pander using devtools:: or remotes::install_github('rapporter/pander')</code></pre>
<style type="text/css">
img { background-color: transparent; border: 0; } .st-table td, .st-table th { padding: 8px; } .st-table > thead > tr { background-color: #eeeeee; } .st-cross-table td { text-align: center; } .st-descr-table td { text-align: right; } table.st-table th { text-align: center; } table.st-table > thead > tr { background-color: #eeeeee; } table.st-table td span { display: block; } table.st-table > tfoot > tr > td { border:none; } .st-container { width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; margin-top: 15px; } .st-multiline { white-space: pre; } .st-table { width: auto; table-layout: auto; margin-top: 20px; margin-bottom: 20px; max-width: 100%; background-color: transparent; border-collapse: collapse; } .st-table > thead > tr > th, .st-table > tbody > tr > th, .st-table > tfoot > tr > th, .st-table > thead > tr > td, .st-table > tbody > tr > td, .st-table > tfoot > tr > td { vertical-align: middle; } .st-table-bordered { border: 1px solid #bbbbbb; } .st-table-bordered > thead > tr > th, .st-table-bordered > tbody > tr > th, .st-table-bordered > thead > tr > td, .st-table-bordered > tbody > tr > td { border: 1px solid #cccccc; } .st-table-bordered > thead > tr > th, .st-table-bordered > thead > tr > td, .st-table thead > tr > th { border-bottom: none; } .st-freq-table > thead > tr > th, .st-freq-table > tbody > tr > th, .st-freq-table > tfoot > tr > th, .st-freq-table > thead > tr > td, .st-freq-table > tbody > tr > td, .st-freq-table > tfoot > tr > td, .st-freq-table-nomiss > thead > tr > th, .st-freq-table-nomiss > tbody > tr > th, .st-freq-table-nomiss > tfoot > tr > th, .st-freq-table-nomiss > thead > tr > td, .st-freq-table-nomiss > tbody > tr > td, .st-freq-table-nomiss > tfoot > tr > td, .st-cross-table > thead > tr > th, .st-cross-table > tbody > tr > th, .st-cross-table > tfoot > tr > th, .st-cross-table > thead > tr > td, .st-cross-table > tbody > tr > td, .st-cross-table > tfoot > tr > td { padding-left: 20px; padding-right: 20px; } .st-table-bordered > thead > tr > th, .st-table-bordered > tbody > tr > th, .st-table-bordered > thead > tr > td, .st-table-bordered > tbody > tr > td { border: 1px solid #cccccc; } .st-table-striped > tbody > tr:nth-of-type(odd) { background-color: #ffffff; } .st-table-striped > tbody > tr:nth-of-type(even) { background-color: #f9f9f9; } .st-descr-table > thead > tr > th, .st-descr-table > tbody > tr > th, .st-descr-table > thead > tr > td, .st-descr-table > tbody > tr > td { padding-left: 24px; padding-right: 24px; word-wrap: break-word; } .st-freq-table, .st-freq-table-nomiss, .st-cross-table { border: medium none; } .st-freq-table > thead > tr:nth-child(1) > th:nth-child(1), .st-cross-table > thead > tr:nth-child(1) > th:nth-child(1), .st-cross-table > thead > tr:nth-child(1) > th:nth-child(3) { border: none; background-color: #ffffff; text-align: center; } .st-protect-top-border { border-top: 1px solid #cccccc !important; } .st-ws-char { display: inline; color: #999999; letter-spacing: 0.2em; } /* Optionnal classes */ .st-small { font-size: 13px; } .st-small td, .st-small th { padding: 8px; } .st-small > thead > tr > th, .st-small > tbody > tr > th, .st-small > thead > tr > td, .st-small > tbody > tr > td { padding-left: 12px; padding-right: 12px; } </style>
</div>
<div id="loading-libraries" class="section level2">
<h2>0.2. Loading libraries</h2>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1"><span class="kw">library</span>(lme4) <span class="co"># For glm</span></a>
<a class="sourceLine" id="cb4-2" title="2"><span class="kw">library</span>(MASS) <span class="co"># For polr</span></a>
<a class="sourceLine" id="cb4-3" title="3"><span class="kw">library</span>(lsr) <span class="co"># For etaSquared</span></a>
<a class="sourceLine" id="cb4-4" title="4"><span class="kw">library</span>(Epi) <span class="co"># For twoby2</span></a>
<a class="sourceLine" id="cb4-5" title="5"><span class="kw">library</span>(car) <span class="co"># For Anova</span></a>
<a class="sourceLine" id="cb4-6" title="6"><span class="kw">library</span>(emmeans) <span class="co"># For emmeans</span></a>
<a class="sourceLine" id="cb4-7" title="7"><span class="kw">library</span>(questionr) <span class="co"># For Cramer's V</span></a>
<a class="sourceLine" id="cb4-8" title="8"><span class="kw">library</span>(rsq) <span class="co"># For rsq.partial</span></a>
<a class="sourceLine" id="cb4-9" title="9"><span class="kw">library</span>(scales) <span class="co"># To display percentages on the y-axis of a ggplot</span></a>
<a class="sourceLine" id="cb4-10" title="10"><span class="kw">library</span>(tidyverse) <span class="co"># For tidy</span></a>
<a class="sourceLine" id="cb4-11" title="11"><span class="kw">library</span>(kableExtra) <span class="co"># To format tables of results</span></a>
<a class="sourceLine" id="cb4-12" title="12"><span class="kw">library</span>(PerformanceAnalytics) <span class="co"># For correlation charts</span></a></code></pre></div>
<p>Setting the working directory</p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1">my_path <-<span class="st"> "D:/Dropbox/shared folders/Phonosymbolisme/Expe quatre protocoles/Final analysis"</span></a>
<a class="sourceLine" id="cb5-2" title="2"><span class="kw">setwd</span>(my_path)</a></code></pre></div>
<p>Setting the right contrasts for the regression models and the post-hoc tests</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" title="1"><span class="kw">options</span>(<span class="dt">contrasts=</span><span class="kw">c</span>(<span class="st">"contr.sum"</span>,<span class="st">"contr.poly"</span>)) <span class="co"># sum contrasts to get correct results with ANOVA (treatment contrasts lead to incorrect results)</span></a>
<a class="sourceLine" id="cb6-2" title="2"><span class="kw">emm_options</span>(<span class="dt">emmeans =</span> <span class="kw">list</span>(<span class="dt">type =</span> <span class="st">"response"</span>), <span class="dt">contrast =</span> <span class="kw">list</span>(<span class="dt">infer =</span> <span class="kw">c</span>(<span class="ot">TRUE</span>, <span class="ot">TRUE</span>))) <span class="co"># To get odd ratios with emmeans</span></a></code></pre></div>
<p>This <code>Rmarkdown</code> script and the resulting <code>HTML</code> document contain the full analysis upon which the paper is based.</p>
</div>
<div id="hypotheses-tested-across-protocols" class="section level2">
<h2>0.3. Hypotheses tested across protocols</h2>
<table>
<thead>
<tr class="header">
<th>Hypothesis</th>
<th>Concept</th>
<th>Association 1</th>
<th>Association 2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>1</td>
<td>Size</td>
<td>Voiced C – large</td>
<td>Voiceless C – small</td>
</tr>
<tr class="even">
<td>2</td>
<td>Size</td>
<td>[i] – small</td>
<td>[a] – large</td>
</tr>
<tr class="odd">
<td>3</td>
<td>Biological class</td>
<td>Fricatives – fish</td>
<td>Plosives – bird</td>
</tr>
<tr class="even">
<td>4</td>
<td>Biological class</td>
<td>[a] or [u] – fish</td>
<td>[i] – bird</td>
</tr>
<tr class="odd">
<td>5</td>
<td>Repulsiveness</td>
<td>Plosives – repulsive</td>
<td>Sonorants – attractive</td>
</tr>
<tr class="even">
<td>6</td>
<td>Repulsiveness</td>
<td>[a] – repulsive</td>
<td>[i] – attractive</td>
</tr>
<tr class="odd">
<td>7</td>
<td>Dangerousness</td>
<td>Back V – dangerous</td>
<td>Front V – harmless</td>
</tr>
<tr class="even">
<td>8</td>
<td>Dangerousness</td>
<td>Voiced C - dangerous</td>
<td>Voiceless C - harmless</td>
</tr>
<tr class="odd">
<td>9</td>
<td>Dangerousness</td>
<td>Plosives – dangerous</td>
<td>Sonorants – harmless</td>
</tr>
<tr class="even">
<td>10</td>
<td>Dangerousness</td>
<td>Back C – dangerous</td>
<td>Front C - harmless</td>
</tr>
</tbody>
</table>
</div>
<div id="a-word-of-cautious-regarding-the-statistical-analyses" class="section level2">
<h2>0.4. A word of cautious regarding the statistical analyses</h2>
<p>The odds ratio in fisher.test is conditional MLE, not unconditional MLE (= sample odds ratio) In glm, MLE are unconditional.</p>
<p>The partial R² computed for glm and polr models is Mckelvey Zavoina pseudo-R²</p>
<p>McKelvey, R. D., & Zavoina, W. (1975). A statistical model for the analysis of ordinal level dependent variables. The Journal of Mathematical Sociology, 4(1), 103–120</p>
</div>
<div id="generic-functions-for-the-analyses" class="section level2">
<h2>0.5. Generic functions for the analyses</h2>
<div id="computations-of-mckelvey-zavoina-pseudo-r²-for-glm-and-polr-models" class="section level3">
<h3>0.5.2. Computations of Mckelvey Zavoina pseudo-R² for glm and polr models</h3>
<p>For glm models:</p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" title="1">rsq.mz.glm <-<span class="st"> </span><span class="cf">function</span>(model) {</a>
<a class="sourceLine" id="cb7-2" title="2"> predicted.v <-<span class="st"> </span><span class="kw">predict</span>(model)</a>
<a class="sourceLine" id="cb7-3" title="3"> mean.predicted.v <-<span class="st"> </span><span class="kw">mean</span>(predicted.v)</a>
<a class="sourceLine" id="cb7-4" title="4"> ess <-<span class="st"> </span><span class="kw">sum</span>((predicted.v <span class="op">-</span><span class="st"> </span>mean.predicted.v)<span class="op">^</span><span class="dv">2</span>) <span class="op">/</span><span class="st"> </span><span class="kw">length</span>(predicted.v)</a>
<a class="sourceLine" id="cb7-5" title="5"> pi.var <-<span class="st"> </span>(pi<span class="op">^</span><span class="dv">2</span>)<span class="op">/</span><span class="dv">3</span></a>
<a class="sourceLine" id="cb7-6" title="6"> <span class="kw">return</span> (ess <span class="op">/</span><span class="st"> </span>(ess <span class="op">+</span><span class="st"> </span>pi.var))</a>
<a class="sourceLine" id="cb7-7" title="7">}</a></code></pre></div>
<p>For ordered logistic models:</p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" title="1">rsq.mz.polr <-<span class="st"> </span><span class="cf">function</span>(model) {</a>
<a class="sourceLine" id="cb8-2" title="2"> ess <-<span class="st"> </span><span class="kw">var</span>(model<span class="op">$</span>lp)</a>
<a class="sourceLine" id="cb8-3" title="3"> pi.var <-<span class="st"> </span>(pi<span class="op">^</span><span class="dv">2</span>)<span class="op">/</span><span class="dv">3</span></a>
<a class="sourceLine" id="cb8-4" title="4"> <span class="kw">return</span> (ess <span class="op">/</span><span class="st"> </span>(ess <span class="op">+</span><span class="st"> </span>pi.var))</a>
<a class="sourceLine" id="cb8-5" title="5">}</a></code></pre></div>
</div>
<div id="logistic-regressions" class="section level3">
<h3>0.5.2. Logistic regressions</h3>
<p>Display and analysis - contingency table</p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" title="1">analyze_contingency_table <-<span class="st"> </span><span class="cf">function</span>(hyp, variable) {</a>
<a class="sourceLine" id="cb9-2" title="2"> contingency_table <-<span class="st"> </span>hyp <span class="op">%>%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb9-3" title="3"><span class="st"> </span><span class="kw">group_by</span>(<span class="dt">.dots =</span> <span class="kw">c</span>(variable, <span class="st">"label"</span>)) <span class="op">%>%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb9-4" title="4"><span class="st"> </span><span class="kw">summarise</span>(<span class="dt">n =</span> <span class="kw">n</span>()) <span class="op">%>%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb9-5" title="5"><span class="st"> </span><span class="kw">spread</span>(<span class="dt">key =</span> label, <span class="dt">value =</span> n) <span class="op">%>%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb9-6" title="6"><span class="st"> </span><span class="kw">replace</span>(., <span class="kw">is.na</span>(.), <span class="dv">0</span>)</a>
<a class="sourceLine" id="cb9-7" title="7"> mat <-<span class="st"> </span><span class="kw">as.matrix</span>(contingency_table[,<span class="op">-</span><span class="dv">1</span>])</a>
<a class="sourceLine" id="cb9-8" title="8"> <span class="kw">rownames</span>(mat) <-<span class="st"> </span>contingency_table <span class="op">%>%</span><span class="st"> </span><span class="kw">pull</span>(variable)</a>
<a class="sourceLine" id="cb9-9" title="9"> twb <-<span class="st"> </span><span class="kw">twoby2</span>(mat, <span class="dt">print=</span>F)</a>
<a class="sourceLine" id="cb9-10" title="10"></a>
<a class="sourceLine" id="cb9-11" title="11"> twb<span class="op">$</span>table[,<span class="dv">1</span><span class="op">:</span><span class="dv">2</span>] <span class="op">%>%</span><span class="st"> </span><span class="kw">kable</span>(<span class="dt">digits=</span><span class="dv">4</span>) <span class="op">%>%</span><span class="st"> </span><span class="kw">print</span>()</a>
<a class="sourceLine" id="cb9-12" title="12"> twb<span class="op">$</span>measures <span class="op">%>%</span><span class="st"> </span><span class="kw">kable</span>(<span class="dt">digits=</span><span class="dv">4</span>) <span class="op">%>%</span><span class="st"> </span><span class="kw">print</span>()</a>
<a class="sourceLine" id="cb9-13" title="13"> <span class="kw">cat</span>(<span class="st">" </span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb9-14" title="14"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"Cramer's V (effect size): "</span>, <span class="kw">round</span>(<span class="kw">cramer.v</span>(mat), <span class="dv">3</span>)), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb9-15" title="15"> <span class="kw">cat</span>(<span class="st">" </span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb9-16" title="16"></a>
<a class="sourceLine" id="cb9-17" title="17"> <span class="kw">return</span>(<span class="kw">cramer.v</span>(mat))</a>
<a class="sourceLine" id="cb9-18" title="18">}</a></code></pre></div>
<p>Analysis - binomial regression model</p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" title="1">analyze_binomial <-<span class="st"> </span><span class="cf">function</span>(hyp, predictors) {</a>
<a class="sourceLine" id="cb10-2" title="2"> </a>
<a class="sourceLine" id="cb10-3" title="3"> <span class="co"># Assessing whether there is a single predictor</span></a>
<a class="sourceLine" id="cb10-4" title="4"> <span class="cf">if</span> (<span class="kw">length</span>(predictors) <span class="op">==</span><span class="st"> </span><span class="dv">1</span>) {</a>
<a class="sourceLine" id="cb10-5" title="5"> f.text <-<span class="st"> </span><span class="kw">paste</span>(<span class="st">"label"</span>, predictors[<span class="dv">1</span>], <span class="dt">sep =</span> <span class="st">" ~ "</span>)</a>
<a class="sourceLine" id="cb10-6" title="6"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"We run the binomial glm model '"</span>, f.text, <span class="st">"'</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb10-7" title="7"> </a>
<a class="sourceLine" id="cb10-8" title="8"> model.simple <-<span class="st"> </span><span class="kw">glm</span>(<span class="kw">as.formula</span>(f.text), <span class="dt">data=</span>hyp, <span class="dt">family=</span><span class="kw">binomial</span>())</a>
<a class="sourceLine" id="cb10-9" title="9"> anova.model.simple <-<span class="st"> </span><span class="kw">Anova</span>(model.simple, <span class="dt">type=</span><span class="st">"III"</span>) <span class="co"># ANOVA</span></a>
<a class="sourceLine" id="cb10-10" title="10"></a>
<a class="sourceLine" id="cb10-11" title="11"> R2 <-<span class="st"> </span><span class="kw">rsq.mz.glm</span>(model.simple)</a>
<a class="sourceLine" id="cb10-12" title="12"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"R2 = Effect size: "</span>, <span class="kw">round</span>(R2, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb10-13" title="13"> </a>
<a class="sourceLine" id="cb10-14" title="14"> <span class="kw">return</span>(<span class="kw">list</span>(<span class="dt">test.interaction =</span> F, <span class="dt">p.value.interaction =</span> <span class="ot">NA</span>,</a>
<a class="sourceLine" id="cb10-15" title="15"> <span class="dt">p.value.target =</span> anova.model.simple<span class="op">$</span><span class="st">'Pr(>Chisq)'</span>[<span class="dv">1</span>], <span class="dt">p.value.context =</span> <span class="ot">NA</span>, </a>
<a class="sourceLine" id="cb10-16" title="16"> <span class="dt">effect.size.target =</span> R2, <span class="dt">effect.size.context =</span> <span class="ot">NA</span>))</a>
<a class="sourceLine" id="cb10-17" title="17"> }</a>
<a class="sourceLine" id="cb10-18" title="18"> </a>
<a class="sourceLine" id="cb10-19" title="19"> <span class="co"># There must be two predictors</span></a>
<a class="sourceLine" id="cb10-20" title="20"> f.text <-<span class="st"> </span><span class="kw">paste</span>(<span class="st">"label"</span>, <span class="kw">paste</span>(predictors, <span class="dt">collapse =</span> <span class="st">" * "</span>), <span class="dt">sep =</span> <span class="st">" ~ "</span>)</a>
<a class="sourceLine" id="cb10-21" title="21"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"We run the binomial glm model '"</span>, f.text, <span class="st">"'</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb10-22" title="22"> </a>
<a class="sourceLine" id="cb10-23" title="23"> model.interaction <-<span class="st"> </span><span class="kw">glm</span>(<span class="kw">as.formula</span>(f.text), <span class="dt">data=</span>hyp, <span class="dt">family=</span><span class="kw">binomial</span>())</a>
<a class="sourceLine" id="cb10-24" title="24"> anova.model.interaction <-<span class="st"> </span><span class="kw">Anova</span>(model.interaction, <span class="dt">type=</span><span class="st">"III"</span>) <span class="co"># ANOVA</span></a>
<a class="sourceLine" id="cb10-25" title="25"> anova.model.interaction <span class="op">%>%</span><span class="st"> </span><span class="kw">kable</span>(<span class="dt">digits=</span><span class="dv">4</span>) <span class="op">%>%</span><span class="st"> </span><span class="kw">print</span>()</a>
<a class="sourceLine" id="cb10-26" title="26"> </a>
<a class="sourceLine" id="cb10-27" title="27"> p.value.interaction <-<span class="st"> </span><span class="kw">rev</span>(anova.model.interaction<span class="op">$</span><span class="st">'Pr(>Chisq)'</span>)[<span class="dv">1</span>]</a>
<a class="sourceLine" id="cb10-28" title="28"> test.interaction <-<span class="st"> </span>p.value.interaction <span class="op"><</span><span class="st"> </span><span class="fl">0.05</span></a>
<a class="sourceLine" id="cb10-29" title="29"></a>
<a class="sourceLine" id="cb10-30" title="30"> <span class="cf">if</span>(test.interaction) {</a>
<a class="sourceLine" id="cb10-31" title="31"> <span class="kw">cat</span>(<span class="st">" </span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb10-32" title="32"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"There is an interaction since the p-value for it is equal to "</span>, <span class="kw">round</span>(p.value.interaction, <span class="dt">digits=</span><span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb10-33" title="33"> </a>
<a class="sourceLine" id="cb10-34" title="34"> f.text.emm <-<span class="st"> </span><span class="kw">paste</span>(<span class="st">"pairwise"</span>, <span class="kw">paste</span>(predictors, <span class="dt">collapse =</span> <span class="st">" * "</span>), <span class="dt">sep =</span> <span class="st">" ~ "</span>)</a>
<a class="sourceLine" id="cb10-35" title="35"> emm <-<span class="st"> </span>model.interaction <span class="op">%>%</span><span class="st"> </span><span class="kw">emmeans</span>(<span class="kw">as.formula</span>(f.text.emm), <span class="dt">adjust=</span><span class="st">"none"</span>)</a>
<a class="sourceLine" id="cb10-36" title="36"> emm<span class="op">$</span>contrasts <span class="op">%>%</span><span class="st"> </span><span class="kw">kable</span>(<span class="dt">digits=</span><span class="dv">3</span>) <span class="op">%>%</span><span class="st"> </span><span class="kw">print</span>()</a>
<a class="sourceLine" id="cb10-37" title="37"> }</a>
<a class="sourceLine" id="cb10-38" title="38"> <span class="cf">else</span> {</a>
<a class="sourceLine" id="cb10-39" title="39"> <span class="kw">cat</span>(<span class="st">" </span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb10-40" title="40"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"There is no interaction since the p-value for the interaction is equal to "</span>, <span class="kw">round</span>(p.value.interaction, <span class="dt">digits=</span><span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb10-41" title="41"> }</a>
<a class="sourceLine" id="cb10-42" title="42"> </a>
<a class="sourceLine" id="cb10-43" title="43"> <span class="kw">cat</span>(<span class="st">"We compute the model without interaction</span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb10-44" title="44"></a>
<a class="sourceLine" id="cb10-45" title="45"> f.text <-<span class="st"> </span><span class="kw">paste0</span>(<span class="st">". ~ . - "</span>, <span class="kw">paste</span>(predictors, <span class="dt">collapse =</span> <span class="st">":"</span>))</a>
<a class="sourceLine" id="cb10-46" title="46"> model.no.interaction <-<span class="st"> </span><span class="kw">update</span>(model.interaction, <span class="kw">as.formula</span>(f.text))</a>
<a class="sourceLine" id="cb10-47" title="47"> anova.model.no.interaction <-<span class="st"> </span><span class="kw">Anova</span>(model.no.interaction, <span class="dt">type=</span><span class="st">"III"</span>) <span class="co"># ANOVA</span></a>
<a class="sourceLine" id="cb10-48" title="48"> R2.no.interaction <-<span class="st"> </span><span class="kw">rsq.mz.glm</span>(model.no.interaction)</a>
<a class="sourceLine" id="cb10-49" title="49"> </a>
<a class="sourceLine" id="cb10-50" title="50"> <span class="kw">cat</span>(<span class="st">"We compute the R² of the model without interaction and of two models without one predictor</span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb10-51" title="51"></a>
<a class="sourceLine" id="cb10-52" title="52"> f.text <-<span class="st"> </span><span class="kw">paste0</span>(<span class="st">". ~ . - "</span>, predictors[<span class="dv">1</span>])</a>
<a class="sourceLine" id="cb10-53" title="53"> model.no.first.predictor <-<span class="st"> </span><span class="kw">update</span>(model.no.interaction, <span class="kw">as.formula</span>(f.text))</a>
<a class="sourceLine" id="cb10-54" title="54"> anova.model.no.interaction <span class="op">%>%</span><span class="st"> </span><span class="kw">kable</span>(<span class="dt">digits=</span><span class="dv">4</span>) <span class="op">%>%</span><span class="st"> </span><span class="kw">print</span>()</a>
<a class="sourceLine" id="cb10-55" title="55"> <span class="kw">cat</span>(<span class="st">" </span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb10-56" title="56"> </a>
<a class="sourceLine" id="cb10-57" title="57"> R2.no.first.predictor <-<span class="st"> </span><span class="kw">rsq.mz.glm</span>(model.no.first.predictor)</a>
<a class="sourceLine" id="cb10-58" title="58"></a>
<a class="sourceLine" id="cb10-59" title="59"> f.text <-<span class="st"> </span><span class="kw">paste0</span>(<span class="st">". ~ . - "</span>, predictors[<span class="dv">2</span>])</a>
<a class="sourceLine" id="cb10-60" title="60"> model.no.second.predictor <-<span class="st"> </span><span class="kw">update</span>(model.no.interaction, <span class="kw">as.formula</span>(f.text))</a>
<a class="sourceLine" id="cb10-61" title="61"> R2.no.second.predictor <-<span class="st"> </span><span class="kw">rsq.mz.glm</span>(model.no.second.predictor)</a>
<a class="sourceLine" id="cb10-62" title="62"></a>
<a class="sourceLine" id="cb10-63" title="63"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"R² model without interaction: "</span>, <span class="kw">round</span>(R2.no.interaction, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb10-64" title="64"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"R² model without first predictor: "</span>, <span class="kw">round</span>(R2.no.first.predictor, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb10-65" title="65"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"R² model without second predictor: "</span>, <span class="kw">round</span>(R2.no.second.predictor, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb10-66" title="66"></a>
<a class="sourceLine" id="cb10-67" title="67"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"Effect size first predictor: "</span>, <span class="kw">round</span>(R2.no.interaction <span class="op">-</span><span class="st"> </span>R2.no.first.predictor, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb10-68" title="68"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"Effect size second predictor: "</span>, <span class="kw">round</span>(R2.no.interaction <span class="op">-</span><span class="st"> </span>R2.no.second.predictor, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb10-69" title="69"></a>
<a class="sourceLine" id="cb10-70" title="70"> <span class="kw">return</span>(<span class="kw">list</span>(<span class="dt">test.interaction =</span> test.interaction, <span class="dt">p.value.interaction =</span> p.value.interaction,</a>
<a class="sourceLine" id="cb10-71" title="71"> <span class="dt">p.value.target =</span> anova.model.no.interaction<span class="op">$</span><span class="st">'Pr(>Chisq)'</span>[<span class="dv">1</span>], <span class="dt">p.value.context =</span> anova.model.no.interaction<span class="op">$</span><span class="st">'Pr(>Chisq)'</span>[<span class="dv">2</span>], </a>
<a class="sourceLine" id="cb10-72" title="72"> <span class="dt">effect.size.target =</span> R2.no.interaction <span class="op">-</span><span class="st"> </span>R2.no.first.predictor, <span class="dt">effect.size.context =</span> R2.no.interaction <span class="op">-</span><span class="st"> </span>R2.no.second.predictor))</a>
<a class="sourceLine" id="cb10-73" title="73">}</a></code></pre></div>
</div>
<div id="ordered-logistic-regressions" class="section level3">
<h3>0.5.3. Ordered logistic regressions</h3>
<p>Display - 2x2 table of mean values</p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" title="1">analyze_means_table <-<span class="st"> </span><span class="cf">function</span>(hyp, variable) {</a>
<a class="sourceLine" id="cb11-2" title="2"> means_table <-<span class="st"> </span>hyp <span class="op">%>%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb11-3" title="3"><span class="st"> </span><span class="kw">group_by</span>(<span class="dt">.dots =</span> <span class="kw">c</span>(variable, <span class="st">"label"</span>)) <span class="op">%>%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb11-4" title="4"><span class="st"> </span><span class="kw">summarise</span>(<span class="dt">m =</span> <span class="kw">mean</span>(judgment)) <span class="op">%>%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb11-5" title="5"><span class="st"> </span><span class="kw">spread</span>(<span class="dt">key =</span> label, <span class="dt">value =</span> m) <span class="op">%>%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb11-6" title="6"><span class="st"> </span><span class="kw">replace</span>(., <span class="kw">is.na</span>(.), <span class="dv">0</span>)</a>
<a class="sourceLine" id="cb11-7" title="7"></a>
<a class="sourceLine" id="cb11-8" title="8"> means_table <span class="op">%>%</span><span class="st"> </span><span class="kw">kable</span>(<span class="dt">digits=</span><span class="dv">4</span>) <span class="op">%>%</span><span class="st"> </span><span class="kw">print</span>()</a>
<a class="sourceLine" id="cb11-9" title="9"></a>
<a class="sourceLine" id="cb11-10" title="10"> f.text <-<span class="st"> </span><span class="kw">paste0</span>(<span class="st">"judgment ~ label * "</span>, variable)</a>
<a class="sourceLine" id="cb11-11" title="11"> model.lm <-<span class="st"> </span><span class="kw">lm</span>(<span class="kw">as.formula</span>(f.text), <span class="dt">data=</span>hyp)</a>
<a class="sourceLine" id="cb11-12" title="12"> etasq <-<span class="st"> </span><span class="kw">etaSquared</span>(model.lm, <span class="dt">type=</span><span class="dv">3</span>)</a>
<a class="sourceLine" id="cb11-13" title="13"> <span class="kw">return</span>(etasq[<span class="dv">3</span>,<span class="dv">1</span>])</a>
<a class="sourceLine" id="cb11-14" title="14">}</a></code></pre></div>
<p>Analysis - Ordered logistic regression model</p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" title="1">analyze_ordered_logistic <-<span class="st"> </span><span class="cf">function</span>(hyp, predictors) {</a>
<a class="sourceLine" id="cb12-2" title="2"> </a>
<a class="sourceLine" id="cb12-3" title="3"> <span class="co"># Assessing whether there is a single predictor</span></a>
<a class="sourceLine" id="cb12-4" title="4"> <span class="cf">if</span> (<span class="kw">length</span>(predictors) <span class="op">==</span><span class="st"> </span><span class="dv">1</span>) {</a>
<a class="sourceLine" id="cb12-5" title="5"> f.text <-<span class="st"> </span><span class="kw">paste</span>(<span class="st">"response ~ label * "</span>, predictors[<span class="dv">1</span>])</a>
<a class="sourceLine" id="cb12-6" title="6"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"We run the ordered logistic regression model '"</span>, f.text, <span class="st">"'</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb12-7" title="7"> </a>
<a class="sourceLine" id="cb12-8" title="8"> model.simple <-<span class="st"> </span><span class="kw">polr</span>(<span class="kw">as.formula</span>(f.text), <span class="dt">data=</span>hyp)</a>
<a class="sourceLine" id="cb12-9" title="9"> anova.model.simple <-<span class="st"> </span><span class="kw">Anova</span>(model.simple, <span class="dt">type=</span><span class="st">"III"</span>) <span class="co"># ANOVA</span></a>
<a class="sourceLine" id="cb12-10" title="10"></a>
<a class="sourceLine" id="cb12-11" title="11"> anova.model.simple <span class="op">%>%</span><span class="st"> </span><span class="kw">kable</span>(<span class="dt">digits=</span><span class="dv">4</span>) <span class="op">%>%</span><span class="st"> </span><span class="kw">print</span>()</a>
<a class="sourceLine" id="cb12-12" title="12"></a>
<a class="sourceLine" id="cb12-13" title="13"> R2.simple <-<span class="st"> </span><span class="kw">rsq.mz.polr</span>(model.simple)</a>
<a class="sourceLine" id="cb12-14" title="14"> </a>
<a class="sourceLine" id="cb12-15" title="15"> f.text <-<span class="st"> </span><span class="kw">paste0</span>(<span class="st">". ~ . - label:"</span>, predictors[<span class="dv">1</span>])</a>
<a class="sourceLine" id="cb12-16" title="16"> model.reduced <-<span class="st"> </span><span class="kw">update</span>(model.simple, <span class="kw">as.formula</span>(f.text))</a>
<a class="sourceLine" id="cb12-17" title="17"> R2.reduced <-<span class="st"> </span><span class="kw">rsq.mz.polr</span>(model.reduced)</a>
<a class="sourceLine" id="cb12-18" title="18"> </a>
<a class="sourceLine" id="cb12-19" title="19"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"R² initial model: "</span>, <span class="kw">round</span>(R2.simple, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb12-20" title="20"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"R² model without the interaction: "</span>, <span class="kw">round</span>(R2.reduced, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb12-21" title="21"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"Effect size of the predictor: "</span>, <span class="kw">round</span>(R2.simple <span class="op">-</span><span class="st"> </span>R2.reduced, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb12-22" title="22"> </a>
<a class="sourceLine" id="cb12-23" title="23"> <span class="kw">return</span>(<span class="kw">list</span>(<span class="dt">test.interaction =</span> F, <span class="dt">p.value.interaction =</span> <span class="ot">NA</span>,</a>
<a class="sourceLine" id="cb12-24" title="24"> <span class="dt">p.value.target =</span> anova.model.simple<span class="op">$</span><span class="st">'Pr(>Chisq)'</span>[<span class="dv">3</span>], <span class="dt">p.value.context =</span> <span class="ot">NA</span>, </a>
<a class="sourceLine" id="cb12-25" title="25"> <span class="dt">effect.size.target =</span> R2.simple <span class="op">-</span><span class="st"> </span>R2.reduced, <span class="dt">effect.size.context =</span> <span class="ot">NA</span>))</a>
<a class="sourceLine" id="cb12-26" title="26"> }</a>
<a class="sourceLine" id="cb12-27" title="27"> </a>
<a class="sourceLine" id="cb12-28" title="28"> <span class="co"># There must be three predictors</span></a>
<a class="sourceLine" id="cb12-29" title="29"></a>
<a class="sourceLine" id="cb12-30" title="30"> f.text <-<span class="st"> </span><span class="kw">paste0</span>(<span class="st">"response ~ label * "</span>, <span class="kw">paste</span>(predictors, <span class="dt">collapse =</span> <span class="st">" * "</span>))</a>
<a class="sourceLine" id="cb12-31" title="31"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"We run the polr model '"</span>, f.text, <span class="st">"'</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb12-32" title="32"> model.interaction <-<span class="st"> </span><span class="kw">polr</span>(<span class="kw">as.formula</span>(f.text), <span class="dt">data=</span>hyp)</a>
<a class="sourceLine" id="cb12-33" title="33"> anova.model.interaction <-<span class="st"> </span><span class="kw">Anova</span>(model.interaction, <span class="dt">type=</span><span class="st">"III"</span>) <span class="co"># ANOVA</span></a>
<a class="sourceLine" id="cb12-34" title="34"> </a>
<a class="sourceLine" id="cb12-35" title="35"> anova.model.interaction <span class="op">%>%</span><span class="st"> </span><span class="kw">kable</span>(<span class="dt">digits=</span><span class="dv">4</span>) <span class="op">%>%</span><span class="st"> </span><span class="kw">print</span>()</a>
<a class="sourceLine" id="cb12-36" title="36"></a>
<a class="sourceLine" id="cb12-37" title="37"> p.value.interaction <-<span class="st"> </span>anova.model.interaction<span class="op">$</span><span class="st">'Pr(>Chisq)'</span>[<span class="dv">7</span>]</a>
<a class="sourceLine" id="cb12-38" title="38"> test.interaction <-<span class="st"> </span>p.value.interaction <span class="op"><</span><span class="st"> </span><span class="fl">0.05</span></a>
<a class="sourceLine" id="cb12-39" title="39"> </a>
<a class="sourceLine" id="cb12-40" title="40"> <span class="cf">if</span>(test.interaction) {</a>
<a class="sourceLine" id="cb12-41" title="41"> <span class="kw">cat</span>(<span class="st">" </span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb12-42" title="42"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"There is an triple interaction since the p-value for it is equal to "</span>, <span class="kw">round</span>(p.value.interaction, <span class="dt">digits=</span><span class="dv">4</span>), <span class="st">"</span><span class="ch">\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb12-43" title="43"></a>
<a class="sourceLine" id="cb12-44" title="44"> <span class="kw">assign</span>(<span class="st">"f.text"</span>, <span class="kw">paste0</span>(<span class="st">"response ~ label * "</span>, <span class="kw">paste</span>(predictors, <span class="dt">collapse =</span> <span class="st">" * "</span>)), <span class="dt">envir =</span> .GlobalEnv) <span class="co"># A trick for emmeans to work with a polr model in a function</span></a>
<a class="sourceLine" id="cb12-45" title="45"> f.text.emm <-<span class="st"> </span><span class="kw">paste0</span>(<span class="st">"pairwise ~ label * "</span>, <span class="kw">paste</span>(predictors, <span class="dt">collapse =</span> <span class="st">" * "</span>))</a>
<a class="sourceLine" id="cb12-46" title="46"> </a>
<a class="sourceLine" id="cb12-47" title="47"> emm <-<span class="st"> </span>model.interaction <span class="op">%>%</span><span class="st"> </span><span class="kw">emmeans</span>(<span class="kw">as.formula</span>(f.text.emm), <span class="dt">adjust=</span><span class="st">"none"</span>)</a>
<a class="sourceLine" id="cb12-48" title="48"> emm<span class="op">$</span>contrasts <span class="op">%>%</span><span class="st"> </span><span class="kw">kable</span>(<span class="dt">digits=</span><span class="dv">3</span>) <span class="op">%>%</span><span class="st"> </span><span class="kw">print</span>()</a>
<a class="sourceLine" id="cb12-49" title="49"> }</a>
<a class="sourceLine" id="cb12-50" title="50"> <span class="cf">else</span> {</a>
<a class="sourceLine" id="cb12-51" title="51"> <span class="kw">cat</span>(<span class="st">" </span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb12-52" title="52"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"There is no triple interaction since the p-value for it is equal to "</span>, <span class="kw">round</span>(p.value.interaction, <span class="dt">digits=</span><span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb12-53" title="53"> }</a>
<a class="sourceLine" id="cb12-54" title="54"></a>
<a class="sourceLine" id="cb12-55" title="55"> <span class="kw">cat</span>(<span class="st">"We compute the model without interaction</span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb12-56" title="56"></a>
<a class="sourceLine" id="cb12-57" title="57"> f.text <-<span class="st"> </span><span class="kw">paste0</span>(<span class="st">". ~ . - label:"</span>, <span class="kw">paste</span>(predictors, <span class="dt">collapse =</span> <span class="st">":"</span>))</a>
<a class="sourceLine" id="cb12-58" title="58"></a>
<a class="sourceLine" id="cb12-59" title="59"> model.no.interaction <-<span class="st"> </span><span class="kw">update</span>(model.interaction, <span class="kw">as.formula</span>(f.text))</a>
<a class="sourceLine" id="cb12-60" title="60"> anova.model.no.interaction <-<span class="st"> </span><span class="kw">Anova</span>(model.no.interaction, <span class="dt">type=</span><span class="st">"III"</span>) <span class="co"># ANOVA</span></a>
<a class="sourceLine" id="cb12-61" title="61"> anova.model.no.interaction <span class="op">%>%</span><span class="st"> </span><span class="kw">kable</span>(<span class="dt">digits=</span><span class="dv">4</span>) <span class="op">%>%</span><span class="st"> </span><span class="kw">print</span>()</a>
<a class="sourceLine" id="cb12-62" title="62"> <span class="kw">cat</span>(<span class="st">" </span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb12-63" title="63"> </a>
<a class="sourceLine" id="cb12-64" title="64"> R2.no.interaction <-<span class="st"> </span><span class="kw">rsq.mz.polr</span>(model.no.interaction)</a>
<a class="sourceLine" id="cb12-65" title="65"> </a>
<a class="sourceLine" id="cb12-66" title="66"> <span class="kw">cat</span>(<span class="st">"We compute the effect sizes of the full (without triple interaction) and two reduced models</span><span class="ch">\n\n</span><span class="st">"</span>)</a>
<a class="sourceLine" id="cb12-67" title="67"></a>
<a class="sourceLine" id="cb12-68" title="68"> f.text <-<span class="st"> </span><span class="kw">paste0</span>(<span class="st">". ~ . - label:"</span>, predictors[<span class="dv">1</span>])</a>
<a class="sourceLine" id="cb12-69" title="69"> model.no.first.predictor <-<span class="st"> </span><span class="kw">update</span>(model.no.interaction, <span class="kw">as.formula</span>(f.text))</a>
<a class="sourceLine" id="cb12-70" title="70"> R2.no.first.predictor <-<span class="st"> </span><span class="kw">rsq.mz.polr</span>(model.no.first.predictor)</a>
<a class="sourceLine" id="cb12-71" title="71"> </a>
<a class="sourceLine" id="cb12-72" title="72"> f.text <-<span class="st"> </span><span class="kw">paste0</span>(<span class="st">". ~ . - label:"</span>, predictors[<span class="dv">2</span>])</a>
<a class="sourceLine" id="cb12-73" title="73"> model.no.second.predictor <-<span class="st"> </span><span class="kw">update</span>(model.no.interaction, <span class="kw">as.formula</span>(f.text))</a>
<a class="sourceLine" id="cb12-74" title="74"> R2.no.second.predictor <-<span class="st"> </span><span class="kw">rsq.mz.polr</span>(model.no.second.predictor)</a>
<a class="sourceLine" id="cb12-75" title="75"> </a>
<a class="sourceLine" id="cb12-76" title="76"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"R² initial model: "</span>, <span class="kw">round</span>(R2.no.interaction, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb12-77" title="77"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"R² model without interaction including first predictor: "</span>, <span class="kw">round</span>(R2.no.first.predictor, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb12-78" title="78"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"R² model without interaction including second predictor: "</span>, <span class="kw">round</span>(R2.no.second.predictor, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb12-79" title="79"></a>
<a class="sourceLine" id="cb12-80" title="80"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"Effect size first predictor: "</span>, <span class="kw">round</span>(R2.no.interaction <span class="op">-</span><span class="st"> </span>R2.no.first.predictor, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb12-81" title="81"> <span class="kw">cat</span>(<span class="kw">paste0</span>(<span class="st">"Effect size second predictor: "</span>, <span class="kw">round</span>(R2.no.interaction <span class="op">-</span><span class="st"> </span>R2.no.second.predictor, <span class="dv">4</span>), <span class="st">"</span><span class="ch">\n\n</span><span class="st">"</span>))</a>
<a class="sourceLine" id="cb12-82" title="82"></a>
<a class="sourceLine" id="cb12-83" title="83"> <span class="kw">return</span>(<span class="kw">list</span>(<span class="dt">test.interaction =</span> test.interaction, <span class="dt">p.value.interaction =</span> p.value.interaction,</a>
<a class="sourceLine" id="cb12-84" title="84"> <span class="dt">p.value.target =</span> anova.model.no.interaction<span class="op">$</span><span class="st">'Pr(>Chisq)'</span>[<span class="dv">4</span>], <span class="dt">p.value.context =</span> anova.model.no.interaction<span class="op">$</span><span class="st">'Pr(>Chisq)'</span>[<span class="dv">5</span>], </a>
<a class="sourceLine" id="cb12-85" title="85"> <span class="dt">effect.size.target =</span> R2.no.interaction <span class="op">-</span><span class="st"> </span>R2.no.first.predictor, <span class="dt">effect.size.context =</span> R2.no.interaction <span class="op">-</span><span class="st"> </span>R2.no.second.predictor))</a>
<a class="sourceLine" id="cb12-86" title="86">}</a></code></pre></div>
</div>
</div>
<div id="storing-the-main-results" class="section level2">
<h2>0.6 Storing the main results</h2>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" title="1">results <-<span class="st"> </span><span class="kw">tibble</span>(<span class="dt">protocol =</span> <span class="kw">rep</span>(<span class="st">""</span>, <span class="dv">40</span>), <span class="dt">hypothesis =</span> <span class="kw">rep</span>(<span class="dv">0</span>, <span class="dv">40</span>), <span class="dt">concept =</span> <span class="kw">rep</span>(<span class="st">""</span>, <span class="dv">40</span>), </a>
<a class="sourceLine" id="cb13-2" title="2"> <span class="dt">label =</span> <span class="kw">rep</span>(<span class="st">""</span>, <span class="dv">40</span>), <span class="dt">contrast =</span> <span class="kw">rep</span>(<span class="st">""</span>, <span class="dv">40</span>), <span class="dt">context =</span> <span class="kw">rep</span>(<span class="st">""</span>, <span class="dv">40</span>),</a>
<a class="sourceLine" id="cb13-3" title="3"> <span class="dt">preliminary.effect.size =</span> <span class="kw">rep</span>(<span class="fl">0.0</span>, <span class="dv">40</span>), </a>
<a class="sourceLine" id="cb13-4" title="4"> <span class="dt">interaction =</span> <span class="kw">rep</span>(F, <span class="dv">40</span>), <span class="dt">p.value.interaction =</span> <span class="kw">rep</span>(<span class="fl">0.0</span>,<span class="dv">40</span>),</a>
<a class="sourceLine" id="cb13-5" title="5"> <span class="dt">p.value.target =</span> <span class="kw">rep</span>(<span class="fl">0.0</span>, <span class="dv">40</span>), <span class="dt">p.value.context =</span> <span class="kw">rep</span>(<span class="fl">0.0</span>, <span class="dv">40</span>),</a>
<a class="sourceLine" id="cb13-6" title="6"> <span class="dt">effect.size.target =</span> <span class="kw">rep</span>(<span class="fl">0.0</span>, <span class="dv">40</span>), <span class="dt">effect.size.context =</span> <span class="kw">rep</span>(<span class="fl">0.0</span>, <span class="dv">40</span>))</a></code></pre></div>
</div>
</div>
<div id="x2-data" class="section level1">
<h1>1. 2x2 data</h1>
<div id="preparation-of-the-data" class="section level2">
<h2>1.1. Preparation of the data</h2>
<p>Reading data:</p>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" title="1">expe22 <-<span class="st"> </span><span class="kw">read.table</span>(<span class="st">"2x2.txt"</span>, <span class="dt">sep =</span> <span class="st">"</span><span class="ch">\t</span><span class="st">"</span>, <span class="dt">header =</span> <span class="ot">TRUE</span>, <span class="dt">dec =</span> <span class="st">"."</span>, <span class="dt">stringsAsFactors =</span> T)</a>
<a class="sourceLine" id="cb14-2" title="2">expe22 <-<span class="st"> </span><span class="kw">as_tibble</span>(expe22) <span class="co"># Turning the data frame into a tibble</span></a></code></pre></div>
<p>Discarding training and trials without response (response time larger than 3000ms):</p>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb15-1" title="1">expe22 <-<span class="st"> </span>expe22 <span class="op">%>%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb15-2" title="2"><span class="st"> </span><span class="kw">filter</span>(trial_nb <span class="op">></span><span class="st"> </span><span class="dv">3</span>) <span class="op">%>%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb15-3" title="3"><span class="st"> </span><span class="kw">filter</span>(response_time <span class="op"><</span><span class="st"> </span><span class="dv">3000</span>) <span class="op">%>%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb15-4" title="4"><span class="st"> </span><span class="kw">droplevels</span>()</a></code></pre></div>
<p>Turning the variable subject_nr into a categorical variable:</p>
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb16-1" title="1">expe22 <-<span class="st"> </span>expe22 <span class="op">%>%</span><span class="st"> </span><span class="kw">mutate</span>(<span class="dt">subject_nr =</span> <span class="kw">as.factor</span>(subject_nr))</a></code></pre></div>
<p>Renaming variables to homogenize variable names across protocols for analysis:</p>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb17-1" title="1">expe22 <-<span class="st"> </span>expe22 <span class="op">%>%</span><span class="st"> </span><span class="kw">rename</span>(<span class="dt">label =</span> chosen_label) <span class="op">%>%</span></a>
<a class="sourceLine" id="cb17-2" title="2"><span class="st"> </span><span class="kw">rename</span>(<span class="dt">PW =</span> chosen_PW)</a></code></pre></div>
</div>
<div id="statistical-analyses" class="section level2">
<h2>1.2. Statistical analyses</h2>
<div id="hyp.-1-voiced-c---large-voiceless-c---small" class="section level3">
<h3>Hyp. 1: Voiced C - large & Voiceless C - small</h3>
<div class="container st-container">
<h3>Data Frame Summary</h3>
<strong>
hyp
<br/>
</strong>
<strong>Dimensions</strong>: 40 x 7
<br/><strong>Duplicates</strong>: 36
<br/>
<table class="table table-striped table-bordered st-table st-table-striped st-table-bordered st-multiline ">
<thead>
<tr>
<th align="center" class="st-protect-top-border"><strong>No</strong></th>
<th align="center" class="st-protect-top-border"><strong>Variable</strong></th>
<th align="center" class="st-protect-top-border"><strong>Stats / Values</strong></th>
<th align="center" class="st-protect-top-border"><strong>Freqs (% of Valid)</strong></th>
<th align="center" class="st-protect-top-border"><strong>Graph</strong></th>
<th align="center" class="st-protect-top-border"><strong>Missing</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">1</td>
<td align="left">context
[factor]</td>
<td align="left">1. a_a_
2. i_i_</td>
<td align="left" style="padding:0;vertical-align:middle"><table style="border-collapse:collapse;border:none;margin:0"><tr style="background-color:transparent"><td style="padding:0 5px 0 7px;margin:0;border:0" align="right">20</td><td style="padding:0 2px 0 0;border:0;" align="left">(</td><td style="padding:0;border:0" align="right">50.0%</td><td style="padding:0 4px 0 2px;border:0" align="left">)</td></tr><tr style="background-color:transparent"><td style="padding:0 5px 0 7px;margin:0;border:0" align="right">20</td><td style="padding:0 2px 0 0;border:0;" align="left">(</td><td style="padding:0;border:0" align="right">50.0%</td><td style="padding:0 4px 0 2px;border:0" align="left">)</td></tr></table></td>
<td align="left" style="vertical-align:middle;padding:0;background-color:transparent"><img style="border:none;background-color:transparent;padding:0" src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAEQAAAAtBAMAAADlxtATAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEX////9/v2mpqb39/f///+DdZCQAAAAAnRSTlMAAHaTzTgAAAABYktHRACIBR1IAAAAB3RJTUUH5AkEBCURRjle2wAAACxJREFUOMtjYBhcQAkPgCpRNsYJjEaVjDAlRKQXQTyAqkpG0+6oEiqn3cECAKESuc9GTnO9AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA5LTAzVDIwOjM3OjE3KzA4OjAwrf7g9wAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wOS0wM1QyMDozNzoxNyswODowMNyjWEsAAAAASUVORK5CYII="></td>
<td align="center">0
(0%)</td>
</tr>
<tr>
<td align="center">2</td>
<td align="left">contrast
[factor]</td>
<td align="left">1. p-b</td>
<td align="left" style="padding:0;vertical-align:middle"><table style="border-collapse:collapse;border:none;margin:0"><tr style="background-color:transparent"><td style="padding:0 5px 0 7px;margin:0;border:0" align="right">40</td><td style="padding:0 2px 0 0;border:0;" align="left">(</td><td style="padding:0;border:0" align="right">100.0%</td><td style="padding:0 4px 0 2px;border:0" align="left">)</td></tr></table></td>
<td align="left" style="vertical-align:middle;padding:0;background-color:transparent"><img style="border:none;background-color:transparent;padding:0" src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAHoAAAAZCAQAAABUMPKbAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfkCQQEJRFGOV7bAAAAUElEQVRYw+3YsQ4AEAwAURWD//9aGyOLUSS9u4mtL41FzMKr/h5AtOh3tfMyEj/wHvuM3LRoSqIpiaYkmpJoSqIpiaaEREfif4NryE2LprQASQ8EMdT7kM8AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDktMDNUMjA6Mzc6MTcrMDg6MDCt/uD3AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTA5LTAzVDIwOjM3OjE3KzA4OjAw3KNYSwAAAABJRU5ErkJggg=="></td>
<td align="center">0
(0%)</td>
</tr>
<tr>
<td align="center">3</td>
<td align="left">C
[factor]</td>
<td align="left">1. b
2. p</td>
<td align="left" style="padding:0;vertical-align:middle"><table style="border-collapse:collapse;border:none;margin:0"><tr style="background-color:transparent"><td style="padding:0 5px 0 7px;margin:0;border:0" align="right">20</td><td style="padding:0 2px 0 0;border:0;" align="left">(</td><td style="padding:0;border:0" align="right">50.0%</td><td style="padding:0 4px 0 2px;border:0" align="left">)</td></tr><tr style="background-color:transparent"><td style="padding:0 5px 0 7px;margin:0;border:0" align="right">20</td><td style="padding:0 2px 0 0;border:0;" align="left">(</td><td style="padding:0;border:0" align="right">50.0%</td><td style="padding:0 4px 0 2px;border:0" align="left">)</td></tr></table></td>
<td align="left" style="vertical-align:middle;padding:0;background-color:transparent"><img style="border:none;background-color:transparent;padding:0" src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAEQAAAAtBAMAAADlxtATAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEX////9/v2mpqb39/f///+DdZCQAAAAAnRSTlMAAHaTzTgAAAABYktHRACIBR1IAAAAB3RJTUUH5AkEBCUS3zAPYQAAACxJREFUOMtjYBhcQAkPgCpRNsYJjEaVjDAlRKQXQTyAqkpG0+6oEiqn3cECAKESuc9GTnO9AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA5LTAzVDIwOjM3OjE4KzA4OjAwW7aQHgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wOS0wM1QyMDozNzoxOCswODowMCrrKKIAAAAASUVORK5CYII="></td>
<td align="center">0
(0%)</td>
</tr>
<tr>
<td align="center">4</td>
<td align="left">V
[factor]</td>
<td align="left">1. a
2. i</td>
<td align="left" style="padding:0;vertical-align:middle"><table style="border-collapse:collapse;border:none;margin:0"><tr style="background-color:transparent"><td style="padding:0 5px 0 7px;margin:0;border:0" align="right">20</td><td style="padding:0 2px 0 0;border:0;" align="left">(</td><td style="padding:0;border:0" align="right">50.0%</td><td style="padding:0 4px 0 2px;border:0" align="left">)</td></tr><tr style="background-color:transparent"><td style="padding:0 5px 0 7px;margin:0;border:0" align="right">20</td><td style="padding:0 2px 0 0;border:0;" align="left">(</td><td style="padding:0;border:0" align="right">50.0%</td><td style="padding:0 4px 0 2px;border:0" align="left">)</td></tr></table></td>
<td align="left" style="vertical-align:middle;padding:0;background-color:transparent"><img style="border:none;background-color:transparent;padding:0" src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAEQAAAAtBAMAAADlxtATAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEX////9/v2mpqb39/f///+DdZCQAAAAAnRSTlMAAHaTzTgAAAABYktHRACIBR1IAAAAB3RJTUUH5AkEBCUS3zAPYQAAACxJREFUOMtjYBhcQAkPgCpRNsYJjEaVjDAlRKQXQTyAqkpG0+6oEiqn3cECAKESuc9GTnO9AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA5LTAzVDIwOjM3OjE4KzA4OjAwW7aQHgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wOS0wM1QyMDozNzoxOCswODowMCrrKKIAAAAASUVORK5CYII="></td>
<td align="center">0
(0%)</td>
</tr>
<tr>
<td align="center">5</td>
<td align="left">mode
[factor]</td>
<td align="left">1. plosive</td>
<td align="left" style="padding:0;vertical-align:middle"><table style="border-collapse:collapse;border:none;margin:0"><tr style="background-color:transparent"><td style="padding:0 5px 0 7px;margin:0;border:0" align="right">40</td><td style="padding:0 2px 0 0;border:0;" align="left">(</td><td style="padding:0;border:0" align="right">100.0%</td><td style="padding:0 4px 0 2px;border:0" align="left">)</td></tr></table></td>
<td align="left" style="vertical-align:middle;padding:0;background-color:transparent"><img style="border:none;background-color:transparent;padding:0" src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAHoAAAAZCAQAAABUMPKbAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfkCQQEJRLfMA9hAAAAUElEQVRYw+3YsQ4AEAwAURWD//9aGyOLUSS9u4mtL41FzMKr/h5AtOh3tfMyEj/wHvuM3LRoSqIpiaYkmpJoSqIpiaaEREfif4NryE2LprQASQ8EMdT7kM8AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDktMDNUMjA6Mzc6MTgrMDg6MDBbtpAeAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTA5LTAzVDIwOjM3OjE4KzA4OjAwKusoogAAAABJRU5ErkJggg=="></td>
<td align="center">0
(0%)</td>
</tr>
<tr>
<td align="center">6</td>
<td align="left">place
[factor]</td>
<td align="left">1. anterior</td>
<td align="left" style="padding:0;vertical-align:middle"><table style="border-collapse:collapse;border:none;margin:0"><tr style="background-color:transparent"><td style="padding:0 5px 0 7px;margin:0;border:0" align="right">40</td><td style="padding:0 2px 0 0;border:0;" align="left">(</td><td style="padding:0;border:0" align="right">100.0%</td><td style="padding:0 4px 0 2px;border:0" align="left">)</td></tr></table></td>
<td align="left" style="vertical-align:middle;padding:0;background-color:transparent"><img style="border:none;background-color:transparent;padding:0" src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAHoAAAAZCAQAAABUMPKbAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfkCQQEJRLfMA9hAAAAUElEQVRYw+3YsQ4AEAwAURWD//9aGyOLUSS9u4mtL41FzMKr/h5AtOh3tfMyEj/wHvuM3LRoSqIpiaYkmpJoSqIpiaaEREfif4NryE2LprQASQ8EMdT7kM8AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDktMDNUMjA6Mzc6MTgrMDg6MDBbtpAeAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTA5LTAzVDIwOjM3OjE4KzA4OjAwKusoogAAAABJRU5ErkJggg=="></td>
<td align="center">0
(0%)</td>
</tr>
<tr>
<td align="center">7</td>
<td align="left">voicing
[factor]</td>
<td align="left">1. voiced
2. voiceless</td>
<td align="left" style="padding:0;vertical-align:middle"><table style="border-collapse:collapse;border:none;margin:0"><tr style="background-color:transparent"><td style="padding:0 5px 0 7px;margin:0;border:0" align="right">20</td><td style="padding:0 2px 0 0;border:0;" align="left">(</td><td style="padding:0;border:0" align="right">50.0%</td><td style="padding:0 4px 0 2px;border:0" align="left">)</td></tr><tr style="background-color:transparent"><td style="padding:0 5px 0 7px;margin:0;border:0" align="right">20</td><td style="padding:0 2px 0 0;border:0;" align="left">(</td><td style="padding:0;border:0" align="right">50.0%</td><td style="padding:0 4px 0 2px;border:0" align="left">)</td></tr></table></td>
<td align="left" style="vertical-align:middle;padding:0;background-color:transparent"><img style="border:none;background-color:transparent;padding:0" src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAEQAAAAtBAMAAADlxtATAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEX////9/v2mpqb39/f///+DdZCQAAAAAnRSTlMAAHaTzTgAAAABYktHRACIBR1IAAAAB3RJTUUH5AkEBCUS3zAPYQAAACxJREFUOMtjYBhcQAkPgCpRNsYJjEaVjDAlRKQXQTyAqkpG0+6oEiqn3cECAKESuc9GTnO9AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA5LTAzVDIwOjM3OjE4KzA4OjAwW7aQHgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wOS0wM1QyMDozNzoxOCswODowMCrrKKIAAAAASUVORK5CYII="></td>
<td align="center">0
(0%)</td>
</tr>
</tbody>
</table>
</div>
<table>
<thead>
<tr>
<th style="text-align:left;">
</th>
<th style="text-align:right;">
a_large_animal
</th>
<th style="text-align:right;">
a_small_animal
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
b
</td>
<td style="text-align:right;">
12
</td>
<td style="text-align:right;">
8
</td>
</tr>
<tr>
<td style="text-align:left;">
p
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
19
</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th style="text-align:left;">
</th>
<th style="text-align:right;">
</th>
<th style="text-align:right;">
95% conf.
</th>
<th style="text-align:right;">
interval
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
Relative Risk:
</td>
<td style="text-align:right;">
12.0000
</td>
<td style="text-align:right;">
1.7183
</td>
<td style="text-align:right;">
83.8030
</td>
</tr>
<tr>
<td style="text-align:left;">
Sample Odds Ratio:
</td>
<td style="text-align:right;">
28.5000
</td>
<td style="text-align:right;">
3.1551
</td>
<td style="text-align:right;">
257.4435
</td>
</tr>
<tr>
<td style="text-align:left;">
Conditional MLE Odds Ratio:
</td>
<td style="text-align:right;">
25.9804
</td>
<td style="text-align:right;">
2.9870
</td>
<td style="text-align:right;">
1270.0215
</td>
</tr>
<tr>
<td style="text-align:left;">
Probability difference:
</td>
<td style="text-align:right;">
0.5500
</td>
<td style="text-align:right;">
0.2668
</td>
<td style="text-align:right;">
0.7358
</td>
</tr>
</tbody>
</table>
<p>Cramer’s V (effect size): 0.587</p>
<p>We run the binomial glm model ‘label ~ C * V’</p>
<table>
<thead>
<tr>
<th style="text-align:left;">
</th>
<th style="text-align:right;">
LR Chisq
</th>
<th style="text-align:right;">
Df
</th>
<th style="text-align:right;">
Pr(>Chisq)
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
C
</td>
<td style="text-align:right;">
17.8328
</td>
<td style="text-align:right;">
1
</td>
<td style="text-align:right;">
0.0000
</td>