-
Notifications
You must be signed in to change notification settings - Fork 0
/
Covariation_monophthongs_analysis.html
4694 lines (4303 loc) · 327 KB
/
Covariation_monophthongs_analysis.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="author" content="James Brand1, Jen Hay1,2, Lynn Clark1,2, Kevin Watson1,2 & Márton Sóskuthy3 1New Zealand Institute for Language, Brain and Behaviour, Univeristy of Canterbury, NZ 2Department of Linguistics, Univeristy of Canterbury, NZ 3Department of Linguistics, The University of British Columbia, CA Corresponding author: James Brand Email: james.brand@canterbury.ac.nz Website: https://jamesbrandscience.github.io" />
<title>Systematic co-variation of monophthongs across speakers of New Zealand English</title>
<script src="libs/header-attrs-2.9/header-attrs.js"></script>
<script src="libs/jquery-3.5.1/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="libs/bootstrap-3.3.5/css/cosmo.min.css" rel="stylesheet" />
<script src="libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<style>h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }</style>
<script src="libs/jqueryui-1.11.4/jquery-ui.min.js"></script>
<link href="libs/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
<script src="libs/tocify-1.9.1/jquery.tocify.js"></script>
<script src="libs/navigation-1.1/tabsets.js"></script>
<script src="libs/navigation-1.1/codefolding.js"></script>
<link href="libs/highlightjs-9.12.0/default.css" rel="stylesheet" />
<script src="libs/highlightjs-9.12.0/highlight.js"></script>
<link href="libs/pagedtable-1.1/css/pagedtable.css" rel="stylesheet" />
<script src="libs/pagedtable-1.1/js/pagedtable.js"></script>
<script src="libs/kePrint-0.0.1/kePrint.js"></script>
<link href="libs/lightable-0.0.1/lightable.css" rel="stylesheet" />
<script src="libs/htmlwidgets-1.5.3/htmlwidgets.js"></script>
<link href="libs/datatables-css-0.0.0/datatables-crosstalk.css" rel="stylesheet" />
<script src="libs/datatables-binding-0.18/datatables.js"></script>
<link href="libs/dt-core-1.10.20/css/jquery.dataTables.min.css" rel="stylesheet" />
<link href="libs/dt-core-1.10.20/css/jquery.dataTables.extra.css" rel="stylesheet" />
<script src="libs/dt-core-1.10.20/js/jquery.dataTables.min.js"></script>
<link href="libs/crosstalk-1.1.1/css/crosstalk.css" rel="stylesheet" />
<script src="libs/crosstalk-1.1.1/js/crosstalk.min.js"></script>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">code{white-space: pre;}</style>
<script type="text/javascript">
if (window.hljs) {
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
if (document.readyState && document.readyState === "complete") {
window.setTimeout(function() { hljs.initHighlighting(); }, 0);
}
}
</script>
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
pre code {
padding: 0;
}
</style>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "";
border: none;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- code folding -->
<style type="text/css">
.code-folding-btn { margin-bottom: 4px; }
</style>
<style type="text/css">
#TOC {
margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#TOC {
position: relative;
width: 100%;
}
}
@media print {
.toc-content {
/* see https://github.com/w3c/csswg-drafts/issues/4434 */
float: right;
}
}
.toc-content {
padding-left: 30px;
padding-right: 40px;
}
div.main-container {
max-width: 1200px;
}
div.tocify {
width: 20%;
max-width: 260px;
max-height: 85%;
}
@media (min-width: 768px) and (max-width: 991px) {
div.tocify {
width: 25%;
}
}
@media (max-width: 767px) {
div.tocify {
width: 100%;
max-width: none;
}
}
.tocify ul, .tocify li {
line-height: 20px;
}
.tocify-subheader .tocify-item {
font-size: 0.90em;
}
.tocify .list-group-item {
border-radius: 0px;
}
</style>
</head>
<body>
<div class="container-fluid main-container">
<!-- setup 3col/9col grid for toc_float and main content -->
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="TOC" class="tocify">
</div>
</div>
<div class="toc-content col-xs-12 col-sm-8 col-md-9">
<div id="header">
<div class="btn-group pull-right float-right">
<button type="button" class="btn btn-default btn-xs btn-secondary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span>Code</span> <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right" style="min-width: 50px;">
<li><a id="rmd-show-all-code" href="#">Show All Code</a></li>
<li><a id="rmd-hide-all-code" href="#">Hide All Code</a></li>
</ul>
</div>
<h1 class="title toc-ignore">Systematic co-variation of monophthongs across speakers of New Zealand English</h1>
<h3 class="subtitle">Supplementary materials: <em>Analysis script</em></h3>
<h4 class="author">James Brand<sup>1</sup>, Jen Hay<sup>1,2</sup>, Lynn Clark<sup>1,2</sup>, Kevin Watson<sup>1,2</sup> & Márton Sóskuthy<sup>3</sup><br><br/> <sup>1</sup>New Zealand Institute for Language, Brain and Behaviour, Univeristy of Canterbury, NZ<br> <sup>2</sup>Department of Linguistics, Univeristy of Canterbury, NZ<br><sup>3</sup>Department of Linguistics, The University of British Columbia, CA<br/><br/>Corresponding author: James Brand<br/>Email: <a href="mailto:james.brand@canterbury.ac.nz" class="email">james.brand@canterbury.ac.nz</a><br/>Website: <a href="https://jamesbrandscience.github.io" class="uri">https://jamesbrandscience.github.io</a></h4>
<h4 class="date">13 July, 2021</h4>
</div>
<!-- set the colour scheme of the html file -->
<style>
.list-group-item.active, .list-group-item.active:focus, .list-group-item.active:hover {
background-color: #95A044;
}
</style>
<div id="document-outline" class="section level1">
<h1>Document outline</h1>
<p>This document provides the code used in the analyses of the Brand, Hay, Clark, Watson and Sóskuthy (2020) manuscript, submitted to the Journal of Phonetics. It contains the various analysis steps reported in the paper, as well as additional analyses that the authors completed but were not considered central to the manuscript’s core research questions, they are included here in case readers are interested.</p>
<p>Whilst every attempt has been made to make the code transparent, clear and comprehensible to all readers, regardless of your proficiency with using R or the statistical procedures applied in the analyses, if there are questions/queries/issues that do arise, please do contact the corresponding author (contact details at the top of the document).</p>
<p>Note that in the project repository, large and computationally expensive processes, such as the GAMM modelling, have been pre-run and important data stored in the <code>Data</code> folder. This has been done to ensure the compilation of this file is achieved relatively quickly and can be hosted online (i.e. via GitHub and OSF), in addition to allowing others to have quick access to all the required data. These steps are included in this file and can be run on your own computer to reproduce all the original files. When pre-run steps have been carried out, they are identifiable in the <code>.Rmd</code> file by the chunks having an <code>eval=FALSE</code> argument. If you are running these chunks, please ensure you have sufficient memory avialable (I require 13.18GB to store the <code>Analysis</code> folder, when all models are saved).</p>
<pre class="r"><code>cat(paste0("Start time:\n", format(Sys.time(), "%d %B %Y, %r")))</code></pre>
<pre><code>## Start time:
## 13 July 2021, 05:23:11 pm</code></pre>
<pre class="r"><code>start_time <- Sys.time()</code></pre>
</div>
<div id="analysis-steps" class="section level1">
<h1>Analysis steps</h1>
<p>The document covers a number of steps that we completed, all of which can be reproduced by using the code and data in the project repository (<a href="https://github.com/nzilbb/Covariation_monophthongs_NZE" class="uri">https://github.com/nzilbb/Covariation_monophthongs_NZE</a>). In order to orientate the reader, we provide a brief written outline of what the steps are.</p>
<ol style="list-style-type: decimal">
<li><p>Load in the data and provide summaries of the how it is structured.</p></li>
<li><p>Apply a new normalisation procedure (Lobanov 2.0) to the formant measurements.</p></li>
<li><p>Run a series of GAMMs that model the normalised values (per formant and per vowel), with fixed effects of speaker year of birth, gender and speech rate. These models will then be used to extract the by-speaker random intercepts, which we use as estimates of how innovative a speaker’s realisations of each vowel are in terms of F1/F2, whilst keeping the fixed effects constant.</p></li>
<li><p>Run a principal components analysis (PCA) on the speaker intercepts data. Then inspect the eigen values of each of the principal components (PCs), this will allow us to determine which PCs account for sufficient variance to be meaningfully interpreted.</p></li>
<li><p>Extract the PCA scores from the PCs, which give each individual speaker a value for each PC, the more extreme (i.e. high or low) this value, the more the speaker contributes to the PC’s formation. This will allow us to identify which speakers are representative of the PCs.</p></li>
<li><p>Assess if any of the PCs can be explained by the fixed-effects from the GAMM fitting procedure, i.e. is there a relationship between the PCA scores and factors such as year of birth or gender. We will provide examples of speaker vowel spaces to assist in the interpreation of the PCs in terms of F1/F2 space (the Shiny app allows for exploration of all speakers, so we recommend that as the optimal tool for understanding speaker variation <a href="https://onze.shinyapps.io/Covariation_shiny/" class="uri">https://onze.shinyapps.io/Covariation_shiny/</a>).</p></li>
<li><p>Following on from the previous inspection of the variables, our interpretation for how they co-vary together within a more theoretical framework (as explained in the paper), was driven by our understanding of the directions of change in F1/F2. To demonstrate this we will run additional GAMMs predicting F1/F2 by the PCA scores. Then visualise how these changes map onto change in New Zealand English.</p></li>
</ol>
</div>
<div id="pre-requisites" class="section level1">
<h1>Pre-requisites</h1>
<p><strong>Purpose: Install libraries and load data</strong></p>
<p>In order for the code in this document to work, the following packages are required to be installed and loaded into your R session. If you do not have any of the packages installed, you can run <code>install.packages("PACKAGE NAME")</code> which should resolve any warning messages you might get (change “PACKAGE NAME” to the required package name, e.g. <code>install.packages("tidyverse")</code>).</p>
<p>A large portion of the code in this document is written in a <em>tidy</em> way, this means that it (tries to) always use the <code>tidyverse</code> functions when possible, if you are new to using R or are more familiar with R’s <code>base</code> packages, see <a href="http://tidyverse.tidyverse.org/">http://tidyverse.tidyverse.org/</a> for a full reference guide.</p>
<p>Similarly, if there are any functions that you are not familiar with/would like more information on (or the arguments to those functions), simply press <code>F1</code> whilst your cursor is clicked anywhere on the name of the function, this will bring up the help page in RStudio (note this will only work if you are using the <code>.rmd</code> version of this file and not the <code>.html</code>).</p>
<p>For more general information on R Markdown documents and how they work see <a href="https://rmarkdown.rstudio.com/index.html">https://rmarkdown.rstudio.com/index.html</a></p>
<p>##Libraries</p>
<p>The following libraries are required for the document to be run.</p>
<pre class="r"><code>library(lme4) #mixed-effects models
library(rms) #fitting restricted cubic splines
library(cowplot) #plotting functions
library(tidyverse) #lots of things
library(kableExtra) #outputting nice tables
library(factoextra) #pca related things
library(ggrepel) #more plotting things
library(gganimate) #animation plotting
library(lmerTest) #p values from lmer models
library(DT) #interactive data tables
library(mgcv) #gamms
library(itsadug) #additional gamm things
library(scales) #rescale functions
library(gifski) #needed to generate gif
library(circlize) #chord diagram
library(PerformanceAnalytics) #correlation figure
#this is important for reproduction of any stochastic computations
set.seed(123)
#check information about R session, this will give details of the R setup on the authors computer at the time of running. If any of the outputs are not reproduced as in the html file produced from this markdown document (see repository), there may be differences in the package versions or setup on your computer. You can update packages by running utils::update.packages()
sessionInfo()</code></pre>
<pre><code>## R version 4.0.3 (2020-10-10)
## Platform: x86_64-apple-darwin17.0 (64-bit)
## Running under: macOS Big Sur 10.16
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
##
## locale:
## [1] en_NZ.UTF-8/en_NZ.UTF-8/en_NZ.UTF-8/C/en_NZ.UTF-8/en_NZ.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] PerformanceAnalytics_2.0.4 xts_0.12.1
## [3] zoo_1.8-9 circlize_0.4.13
## [5] gifski_1.4.3-1 scales_1.1.1
## [7] itsadug_2.4 plotfunctions_1.4
## [9] mgcv_1.8-36 nlme_3.1-152
## [11] DT_0.18 lmerTest_3.1-3
## [13] gganimate_1.0.7 ggrepel_0.9.1
## [15] factoextra_1.0.7 kableExtra_1.3.4
## [17] forcats_0.5.1 stringr_1.4.0
## [19] dplyr_1.0.7 purrr_0.3.4
## [21] readr_1.4.0 tidyr_1.1.3
## [23] tibble_3.1.2 tidyverse_1.3.1
## [25] cowplot_1.1.1 rms_6.2-0
## [27] SparseM_1.81 Hmisc_4.5-0
## [29] ggplot2_3.3.5 Formula_1.2-4
## [31] survival_3.2-11 lattice_0.20-44
## [33] lme4_1.1-27.1 Matrix_1.3-4
##
## loaded via a namespace (and not attached):
## [1] TH.data_1.0-10 minqa_1.2.4 colorspace_2.0-2
## [4] ellipsis_0.3.2 htmlTable_2.2.1 GlobalOptions_0.1.2
## [7] base64enc_0.1-3 fs_1.5.0 rstudioapi_0.13
## [10] farver_2.1.0 MatrixModels_0.5-0 fansi_0.5.0
## [13] mvtnorm_1.1-2 lubridate_1.7.10 xml2_1.3.2
## [16] codetools_0.2-18 splines_4.0.3 knitr_1.33
## [19] jsonlite_1.7.2 nloptr_1.2.2.2 broom_0.7.8
## [22] cluster_2.1.2 dbplyr_2.1.1 png_0.1-7
## [25] compiler_4.0.3 httr_1.4.2 backports_1.2.1
## [28] assertthat_0.2.1 cli_3.0.0 tweenr_1.0.2
## [31] htmltools_0.5.1.1 quantreg_5.86 prettyunits_1.1.1
## [34] tools_4.0.3 gtable_0.3.0 glue_1.4.2
## [37] Rcpp_1.0.6 cellranger_1.1.0 jquerylib_0.1.4
## [40] vctrs_0.3.8 svglite_2.0.0 conquer_1.0.2
## [43] xfun_0.24 rvest_1.0.0 lifecycle_1.0.0
## [46] polspline_1.1.19 MASS_7.3-54 hms_1.1.0
## [49] sandwich_3.0-1 RColorBrewer_1.1-2 yaml_2.2.1
## [52] gridExtra_2.3 sass_0.4.0 rpart_4.1-15
## [55] latticeExtra_0.6-29 stringi_1.6.2 checkmate_2.0.0
## [58] boot_1.3-28 shape_1.4.6 rlang_0.4.11
## [61] pkgconfig_2.0.3 systemfonts_1.0.2 matrixStats_0.59.0
## [64] evaluate_0.14 htmlwidgets_1.5.3 tidyselect_1.1.1
## [67] magrittr_2.0.1 R6_2.5.0 generics_0.1.0
## [70] multcomp_1.4-17 DBI_1.1.1 pillar_1.6.1
## [73] haven_2.4.1 foreign_0.8-81 withr_2.4.2
## [76] nnet_7.3-16 modelr_0.1.8 crayon_1.4.1
## [79] utf8_1.2.1 rmarkdown_2.9 jpeg_0.1-8.1
## [82] progress_1.2.2 grid_4.0.3 readxl_1.3.1
## [85] data.table_1.14.0 reprex_2.0.0 digest_0.6.27
## [88] webshot_0.5.2 numDeriv_2016.8-1.1 munsell_0.5.0
## [91] viridisLite_0.4.0 bslib_0.2.5.1 quadprog_1.5-8</code></pre>
</div>
<div id="data" class="section level1">
<h1>Data</h1>
<p><strong>Purpose: Understand the structure of the dataset</strong></p>
<p>All data has been made available to reproduce the results, the data file should be located in a folder called <code>data</code> within the folder/directory this file is saved in. We will store the data as an R data frame called <code>vowels_all</code>. Note the data is saved as a <code>.rds</code> file, this is essentially the same as a normal <code>.csv</code> file, but is more efficient when working in R. If you wish to reuse the data in a different format, it is recommended that you load in the data and then export it to your preferred format, e.g. using the <code>write.csv()</code> function for <code>.csv</code> files.</p>
<pre class="r"><code>#load in the data
vowels_all <- readRDS("Data/ONZE_vowels_filtered_anon.rds")</code></pre>
<p>We can inspect the data in different ways, to ensure that the correct file has been loaded and for general understanding of how the data is structured.</p>
<div id="variables" class="section level2">
<h2>Variables</h2>
<p>Let’s inspect the variables…</p>
<p>We should have <strong>10</strong> variables.</p>
<p>Definitions of each variable are given below (factors are represented as <em>fct</em> with the number of unique levels also provided e.g. <em>fct, 2</em> represents a factor with 2 unique values, numeric variables are represented as <em>num</em>, with the smallest and largest values provided, e.g. <em>num, (1857-1988)</em>):</p>
<table class="table" style="width: auto !important; margin-left: auto; margin-right: auto;">
<thead>
<tr>
<th style="text-align:left;">
Variable
</th>
<th style="text-align:left;">
Description
</th>
<th style="text-align:left;">
Class
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
<span style=" color: #273746 !important;border-radius: 4px; padding-right: 4px; padding-left: 4px; background-color: #F2F3F4 !important;">Speaker</span>
</td>
<td style="text-align:left;width: 30em; ">
The speaker ID (format: corpus_gender_distinctnumber, e.g. IA_f_001
</td>
<td style="text-align:left;font-style: italic;">
fct (481)
</td>
</tr>
<tr>
<td style="text-align:left;">
<span style=" color: #273746 !important;border-radius: 4px; padding-right: 4px; padding-left: 4px; background-color: #F2F3F4 !important;">Transcript</span>
</td>
<td style="text-align:left;width: 30em; ">
The transcript number of the speaker, e.g. IA_f_001-01.trs
</td>
<td style="text-align:left;font-style: italic;">
fct (2523)
</td>
</tr>
<tr>
<td style="text-align:left;">
<span style=" color: #273746 !important;border-radius: 4px; padding-right: 4px; padding-left: 4px; background-color: #F2F3F4 !important;">Corpus</span>
</td>
<td style="text-align:left;width: 30em; ">
The sub-corpus the data comes from, i.e. either MU, IA, Darfield or CC
</td>
<td style="text-align:left;font-style: italic;">
fct (4)
</td>
</tr>
<tr>
<td style="text-align:left;">
<span style=" color: #273746 !important;border-radius: 4px; padding-right: 4px; padding-left: 4px; background-color: #F2F3F4 !important;">Gender</span>
</td>
<td style="text-align:left;width: 30em; ">
The gender of the speaker, i.e. either F for female or M for male
</td>
<td style="text-align:left;font-style: italic;">
fct (2)
</td>
</tr>
<tr>
<td style="text-align:left;">
<span style=" color: #273746 !important;border-radius: 4px; padding-right: 4px; padding-left: 4px; background-color: #F2F3F4 !important;">participant_year_of_birth</span>
</td>
<td style="text-align:left;width: 30em; ">
The year the participant was born in e.g. 1864
</td>
<td style="text-align:left;font-style: italic;">
num (1864-1982)
</td>
</tr>
<tr>
<td style="text-align:left;">
<span style=" color: #273746 !important;border-radius: 4px; padding-right: 4px; padding-left: 4px; background-color: #F2F3F4 !important;">Word</span>
</td>
<td style="text-align:left;width: 30em; ">
The word form of the token, this is anonymised (format: word_distinctnumber, e.g. word_00002
</td>
<td style="text-align:left;font-style: italic;">
fct (14632)
</td>
</tr>
<tr>
<td style="text-align:left;">
<span style=" color: #273746 !important;border-radius: 4px; padding-right: 4px; padding-left: 4px; background-color: #F2F3F4 !important;">Vowel</span>
</td>
<td style="text-align:left;width: 30em; ">
The vowel of the token, using Well’s notation, e.g. FLEECE
</td>
<td style="text-align:left;font-style: italic;">
fct (10)
</td>
</tr>
<tr>
<td style="text-align:left;">
<span style=" color: #273746 !important;border-radius: 4px; padding-right: 4px; padding-left: 4px; background-color: #F2F3F4 !important;">F1_50</span>
</td>
<td style="text-align:left;width: 30em; ">
The raw F1 of the vowel in Hz, taken at the mid-point, e.g. 500
</td>
<td style="text-align:left;font-style: italic;">
num (58-999)
</td>
</tr>
<tr>
<td style="text-align:left;">
<span style=" color: #273746 !important;border-radius: 4px; padding-right: 4px; padding-left: 4px; background-color: #F2F3F4 !important;">F2_50</span>
</td>
<td style="text-align:left;width: 30em; ">
The raw F2 of the vowel in Hz, taken at the mid-point, e.g. 1500
</td>
<td style="text-align:left;font-style: italic;">
num (320-3453)
</td>
</tr>
<tr>
<td style="text-align:left;">
<span style=" color: #273746 !important;border-radius: 4px; padding-right: 4px; padding-left: 4px; background-color: #F2F3F4 !important;">Speech_rate</span>
</td>
<td style="text-align:left;width: 30em; ">
The speech rate in syllbales per second for the transcript, e.g. 1.7929
</td>
<td style="text-align:left;font-style: italic;">
num (0.1365-15.2451)
</td>
</tr>
</tbody>
</table>
<p>Next, we can generate some summary information about the dataset.</p>
<div id="token-counts" class="section level3">
<h3>Token counts</h3>
<p>There are 10 different vowels in the data, a summary of the number of tokens per vowel is given below.</p>
<p>Originally, we extracted 12 vowels, comprising the 10 summarised below, but also SCHWA and FOOT, these were removed during the data cleaning stage, SCHWA was removed as we are only analysing stressed tokens and the number of speakers with low N tokens for FOOT would have led to large loss in the number of speakers in the data.</p>
<table class="table" style="width: auto !important; margin-left: auto; margin-right: auto;">
<thead>
<tr>
<th style="text-align:left;">
Vowel
</th>
<th style="text-align:center;">
N Tokens
</th>
<th style="text-align:center;">
%
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
NURSE
</td>
<td style="text-align:center;">
16891
</td>
<td style="text-align:center;">
4.1
</td>
</tr>
<tr>
<td style="text-align:left;">
START
</td>
<td style="text-align:center;">
21217
</td>
<td style="text-align:center;">
5.1
</td>
</tr>
<tr>
<td style="text-align:left;">
GOOSE
</td>
<td style="text-align:center;">
26432
</td>
<td style="text-align:center;">
6.4
</td>
</tr>
<tr>
<td style="text-align:left;">
THOUGHT
</td>
<td style="text-align:center;">
28201
</td>
<td style="text-align:center;">
6.8
</td>
</tr>
<tr>
<td style="text-align:left;">
TRAP
</td>
<td style="text-align:center;">
32284
</td>
<td style="text-align:center;">
7.8
</td>
</tr>
<tr>
<td style="text-align:left;">
LOT
</td>
<td style="text-align:center;">
35228
</td>
<td style="text-align:center;">
8.5
</td>
</tr>
<tr>
<td style="text-align:left;">
FLEECE
</td>
<td style="text-align:center;">
49757
</td>
<td style="text-align:center;">
12.0
</td>
</tr>
<tr>
<td style="text-align:left;">
STRUT
</td>
<td style="text-align:center;">
50907
</td>
<td style="text-align:center;">
12.3
</td>
</tr>
<tr>
<td style="text-align:left;">
DRESS
</td>
<td style="text-align:center;">
69925
</td>
<td style="text-align:center;">
16.9
</td>
</tr>
<tr>
<td style="text-align:left;">
KIT
</td>
<td style="text-align:center;">
83837
</td>
<td style="text-align:center;">
20.2
</td>
</tr>
<tr>
<td style="text-align:left;font-weight: bold;color: black !important;">
Total
</td>
<td style="text-align:center;font-weight: bold;color: black !important;">
414679
</td>
<td style="text-align:center;font-weight: bold;color: black !important;">
100.0
</td>
</tr>
</tbody>
</table>
</div>
<div id="sub-corpora" class="section level3">
<h3>Sub-corpora</h3>
<p>The ONZE dataset comprises four different sub-corpora:</p>
<p>MU - Mobile Unit<br> IA - Intermediate Archive<br> Darfield - Canterbury Regional Survey<br> CC - Canterbury Corpus<br></p>
<p>Below is a summary of the demographic information for each of the sub-corpora.</p>
<table class="table" style="width: auto !important; margin-left: auto; margin-right: auto;">
<thead>
<tr>
<th style="text-align:left;">
Corpus
</th>
<th style="text-align:center;">
N Tokens
</th>
<th style="text-align:center;">
%
</th>
<th style="text-align:center;">
N Speakers
</th>
<th style="text-align:center;">
Female
</th>
<th style="text-align:center;">
Male
</th>
<th style="text-align:center;">
Year of Birth Range
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
MU
</td>
<td style="text-align:center;">
59059
</td>
<td style="text-align:center;">
14.2
</td>
<td style="text-align:center;">
54
</td>
<td style="text-align:center;">
13
</td>
<td style="text-align:center;">
41
</td>
<td style="text-align:center;">
1864 - 1904
</td>
</tr>
<tr>
<td style="text-align:left;">
IA
</td>
<td style="text-align:center;">
97620
</td>
<td style="text-align:center;">
23.5
</td>
<td style="text-align:center;">
54
</td>
<td style="text-align:center;">
29
</td>
<td style="text-align:center;">
25
</td>
<td style="text-align:center;">
1891 - 1963
</td>
</tr>
<tr>
<td style="text-align:left;">
Darfield
</td>
<td style="text-align:center;">
57527
</td>
<td style="text-align:center;">
13.9
</td>
<td style="text-align:center;">
25
</td>
<td style="text-align:center;">
14
</td>
<td style="text-align:center;">
11
</td>
<td style="text-align:center;">
1918 - 1980
</td>
</tr>
<tr>
<td style="text-align:left;">
CC
</td>
<td style="text-align:center;">
200473
</td>
<td style="text-align:center;">
48.3
</td>
<td style="text-align:center;">
348
</td>
<td style="text-align:center;">
169
</td>
<td style="text-align:center;">
179
</td>
<td style="text-align:center;">
1926 - 1982
</td>
</tr>
</tbody>
</table>
</div>
<div id="speakers" class="section level3">
<h3>Speakers</h3>
<p>The distribution of speakers by gender is given in the histogram below.</p>
<pre class="r"><code>#histogram of the speakers by year of birth and gender
vowels_all %>%
select(Speaker, Gender, participant_year_of_birth) %>%
distinct() %>%
ggplot(aes(x = participant_year_of_birth, fill = Gender, colour = Gender)) +
geom_histogram(aes(position="identity"),
binwidth=1,
alpha = 0.8, colour = NA) +
geom_rug(alpha = 0.2) +
scale_x_continuous(breaks = seq(1860, 1990, 15)) +
scale_fill_manual(values = c("black", "#7CAE00")) +
scale_color_manual(values = c("black", "#7CAE00")) +
geom_label(data = vowels_all %>% filter(participant_year_of_birth > 1863 & participant_year_of_birth < 1983) %>% select(Speaker, Gender, participant_year_of_birth) %>% distinct() %>% group_by(Gender) %>% summarise(n = n()), aes(x = 1864, y = 20, label = paste0("N female = ", n[1], "\nN male = ", n[2], "\nN total = ", sum(n), "\nyob range: ", min(vowels_all$participant_year_of_birth), " - ", max(vowels_all$participant_year_of_birth))), hjust=0, inherit.aes = FALSE) +
theme_bw() +
theme(legend.position = "top")</code></pre>
<p><img src="Covariation_monophthongs_analysis_files/figure-html/unnamed-chunk-7-1.png" width="2800" /></p>
<p>Below we provide summary information about each of the speakers token counts per vowel. This table comprises all speakers in the dataset and can be ordered and searched like a spreadsheet.</p>
<div id="htmlwidget-9eceb20dc2a931752ae4" style="width:100%;height:auto;" class="datatables html-widget"></div>
<script type="application/json" data-for="htmlwidget-9eceb20dc2a931752ae4">{"x":{"filter":"none","data":[["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"],["CC_f_007","CC_f_010","CC_f_020","CC_f_024","CC_f_025","CC_f_027","CC_f_033","CC_f_040","CC_f_051","CC_f_052","CC_f_054","CC_f_055","CC_f_057","CC_f_064","CC_f_066","CC_f_067","CC_f_074","CC_f_076","CC_f_080","CC_f_083","CC_f_084","CC_f_085","CC_f_093","CC_f_104","CC_f_105","CC_f_107","CC_f_111","CC_f_115","CC_f_117","CC_f_125","CC_f_127","CC_f_129","CC_f_130","CC_f_134","CC_f_136","CC_f_137","CC_f_146","CC_f_148","CC_f_151","CC_f_160","CC_f_161","CC_f_164","CC_f_165","CC_f_170","CC_f_172","CC_f_176","CC_f_177","CC_f_178","CC_f_185","CC_f_186","CC_f_191","CC_f_196","CC_f_198","CC_f_199","CC_f_205","CC_f_210","CC_f_212","CC_f_215","CC_f_218","CC_f_225","CC_f_234","CC_f_235","CC_f_236","CC_f_237","CC_f_238","CC_f_243","CC_f_245","CC_f_250","CC_f_253","CC_f_258","CC_f_265","CC_f_269","CC_f_270","CC_f_279","CC_f_280","CC_f_282","CC_f_285","CC_f_287","CC_f_289","CC_f_292","CC_f_295","CC_f_297","CC_f_302","CC_f_310","CC_f_317","CC_f_323","CC_f_326","CC_f_330","CC_f_339","CC_f_343","CC_f_344","CC_f_346","CC_f_347","CC_f_357","CC_f_362","CC_f_363","CC_f_368","CC_f_369","CC_f_377","CC_f_381","CC_f_386","CC_f_389","CC_f_390","CC_f_391","CC_f_398","CC_f_401","CC_f_407","CC_f_408","CC_f_413","CC_f_420","CC_f_428","CC_f_429","CC_f_440","CC_f_442","CC_f_444","CC_f_449","CC_f_450","CC_f_455","CC_f_457","CC_f_459","CC_f_465","CC_f_466","CC_f_468","CC_f_469","CC_f_477","CC_f_479","CC_f_480","CC_f_483","CC_f_484","CC_f_487","CC_f_488","CC_f_492","CC_f_495","CC_f_501","CC_f_504","CC_f_505","CC_f_509","CC_f_512","CC_f_514","CC_f_522","CC_f_523","CC_f_530","CC_f_534","CC_f_539","CC_f_545","CC_f_546","CC_f_551","CC_f_552","CC_f_554","CC_f_560","CC_f_561","CC_f_564","CC_f_570","CC_f_571","CC_f_572","CC_f_573","CC_f_577","CC_f_585","CC_f_592","CC_f_598","CC_f_599","CC_f_604","CC_f_608","CC_f_615","CC_f_620","CC_f_622","CC_f_630","CC_f_632","CC_f_636","CC_m_006","CC_m_008","CC_m_011","CC_m_012","CC_m_016","CC_m_017","CC_m_019","CC_m_028","CC_m_029","CC_m_030","CC_m_031","CC_m_037","CC_m_038","CC_m_046","CC_m_047","CC_m_050","CC_m_059","CC_m_063","CC_m_070","CC_m_078","CC_m_079","CC_m_086","CC_m_087","CC_m_088","CC_m_094","CC_m_096","CC_m_102","CC_m_103","CC_m_108","CC_m_109","CC_m_112","CC_m_114","CC_m_119","CC_m_120","CC_m_126","CC_m_128","CC_m_131","CC_m_138","CC_m_139","CC_m_149","CC_m_156","CC_m_157","CC_m_162","CC_m_167","CC_m_168","CC_m_173","CC_m_174","CC_m_175","CC_m_180","CC_m_182","CC_m_184","CC_m_190","CC_m_193","CC_m_197","CC_m_201","CC_m_202","CC_m_203","CC_m_204","CC_m_206","CC_m_207","CC_m_208","CC_m_214","CC_m_219","CC_m_227","CC_m_228","CC_m_230","CC_m_232","CC_m_240","CC_m_241","CC_m_247","CC_m_248","CC_m_249","CC_m_251","CC_m_256","CC_m_259","CC_m_261","CC_m_262","CC_m_268","CC_m_272","CC_m_273","CC_m_283","CC_m_293","CC_m_296","CC_m_301","CC_m_303","CC_m_307","CC_m_311","CC_m_315","CC_m_324","CC_m_329","CC_m_338","CC_m_340","CC_m_353","CC_m_359","CC_m_371","CC_m_375","CC_m_378","CC_m_379","CC_m_380","CC_m_385","CC_m_387","CC_m_388","CC_m_393","CC_m_394","CC_m_396","CC_m_399","CC_m_400","CC_m_403","CC_m_404","CC_m_406","CC_m_410","CC_m_411","CC_m_417","CC_m_419","CC_m_423","CC_m_425","CC_m_427","CC_m_432","CC_m_434","CC_m_435","CC_m_438","CC_m_439","CC_m_441","CC_m_443","CC_m_446","CC_m_447","CC_m_453","CC_m_454","CC_m_460","CC_m_461","CC_m_464","CC_m_467","CC_m_470","CC_m_475","CC_m_478","CC_m_481","CC_m_486","CC_m_491","CC_m_493","CC_m_499","CC_m_507","CC_m_508","CC_m_513","CC_m_515","CC_m_529","CC_m_531","CC_m_536","CC_m_538","CC_m_540","CC_m_547","CC_m_548","CC_m_549","CC_m_553","CC_m_557","CC_m_558","CC_m_562","CC_m_563","CC_m_565","CC_m_567","CC_m_576","CC_m_583","CC_m_595","CC_m_596","CC_m_597","CC_m_600","CC_m_601","CC_m_605","CC_m_606","CC_m_607","CC_m_610","CC_m_611","CC_m_613","CC_m_617","CC_m_619","CC_m_621","CC_m_628","CC_m_629","CC_m_631","CC_m_634","Darfield_f_062","Darfield_f_140","Darfield_f_147","Darfield_f_187","Darfield_f_194","Darfield_f_271","Darfield_f_274","Darfield_f_304","Darfield_f_365","Darfield_f_405","Darfield_f_445","Darfield_f_474","Darfield_f_569","Darfield_f_612","Darfield_m_022","Darfield_m_082","Darfield_m_098","Darfield_m_231","Darfield_m_351","Darfield_m_383","Darfield_m_520","Darfield_m_582","Darfield_m_587","Darfield_m_594","Darfield_m_616","IA_f_001","IA_f_003","IA_f_009","IA_f_035","IA_f_053","IA_f_065","IA_f_071","IA_f_092","IA_f_097","IA_f_099","IA_f_133","IA_f_142","IA_f_144","IA_f_169","IA_f_171","IA_f_183","IA_f_242","IA_f_246","IA_f_260","IA_f_300","IA_f_333","IA_f_341","IA_f_350","IA_f_360","IA_f_433","IA_f_437","IA_f_527","IA_f_578","IA_f_591","IA_m_044","IA_m_056","IA_m_068","IA_m_077","IA_m_181","IA_m_216","IA_m_233","IA_m_288","IA_m_322","IA_m_328","IA_m_364","IA_m_367","IA_m_451","IA_m_476","IA_m_496","IA_m_511","IA_m_517","IA_m_518","IA_m_524","IA_m_525","IA_m_542","IA_m_574","IA_m_579","IA_m_623","IA_m_624","MU_f_013","MU_f_069","MU_f_090","MU_f_211","MU_f_223","MU_f_244","MU_f_316","MU_f_426","MU_f_456","MU_f_463","MU_f_528","MU_f_590","MU_f_593","MU_m_026","MU_m_034","MU_m_039","MU_m_041","MU_m_072","MU_m_089","MU_m_091","MU_m_110","MU_m_116","MU_m_118","MU_m_121","MU_m_143","MU_m_159","MU_m_166","MU_m_179","MU_m_209","MU_m_277","MU_m_278","MU_m_286","MU_m_290","MU_m_291","MU_m_294","MU_m_299","MU_m_308","MU_m_309","MU_m_348","MU_m_373","MU_m_409","MU_m_424","MU_m_431","MU_m_490","MU_m_516","MU_m_526","MU_m_537","MU_m_555","MU_m_575","MU_m_581","MU_m_588","MU_m_602","MU_m_626","MU_m_635"],[80,73,69,54,55,71,104,43,70,52,261,49,68,81,91,62,77,76,269,95,131,67,37,50,58,53,75,83,257,44,117,68,72,72,54,142,43,142,128,146,95,59,156,50,60,382,57,88,106,108,61,75,101,106,330,73,79,110,47,285,99,70,75,69,64,74,116,79,173,62,95,77,61,56,122,93,49,49,131,88,76,80,69,68,218,87,133,168,146,388,66,88,68,49,107,63,38,89,79,64,67,127,29,147,64,72,164,59,196,67,47,80,101,61,79,68,60,88,83,52,64,56,70,54,83,93,55,57,60,90,129,61,70,84,48,44,92,130,84,55,82,44,79,93,53,88,66,114,450,48,51,111,119,92,140,230,45,104,56,65,86,70,103,71,111,65,60,163,68,59,76,212,70,50,88,54,26,67,103,335,67,59,162,299,95,105,65,147,61,232,92,137,57,54,68,90,79,61,59,107,34,75,211,32,248,64,224,63,64,93,112,47,78,199,97,163,50,275,57,40,82,46,82,128,113,54,71,40,13,60,75,46,70,74,75,48,89,61,93,73,149,76,68,85,76,63,76,175,109,157,84,98,82,67,129,100,28,76,57,69,54,61,67,54,57,33,39,36,59,63,86,37,65,73,88,288,73,131,196,43,82,50,45,84,33,50,74,56,185,108,72,69,70,231,64,57,43,72,109,54,127,81,67,30,48,55,84,61,75,54,207,67,73,74,49,59,192,90,112,47,81,50,115,74,120,53,74,80,35,79,62,55,66,143,228,30,80,72,184,54,118,165,59,58,86,115,70,115,376,577,375,178,336,344,352,398,160,375,506,342,277,463,251,624,284,637,639,404,650,491,378,344,266,270,115,452,443,369,370,127,245,402,403,354,370,124,32,409,250,450,133,246,297,137,426,47,237,229,232,588,511,140,342,132,102,223,343,474,68,211,218,448,333,391,465,412,340,412,60,205,1529,179,364,397,208,348,434,163,156,102,24,369,376,53,127,150,117,243,34,104,67,158,79,177,160,110,369,122,235,138,104,132,199,887,119,157,213,339,83,58,366,58,96,179,83,271,129,63,462,271,191,220,95,94,479,322,210,192,313,395,346],[66,64,59,44,40,49,69,33,36,38,165,61,32,77,49,32,40,49,224,70,75,43,51,38,43,42,48,65,225,25,76,42,51,40,24,95,21,116,105,190,88,49,135,44,53,324,32,38,89,67,52,65,77,83,134,62,98,51,35,176,61,93,38,54,52,59,102,55,101,39,99,74,54,36,94,65,43,78,65,57,61,42,46,57,153,72,86,99,95,334,42,70,51,36,94,34,28,48,58,50,71,140,13,128,70,78,149,50,115,61,34,61,88,58,64,51,40,51,41,33,69,40,70,24,42,47,35,58,46,80,144,69,57,68,36,32,58,84,78,50,36,51,26,54,57,62,64,77,311,57,48,66,73,62,112,193,44,55,58,56,51,39,42,49,75,86,54,71,61,39,30,177,60,38,89,62,37,52,78,268,26,44,108,242,80,78,48,88,45,104,78,152,35,38,41,48,41,55,41,71,37,65,172,29,254,41,119,51,51,90,67,29,60,164,52,112,27,172,44,24,48,22,57,100,63,40,41,46,13,66,52,26,72,46,55,55,81,56,73,50,116,65,62,50,89,64,64,111,81,130,32,58,70,25,118,68,25,54,30,68,30,35,66,39,43,53,30,39,47,75,74,34,54,47,68,248,79,143,164,32,53,66,35,81,36,30,72,34,123,125,41,44,39,139,56,76,46,26,87,42,117,79,38,32,72,49,87,44,70,98,161,63,55,66,39,73,137,48,61,62,71,36,63,77,89,43,41,51,47,53,48,65,57,97,192,12,75,52,103,34,69,116,42,42,63,52,48,75,277,378,226,111,304,265,188,341,116,237,306,181,252,276,234,461,189,508,456,353,407,355,226,327,201,133,91,262,277,238,197,54,99,245,222,244,178,58,29,264,122,434,101,124,226,89,276,35,161,125,145,395,334,99,242,74,67,225,254,284,43,142,273,318,260,328,213,325,225,259,38,149,997,165,223,275,135,217,224,57,150,41,18,270,336,16,73,141,52,136,30,59,45,84,67,109,105,59,240,77,143,63,73,94,137,739,70,146,183,283,31,46,224,18,72,137,51,198,137,42,208,152,153,139,23,36,216,163,113,140,193,172,188],[30,26,33,35,18,40,34,14,32,32,81,22,16,33,26,17,36,32,122,27,42,23,15,17,17,16,36,44,101,20,35,16,51,27,13,46,14,75,36,76,49,20,68,22,21,129,19,67,28,26,13,33,50,41,102,33,54,25,16,96,28,34,26,29,26,23,45,32,60,19,37,23,22,24,52,23,23,31,28,25,34,48,31,24,58,45,58,53,37,140,18,49,24,29,39,22,19,27,32,29,23,51,10,59,30,35,62,23,62,27,35,30,40,34,27,24,20,28,27,35,32,23,25,18,28,20,20,30,19,26,44,37,38,29,19,21,30,31,36,13,32,21,19,16,24,48,39,43,141,35,19,34,22,27,43,80,23,32,25,29,25,22,37,23,32,21,28,50,30,28,19,108,34,29,27,25,12,25,34,139,30,25,91,139,36,39,29,32,31,105,43,89,20,16,26,31,27,26,23,38,18,46,91,16,101,24,70,32,22,27,37,28,42,91,28,36,19,108,32,13,27,11,14,44,34,17,46,19,6,22,30,25,35,41,29,26,27,19,55,21,58,10,28,35,24,30,37,64,42,59,39,26,41,21,55,31,18,30,23,24,24,20,33,24,13,24,9,21,19,30,37,26,45,20,33,143,31,48,60,28,28,27,11,26,18,30,20,14,51,55,32,38,23,66,43,25,31,22,29,30,39,39,15,30,31,40,32,21,34,53,71,23,33,33,21,24,109,22,62,24,45,11,33,48,46,31,28,22,25,27,15,44,27,79,61,22,35,24,49,15,32,48,30,23,14,28,24,29,153,188,120,67,192,144,130,143,42,131,153,116,102,126,114,239,147,236,190,204,224,171,165,140,139,86,46,208,149,98,174,44,110,174,158,122,93,26,18,151,79,168,55,122,103,26,156,35,57,69,74,154,148,69,114,30,49,99,116,220,25,91,64,192,119,140,179,242,143,140,16,144,570,70,163,108,105,97,174,35,60,22,12,165,157,15,74,98,36,71,12,24,20,41,14,53,44,30,123,42,65,27,43,38,71,332,35,58,70,131,43,25,123,16,33,89,35,107,41,10,136,117,86,102,36,29,134,107,71,70,164,86,113],[94,73,56,147,52,78,178,74,115,88,442,73,126,79,125,70,65,61,655,93,181,49,52,64,45,110,83,170,297,43,231,102,66,87,106,143,67,238,233,195,161,40,177,45,98,398,55,106,196,143,71,85,126,121,236,68,149,117,70,347,85,192,107,165,104,53,204,111,239,70,238,115,113,87,110,60,74,74,193,84,100,143,133,129,190,131,162,290,228,586,61,159,86,69,124,41,62,63,118,135,122,153,43,167,114,93,186,90,183,57,107,65,220,80,76,55,67,105,53,87,88,87,92,57,134,75,55,115,112,98,289,65,103,101,29,66,84,123,91,79,66,126,46,80,134,119,95,211,514,113,49,107,112,90,181,317,49,126,67,66,134,59,94,93,108,110,130,182,147,80,55,261,58,49,134,109,60,53,112,570,70,80,173,608,129,94,132,265,104,338,133,179,59,45,80,93,158,59,57,104,49,185,481,28,277,43,236,132,36,77,90,43,88,214,167,154,118,321,79,40,119,54,48,151,191,59,163,67,20,93,163,93,93,137,144,84,178,72,121,98,202,61,64,62,119,103,86,189,86,160,87,121,151,154,290,61,44,211,74,138,95,99,121,127,93,88,67,62,57,98,180,90,120,50,99,350,106,170,199,73,149,129,44,129,68,77,119,94,333,157,84,134,94,163,57,59,82,52,129,48,148,68,60,52,94,96,116,41,146,156,170,67,179,63,71,77,169,78,158,103,84,70,87,147,170,133,115,92,55,98,88,99,123,139,239,54,146,136,133,57,113,161,91,73,139,92,96,77,347,478,387,179,441,334,298,428,138,311,374,335,273,334,307,660,518,655,701,486,597,476,320,386,348,474,147,705,336,469,325,108,592,523,397,397,386,56,42,565,209,518,232,198,511,174,402,79,392,171,189,535,907,165,374,136,98,353,387,822,105,242,221,546,470,739,389,501,237,564,113,236,1543,330,639,408,243,309,586,81,155,70,32,447,338,48,116,206,93,192,28,104,79,140,115,142,109,70,406,110,161,106,73,83,203,897,79,154,193,372,70,77,305,37,73,268,100,272,144,49,267,239,231,167,101,75,319,430,150,183,274,319,251],[58,29,32,31,30,30,36,21,42,17,111,35,38,31,51,37,45,33,223,42,76,23,25,44,23,42,36,41,150,16,64,26,26,46,31,93,21,96,83,85,57,29,90,25,25,172,12,20,45,43,44,48,63,33,63,33,52,26,17,277,32,88,33,23,24,29,56,50,101,25,74,33,27,40,78,34,26,37,49,65,28,44,56,39,75,43,74,106,94,140,27,51,49,29,69,41,21,28,62,28,28,82,16,87,43,38,81,20,60,31,37,60,57,37,54,25,39,46,25,26,68,19,36,28,33,40,40,30,24,50,91,29,25,38,30,37,72,41,31,29,34,28,24,26,31,36,51,52,258,44,28,84,66,38,94,116,32,44,24,34,38,32,55,36,44,43,28,66,100,44,26,110,64,22,53,23,26,48,60,131,45,60,114,137,49,74,46,80,38,101,49,98,19,34,57,29,22,34,24,63,25,51,114,14,147,24,112,29,25,42,50,23,42,157,64,73,33,151,11,26,45,24,37,72,53,35,55,25,9,17,67,28,52,28,57,38,31,34,71,40,118,35,33,34,44,49,40,92,85,96,44,65,57,41,73,35,20,61,36,30,29,25,50,20,26,20,18,31,38,40,41,41,42,41,36,161,59,88,99,24,38,64,33,44,32,31,53,16,128,53,33,37,18,116,29,42,38,31,87,36,70,42,48,39,36,39,59,43,52,46,121,51,44,22,28,47,71,55,71,24,42,19,35,50,77,39,39,25,15,45,44,43,44,69,167,11,46,38,89,20,58,103,38,37,30,51,49,85,228,245,200,67,190,163,147,162,89,143,245,145,197,214,143,322,148,401,269,245,364,286,172,197,136,117,59,172,205,176,111,32,42,134,163,140,132,25,12,169,87,137,63,114,121,55,169,19,105,119,127,236,198,50,189,56,50,103,196,259,34,117,81,222,176,200,133,214,152,194,25,69,815,149,147,175,108,139,198,42,85,19,8,134,158,16,73,115,46,83,10,23,19,58,26,63,50,22,176,47,102,45,48,84,111,401,37,47,118,162,63,15,211,31,37,138,50,121,91,30,185,175,143,141,49,51,156,161,68,56,168,215,144],[22,34,7,25,12,30,30,9,21,5,75,9,12,10,11,9,9,13,49,7,19,21,9,5,23,17,22,22,44,7,34,20,15,8,10,26,10,40,19,38,27,13,55,16,7,92,17,18,24,10,7,21,25,11,47,21,22,19,10,69,21,47,9,10,17,15,27,18,18,12,36,15,32,6,36,15,7,14,13,12,28,19,9,21,51,13,17,32,22,87,16,20,17,7,10,11,12,9,23,9,23,21,9,37,9,13,49,11,31,11,5,11,29,15,15,8,24,14,10,30,31,10,21,5,23,9,27,15,11,9,20,9,11,25,12,14,32,14,9,25,22,20,10,15,14,15,10,29,60,7,6,12,24,11,20,69,21,14,22,15,14,8,18,15,26,22,18,39,9,8,17,45,22,8,15,15,20,20,21,136,19,19,24,114,16,24,13,23,11,58,30,15,4,14,14,15,24,9,5,26,5,13,46,9,65,11,76,21,12,14,17,6,13,30,27,37,8,51,8,7,7,6,11,37,36,11,17,14,9,26,32,52,17,24,13,16,60,12,20,16,32,15,20,26,10,16,10,34,19,26,27,11,71,13,51,32,20,14,13,21,6,18,14,11,5,11,21,10,15,5,9,17,8,14,18,130,33,27,43,4,18,17,11,13,13,25,17,19,87,18,15,16,21,35,10,22,5,30,20,24,63,43,5,8,14,18,25,10,20,44,45,14,19,25,17,12,53,14,33,15,21,12,51,26,25,41,16,14,10,8,13,26,14,18,53,6,13,24,34,14,13,31,15,8,12,13,22,34,175,110,106,46,92,79,101,65,44,97,99,74,58,72,63,133,63,128,133,98,195,89,101,95,64,105,26,165,78,53,39,36,53,71,77,59,68,15,8,57,25,69,35,33,45,34,100,12,63,39,28,79,74,44,99,19,24,59,70,106,46,43,59,89,46,57,41,146,84,113,7,58,835,17,78,315,54,90,114,20,33,40,6,96,49,13,36,37,13,32,12,17,26,24,17,42,13,26,132,45,46,20,73,27,72,250,52,58,65,107,26,16,91,26,18,68,31,56,30,15,74,35,42,46,13,12,131,61,45,97,91,92,57],[18,14,28,9,14,12,23,16,32,12,60,10,19,26,15,18,24,26,95,30,32,17,11,20,12,15,16,16,104,16,39,10,28,14,16,34,15,39,61,34,23,19,61,9,7,75,17,30,26,20,11,21,66,30,38,29,35,23,27,72,44,19,22,23,16,14,17,33,38,22,28,19,19,15,42,26,16,11,22,16,37,24,10,20,64,28,19,47,33,111,14,22,27,11,21,7,13,13,27,11,13,50,8,34,10,25,38,20,47,20,19,18,28,17,25,17,12,18,10,13,33,27,21,17,22,26,22,9,11,16,49,15,22,31,9,10,32,15,25,10,19,22,22,7,31,14,14,25,117,13,13,44,18,24,43,59,15,29,17,15,10,8,40,27,27,16,13,18,14,18,16,49,36,20,27,18,14,38,28,130,30,34,47,85,19,39,18,23,14,52,46,83,19,36,23,21,29,24,15,27,14,26,71,8,157,13,43,26,18,26,20,9,36,72,22,53,23,78,31,15,12,14,14,46,28,6,18,33,6,8,40,18,16,32,28,14,18,17,45,11,66,30,36,18,22,21,22,76,56,45,15,41,24,11,33,17,24,22,12,16,14,29,25,16,20,17,12,7,29,26,17,15,20,24,17,58,39,31,92,8,17,14,10,25,17,25,13,13,47,32,13,17,23,67,22,24,14,31,45,30,23,22,28,18,14,27,22,12,17,22,57,20,31,23,17,20,60,26,41,10,56,16,28,18,48,27,22,24,18,11,19,16,17,43,59,13,19,10,59,12,31,70,35,27,57,40,17,23,145,145,73,45,126,103,105,86,49,105,120,96,117,87,145,232,86,252,228,167,195,132,126,158,98,85,37,168,134,108,66,43,55,130,140,110,106,25,9,99,66,115,39,45,126,33,84,18,42,48,49,137,113,43,104,67,45,127,112,115,14,79,65,125,83,169,152,162,155,128,17,78,452,50,156,111,78,164,139,44,69,22,8,96,62,8,42,86,15,48,8,48,27,47,19,85,33,28,111,32,54,53,26,42,93,327,44,54,94,104,32,33,156,20,29,55,27,74,39,17,89,63,56,82,40,23,135,94,53,74,79,66,73],[58,51,59,52,33,33,50,33,59,53,157,43,45,49,68,46,88,39,221,79,101,43,27,44,28,46,60,50,163,26,68,43,54,52,40,111,32,106,117,172,82,43,115,55,37,297,17,62,77,40,62,63,70,59,112,59,71,50,51,212,41,105,63,62,52,37,97,87,105,36,72,56,50,45,75,50,55,50,63,41,45,69,66,58,148,50,92,120,116,218,70,69,55,49,67,34,32,43,73,55,38,103,43,108,63,61,116,46,110,54,32,53,81,43,87,40,47,61,34,44,69,24,49,37,52,58,52,49,39,58,108,59,53,40,28,52,42,67,74,33,50,47,33,37,68,87,63,109,443,47,48,79,82,64,144,185,39,80,53,65,39,64,52,39,56,67,52,70,98,44,43,173,52,31,74,54,30,55,63,264,44,57,130,264,50,78,80,89,61,159,65,132,39,35,44,36,51,59,31,64,36,70,149,30,214,45,178,49,44,71,71,76,50,157,65,102,45,154,82,31,40,35,56,89,153,32,50,29,34,37,64,30,75,31,64,65,61,49,83,39,109,48,48,65,84,70,52,123,67,145,40,103,73,45,166,48,27,69,40,62,64,35,36,30,24,36,23,33,77,97,58,37,76,45,69,215,86,118,127,27,54,63,20,66,41,46,50,40,118,90,68,39,52,167,31,44,58,60,86,42,122,45,52,47,45,52,74,54,51,83,152,73,45,50,44,44,128,64,90,29,63,32,56,132,111,55,56,46,32,76,57,58,45,126,165,26,63,66,92,21,57,165,37,49,68,66,70,71,299,350,256,89,256,227,198,240,118,232,394,237,220,252,223,453,243,521,486,328,473,302,196,313,220,185,100,340,266,344,285,104,145,255,297,220,221,47,28,315,122,269,122,125,236,78,268,55,177,141,166,377,375,118,261,76,77,223,254,404,32,179,109,332,197,289,239,333,286,337,49,137,1016,158,234,272,120,222,320,59,122,35,17,308,249,31,103,120,80,235,25,73,42,73,36,110,77,51,233,91,157,60,81,87,170,639,66,114,121,263,41,47,298,33,72,151,56,215,86,39,206,168,176,193,70,83,299,207,137,155,288,228,274],[57,38,28,28,24,18,22,18,29,16,73,17,16,50,34,36,44,31,144,36,42,10,26,19,15,16,34,17,80,15,52,9,30,31,37,46,35,49,54,66,51,26,55,37,25,185,24,22,65,36,28,58,131,24,52,22,26,49,12,102,28,28,32,41,26,24,44,21,55,22,43,24,23,24,60,24,23,26,39,53,26,30,21,28,72,62,33,54,52,129,26,42,20,31,37,11,11,23,33,36,39,59,15,51,20,18,63,36,67,39,25,53,37,15,26,18,34,33,31,19,31,27,12,23,30,38,29,46,33,33,53,19,20,34,25,18,29,36,34,9,26,19,25,27,26,35,38,44,254,22,18,39,36,32,86,89,18,52,37,23,29,26,22,36,37,27,15,86,23,13,21,84,39,10,29,26,27,30,44,111,30,29,101,128,21,31,22,61,14,83,38,48,41,40,29,24,21,18,22,49,11,31,78,18,99,15,40,25,18,20,47,17,42,47,41,61,19,87,31,17,45,17,30,55,45,18,71,35,6,31,27,15,18,40,22,26,52,16,25,31,113,39,43,35,45,36,58,81,34,116,35,39,66,24,56,35,16,38,35,43,12,24,27,46,14,26,16,35,31,49,43,27,17,23,32,94,54,70,81,18,27,48,26,22,13,18,46,20,58,41,32,46,24,77,31,39,21,23,44,30,48,51,32,16,34,10,44,25,27,44,112,27,29,34,23,21,78,46,41,22,26,24,43,52,74,23,29,15,50,37,22,35,22,53,92,13,48,55,52,18,42,98,21,36,52,38,32,98,208,163,149,73,165,149,137,151,47,150,137,114,131,153,114,248,120,247,180,156,306,229,114,186,140,137,33,164,134,98,90,48,75,196,142,134,93,21,10,129,75,105,58,79,127,47,154,31,94,77,87,184,172,56,158,43,48,93,129,204,28,96,92,142,136,146,126,222,129,156,18,80,696,96,173,122,92,118,201,49,57,19,9,155,94,8,35,160,30,81,26,33,21,77,25,64,43,43,146,60,84,69,51,66,92,375,37,78,67,154,29,48,182,11,41,90,47,124,72,36,157,82,81,91,31,46,185,146,81,81,138,157,94],[48,40,30,24,21,12,34,25,42,15,90,29,21,34,35,16,29,22,147,61,65,21,18,23,21,26,38,63,131,23,60,29,21,31,19,51,19,53,49,84,66,21,84,23,36,164,14,50,38,55,37,56,68,53,93,42,45,53,14,120,45,68,15,46,33,21,30,55,62,36,50,36,21,36,91,20,22,51,50,56,23,50,35,28,101,25,57,75,38,144,45,26,41,25,51,17,38,21,45,33,38,64,22,61,23,32,78,43,95,37,23,47,30,34,48,22,37,51,24,16,37,30,38,33,42,48,14,29,17,35,63,33,31,34,20,19,42,33,36,26,33,27,13,20,32,37,16,58,215,49,18,46,47,31,71,91,29,40,25,37,27,17,43,29,32,27,19,34,38,18,36,108,27,19,58,36,15,30,55,185,14,19,97,302,27,49,31,92,23,136,57,75,24,39,41,27,28,25,35,42,11,44,120,8,173,35,79,29,22,35,85,32,35,101,54,76,14,98,29,16,29,27,35,50,31,43,32,38,15,10,47,21,37,36,31,24,48,31,44,44,76,33,31,24,28,58,41,98,57,95,43,51,68,37,92,31,27,63,38,46,20,27,67,31,28,39,20,15,34,60,35,31,31,27,29,145,53,82,70,43,36,41,20,57,22,44,60,31,71,65,42,24,35,94,37,33,40,27,51,22,91,34,27,24,43,37,33,37,38,44,92,43,54,38,27,31,80,51,60,37,42,20,33,43,82,30,37,18,21,42,33,28,17,89,87,13,49,40,41,33,42,120,23,40,64,34,51,52,185,187,131,55,153,154,126,123,86,133,238,110,160,167,139,358,150,332,247,194,402,225,166,246,159,89,61,169,143,141,94,68,54,162,171,137,132,44,14,137,82,106,56,67,273,66,88,53,75,67,94,224,146,57,180,50,60,166,147,163,45,81,86,212,160,184,139,161,122,197,28,107,648,121,178,158,133,130,159,42,67,24,8,207,111,25,55,71,49,78,5,35,38,47,26,67,56,52,200,62,90,71,56,58,113,470,72,60,125,305,46,34,191,19,51,103,71,145,130,23,133,76,170,127,55,35,237,159,63,98,136,137,129],[531,442,401,449,299,373,580,286,478,328,1515,348,393,470,505,343,457,382,2149,540,764,317,271,324,285,383,448,571,1552,235,776,365,414,408,350,787,277,954,885,1086,699,319,996,326,369,2218,264,501,694,548,386,525,777,561,1207,442,631,523,299,1756,484,744,420,522,414,349,738,541,952,343,772,472,422,369,760,410,338,421,653,497,458,549,476,472,1130,556,731,1044,861,2277,385,596,438,335,619,281,274,364,550,450,462,850,208,879,446,465,986,398,966,404,364,478,711,394,501,328,380,495,338,355,522,343,434,296,489,454,349,438,372,495,990,396,430,484,256,313,513,574,498,329,400,405,297,375,470,541,456,762,2763,435,298,622,599,471,934,1429,315,576,384,405,453,345,506,418,548,484,417,779,588,351,339,1327,462,276,594,422,267,418,598,2269,375,426,1047,2318,522,611,484,900,402,1368,631,1008,317,351,423,414,480,370,312,591,240,606,1533,192,1735,315,1177,457,312,495,596,310,486,1232,617,867,356,1495,404,229,454,256,384,772,747,315,564,346,131,370,597,354,485,489,518,396,645,367,630,423,1039,412,433,434,541,510,486,1043,636,1029,446,613,703,438,1063,458,249,638,358,517,348,373,506,398,323,347,255,289,406,543,580,355,478,364,489,1832,613,908,1131,300,502,519,255,547,293,376,524,337,1201,744,432,464,399,1155,380,421,378,374,687,358,848,504,372,296,431,423,576,348,530,644,1188,448,562,428,336,408,1077,494,729,373,531,290,544,667,842,475,457,387,308,476,401,469,432,856,1343,200,574,517,836,278,575,1077,391,393,585,529,479,659,2393,2821,2023,910,2255,1962,1782,2137,889,1914,2572,1750,1787,2144,1733,3730,1948,3917,3529,2635,3813,2756,1964,2392,1771,1681,715,2805,2165,2094,1751,664,1470,2292,2170,1917,1779,441,202,2295,1117,2371,894,1153,2065,739,2123,384,1403,1085,1191,2909,2978,841,2063,683,620,1671,2008,3051,440,1281,1268,2626,1980,2643,2076,2718,1873,2500,371,1263,9101,1335,2355,2341,1276,1834,2549,592,954,394,142,2247,1930,233,734,1184,531,1199,190,520,384,749,424,912,690,491,2136,688,1137,652,628,711,1261,5317,611,926,1249,2220,464,399,2147,269,522,1278,551,1583,899,324,1917,1378,1329,1308,513,484,2291,1850,991,1146,1844,1867,1669],[0.128,0.107,0.097,0.108,0.072,0.09,0.14,0.069,0.115,0.079,0.365,0.084,0.095,0.113,0.122,0.083,0.11,0.092,0.518,0.13,0.184,0.076,0.065,0.078,0.069,0.092,0.108,0.138,0.374,0.057,0.187,0.088,0.1,0.098,0.084,0.19,0.067,0.23,0.213,0.262,0.169,0.077,0.24,0.079,0.089,0.535,0.064,0.121,0.167,0.132,0.093,0.127,0.187,0.135,0.291,0.107,0.152,0.126,0.072,0.423,0.117,0.179,0.101,0.126,0.1,0.084,0.178,0.13,0.23,0.083,0.186,0.114,0.102,0.089,0.183,0.099,0.082,0.102,0.157,0.12,0.11,0.132,0.115,0.114,0.272,0.134,0.176,0.252,0.208,0.549,0.093,0.144,0.106,0.081,0.149,0.068,0.066,0.088,0.133,0.109,0.111,0.205,0.05,0.212,0.108,0.112,0.238,0.096,0.233,0.097,0.088,0.115,0.171,0.095,0.121,0.079,0.092,0.119,0.082,0.086,0.126,0.083,0.105,0.071,0.118,0.109,0.084,0.106,0.09,0.119,0.239,0.095,0.104,0.117,0.062,0.075,0.124,0.138,0.12,0.079,0.096,0.098,0.072,0.09,0.113,0.13,0.11,0.184,0.666,0.105,0.072,0.15,0.144,0.114,0.225,0.345,0.076,0.139,0.093,0.098,0.109,0.083,0.122,0.101,0.132,0.117,0.101,0.188,0.142,0.085,0.082,0.32,0.111,0.067,0.143,0.102,0.064,0.101,0.144,0.547,0.09,0.103,0.252,0.559,0.126,0.147,0.117,0.217,0.097,0.33,0.152,0.243,0.076,0.085,0.102,0.1,0.116,0.089,0.075,0.143,0.058,0.146,0.37,0.046,0.418,0.076,0.284,0.11,0.075,0.119,0.144,0.075,0.117,0.297,0.149,0.209,0.086,0.361,0.097,0.055,0.109,0.062,0.093,0.186,0.18,0.076,0.136,0.083,0.032,0.089,0.144,0.085,0.117,0.118,0.125,0.095,0.156,0.089,0.152,0.102,0.251,0.099,0.104,0.105,0.13,0.123,0.117,0.252,0.153,0.248,0.108,0.148,0.17,0.106,0.256,0.11,0.06,0.154,0.086,0.125,0.084,0.09,0.122,0.096,0.078,0.084,0.061,0.07,0.098,0.131,0.14,0.086,0.115,0.088,0.118,0.442,0.148,0.219,0.273,0.072,0.121,0.125,0.061,0.132,0.071,0.091,0.126,0.081,0.29,0.179,0.104,0.112,0.096,0.279,0.092,0.102,0.091,0.09,0.166,0.086,0.204,0.122,0.09,0.071,0.104,0.102,0.139,0.084,0.128,0.155,0.286,0.108,0.136,0.103,0.081,0.098,0.26,0.119,0.176,0.09,0.128,0.07,0.131,0.161,0.203,0.115,0.11,0.093,0.074,0.115,0.097,0.113,0.104,0.206,0.324,0.048,0.138,0.125,0.202,0.067,0.139,0.26,0.094,0.095,0.141,0.128,0.116,0.159,0.577,0.68,0.488,0.219,0.544,0.473,0.43,0.515,0.214,0.462,0.62,0.422,0.431,0.517,0.418,0.899,0.47,0.945,0.851,0.635,0.92,0.665,0.474,0.577,0.427,0.405,0.172,0.676,0.522,0.505,0.422,0.16,0.354,0.553,0.523,0.462,0.429,0.106,0.049,0.553,0.269,0.572,0.216,0.278,0.498,0.178,0.512,0.093,0.338,0.262,0.287,0.702,0.718,0.203,0.497,0.165,0.15,0.403,0.484,0.736,0.106,0.309,0.306,0.633,0.477,0.637,0.501,0.655,0.452,0.603,0.089,0.305,2.195,0.322,0.568,0.565,0.308,0.442,0.615,0.143,0.23,0.095,0.034,0.542,0.465,0.056,0.177,0.286,0.128,0.289,0.046,0.125,0.093,0.181,0.102,0.22,0.166,0.118,0.515,0.166,0.274,0.157,0.151,0.171,0.304,1.282,0.147,0.223,0.301,0.535,0.112,0.096,0.518,0.065,0.126,0.308,0.133,0.382,0.217,0.078,0.462,0.332,0.32,0.315,0.124,0.117,0.552,0.446,0.239,0.276,0.445,0.45,0.402]],"container":"<table class=\"display\">\n <thead>\n <tr>\n <th> <\/th>\n <th>Speaker<\/th>\n <th>DRESS<\/th>\n <th>FLEECE<\/th>\n <th>GOOSE<\/th>\n <th>KIT<\/th>\n <th>LOT<\/th>\n <th>NURSE<\/th>\n <th>START<\/th>\n <th>STRUT<\/th>\n <th>THOUGHT<\/th>\n <th>TRAP<\/th>\n <th>N_tokens<\/th>\n <th>Overall_percent<\/th>\n <\/tr>\n <\/thead>\n<\/table>","options":{"scrollX":true,"columnDefs":[{"className":"dt-right","targets":[2,3,4,5,6,7,8,9,10,11,12,13]},{"orderable":false,"targets":0}],"order":[],"autoWidth":false,"orderClasses":false}},"evals":[],"jsHooks":[]}</script>
</div>
</div>
</div>
<div id="normalisation" class="section level1">
<h1>Normalisation</h1>
<p>We will now normalise the raw F1 and F2 values.</p>
<p>Here, we introduce an adapted version of the Lobanov (1971) normalisation method, which we refer to as <code>Lobanov 2.0</code>. Explanations of the formula for each of the methods (Lobanov and Lobanov 2.0) are given below. Please refer to the paper for reasons why this adapted version was preferred to Lobanov’s original normalisation method.</p>
<div id="lobanov-formula" class="section level2">
<h2>Lobanov formula:</h2>
<p><span class="math display">\[
\begin{equation}
F_{lobanov_i} = \frac{(F_{raw_i}-\mu_{raw_i})}{\sigma_{raw_i}}
\end{equation}
\]</span></p>
<ul>
<li><span class="math inline">\(i\)</span> = either F1 or F2</li>
<li><span class="math inline">\(F_{lobanov_i}\)</span> = the normalised value in <span class="math inline">\(i\)</span></li>
<li><span class="math inline">\(F_{raw_i}\)</span> = the raw formant measurement value in <span class="math inline">\(i\)</span></li>
<li><span class="math inline">\(\mu_{raw_i}\)</span> = the mean formant value calculated across all raw values in <span class="math inline">\(i\)</span></li>
<li><span class="math inline">\(\sigma_{raw_i}\)</span> = the standard deviation calculated across all raw values in <span class="math inline">\(i\)</span></li>
</ul>
<p>In plain English, the formula subtracts the mean formant value of a speaker from the raw individual formant value, then divides that by the standard deviation of the formant values.</p>
<p>e.g. if a speaker has a raw F1 of 400hz, a mean F1 of 500hz and a standard deviation of 70hz, this would give a Lobanov normalised value of (400-500)/70 = -1.43.</p>
</div>
<div id="lobanov-2.0-formula" class="section level2">
<h2>Lobanov 2.0 formula:</h2>
<p><span class="math display">\[
\begin{equation}
F_{lobanov2.0_i} = \frac{(F_{raw_i}-\mu_{(\mu_{vowel_1},\cdots,\mu_{vowel_n})})}{\sigma_{(\mu_{vowel_1},\cdots,\mu_{vowel_n})}}
\end{equation}
\]</span></p>
<ul>
<li><span class="math inline">\(i\)</span> = either F1 or F2</li>
<li><span class="math inline">\(F_{lobanov2.0_i}\)</span> = the normalised value in <span class="math inline">\(i\)</span></li>
<li><span class="math inline">\(F_{raw_i}\)</span> = the raw formant measurement value in <span class="math inline">\(i\)</span></li>
<li><span class="math inline">\(\mu_{(\mu_{vowel_1},\cdots,\mu_{vowel_n})}\)</span> = the mean taken from the mean formant value calculated per vowel in <span class="math inline">\(i\)</span></li>
<li><span class="math inline">\(\sigma_{(\mu_{vowel_1},\cdots,\mu_{vowel_n})}\)</span> = the standard deviation taken from the mean formant value calculated per vowel in <span class="math inline">\(i\)</span></li>
</ul>
<p>In plain English, the formula subtracts the mean of means formant value of a speaker (calculated as the mean of means, where a mean for each vowel is calculated, then the mean taken of those means) from the raw individual formant value, then divides that by the standard deviation of the mean of mean values.</p>
<p>e.g. if a speaker has a raw F1 of 400hz, a mean of means F1 of 550hz and a standard deviation (for the mean of means) of 70hz, this would give a Lobanov 2.0 normalised value of (400-550)/70 = -2.14.</p>
</div>
<div id="implementation" class="section level2">
<h2>Implementation</h2>
<p>The primary difference between the formula for this adapted version and Lobanov’s original formula, is that each of the vowels has a mean formant value calculated, then a mean of those means is taken as the mean in the formula. The motivation for doing this is that the data we are normalising contains speakers with varying numbers of tokens across the different vowels. Lobanov’s method is suited (and designed) based on balanced data, where an equal number of tokens per vowel are normalised.</p>
<p>When normalising with unbalanced numbers of tokens per vowel, the calculation of <span class="math inline">\(\mu_{raw_i}\)</span> (the mean of all the raw formant values), can be skewed by tokens that have a much larger count in a certain vowel.</p>
<p>Therefore, we first calculate means for each of the individual vowels (per speaker, per formant), then calculate the mean based on those means. This approach allows for tokens in vowel categories to be weighted equally regardless of how many tokens there are, making the normalisation more reliable for this type of dataset.</p>
<p>For visualisation purposes, we plot the normalised values for F1 and F2 against each other in the plots below (Lobanov 2.0 is on the x axis and Lobanov on the y axis, with coloured lines representing each speaker, the black line represents where the values would be if they were equal, i.e. if Lobanov 2.0 = Lobanov)</p>
<pre class="r"><code>#standard Lobanov normalisation - calculate means across all vowels per speaker
summary_vowels_all_lobanov <- vowels_all %>%
group_by(Speaker) %>%
dplyr::summarise(mean_F1_lobanov = mean(F1_50),
mean_F2_lobanov = mean(F2_50),
sd_F1_lobanov = sd(F1_50),
sd_F2_lobanov = sd(F2_50),
token_count = n())
#Lobanov 2.0 - calculate means per vowel and per speaker
summary_vowels_all <- vowels_all %>%
group_by(Speaker, Vowel) %>%
dplyr::summarise(mean_F1 = mean(F1_50),
mean_F2 = mean(F2_50),
sd_F1 = sd(F1_50),
sd_F2 = sd(F2_50),
token_count_vowel = n())
#get the mean_of_means and sd_of_means from the the speaker_summaries, this will give each speaker a mean caculated from the means across all vowels, as well as the standard deviation of the means
summary_mean_of_means <- summary_vowels_all %>%
group_by(Speaker) %>%
dplyr::summarise(mean_of_means_F1 = mean(mean_F1),
mean_of_means_F2 = mean(mean_F2),
sd_of_means_F1 = sd(mean_F1),
sd_of_means_F2 = sd(mean_F2)
)
#combine these values with the full raw dataset, then use these values to normalise the data with both the Lobanov and the Lobanov 2.0 method
vowels_all <- vowels_all %>%
#add in the data
left_join(., summary_mean_of_means) %>%
left_join(., summary_vowels_all[, c("Speaker", "Vowel", "token_count_vowel")]) %>%
left_join(., summary_vowels_all_lobanov) %>%
#normalise the raw F1 and F2 values with Lobanov
mutate(F1_lobanov = (F1_50 - mean_F1_lobanov)/sd_F1_lobanov,
F2_lobanov = (F2_50 - mean_F2_lobanov)/sd_F2_lobanov,
#normalise with Lobanov 2.0
F1_lobanov_2.0 = (F1_50 - mean_of_means_F1)/sd_of_means_F1,
F2_lobanov_2.0 = (F2_50 - mean_of_means_F2)/sd_of_means_F2) %>%
#remove the variables that are not required
dplyr::select(-(mean_of_means_F1:sd_of_means_F2), -(mean_F1_lobanov:sd_F2_lobanov))
#remove the previous summary data frames
rm(summary_vowels_all_lobanov, summary_vowels_all, summary_mean_of_means)
#inspect the relationship between the two normalised values
vowels_all %>%
ggplot(aes(x = F1_lobanov_2.0, y = F1_lobanov, colour = Speaker)) +
geom_smooth(method = "lm", size = 0.1, show.legend = FALSE) +
geom_abline(slope=1, intercept=0) +
theme_bw()</code></pre>
<p><img src="Covariation_monophthongs_analysis_files/figure-html/unnamed-chunk-9-1.png" width="2800" /></p>
<pre class="r"><code>vowels_all %>%
ggplot(aes(x = F2_lobanov_2.0, y = F2_lobanov, colour = Speaker)) +
geom_smooth(method = "lm", size = 0.1, show.legend = FALSE) +
geom_abline(slope=1, intercept=0) +
theme_bw()</code></pre>
<p><img src="Covariation_monophthongs_analysis_files/figure-html/unnamed-chunk-9-2.png" width="2800" /></p>
<p>Make a plot for Figure 1 in the manuscript, of speakers born between 1900-1930. This will show the normalised vowel space and individual speaker means for the 10 vowels. There will also be ellipses to show the variation in the vowel productions and the black points indicate the individual vowel means, calculated across the sample of speakers.</p>
<pre class="r"><code>#calculate individual speaker means for each vowel
vowel_means_example <- vowels_all %>%
filter(participant_year_of_birth %in% c(1900:1930)) %>%
group_by(Speaker, Vowel, Gender, participant_year_of_birth) %>%
summarise(mean_F1 = mean(F1_lobanov_2.0),
mean_F2 = mean(F2_lobanov_2.0))
vowel_means_example1 <- vowels_all %>%
filter(participant_year_of_birth %in% c(1900:1930)) %>%
group_by(Vowel) %>%
summarise(mean_F1 = mean(F1_lobanov_2.0),
mean_F2 = mean(F2_lobanov_2.0))
vowel_means_example_plot <- vowel_means_example %>%
ggplot(aes(x = mean_F2, y = mean_F1, colour = Vowel)) +
geom_point() +
stat_ellipse(level = 0.67) +
geom_label(data = vowel_means_example1, aes(label = Vowel)) +
geom_point(data = vowel_means_example %>% filter(Speaker == "CC_f_326")) +
geom_point(data = vowel_means_example %>% filter(Speaker == "CC_f_326"), colour = "black", size = 3, shape = 5, stroke = 2) +
scale_x_reverse(name = "F2 (Normalised)", position = "top") +
scale_y_reverse(name = "F1 (Normalised)", position = "right") +
theme_bw() +
theme(legend.position = "none")
vowel_means_example_plot</code></pre>
<p><img src="Covariation_monophthongs_analysis_files/figure-html/unnamed-chunk-10-1.png" width="2800" /></p>
<pre class="r"><code>ggsave(plot = vowel_means_example_plot, filename = "Figures/vowel_means_example.png", dpi = 400)</code></pre>
</div>
</div>
<div id="gamm-modelling" class="section level1">
<h1>GAMM modelling</h1>
<p>In order to analyse co-variation in the dataset, we first must extract a measure of how the speakers vocalic variables differ from one another. To achieve this, we first run a series of Generalised Additive Mixed Models (GAMMs), from which we can extract the by-speaker random intercepts. This is done using the <code>mgcv</code> and <code>itsadug</code> packages, if you are unfamiliar with this form of analysis, see (Winter and Wieling, (2016))[<a href="https://academic.oup.com/jole/article/1/1/7/2281883" class="uri">https://academic.oup.com/jole/article/1/1/7/2281883</a>] or (Sóskuthy, (2017))[<a href="https://arxiv.org/abs/1703.05339" class="uri">https://arxiv.org/abs/1703.05339</a>], for further information about why we chose the by-speaker intercepts, please refer to the manuscript or see <a href="https://www.cambridge.org/core/services/aop-cambridge-core/content/view/6B661A6226E015A613AB22616C9C2300/S0954394512000014a.pdf/exploiting_random_intercepts_two_case_studies_in_sociophonetics.pdf">Drager and Hay (2012)</a></p>
<p>In total there will be 20 separate models (10 vowels x 2 formants) that will be fitted, each of which we will extract the random intercepts from the random effect of <code>Speaker</code>, as well as the model summary.</p>
<div id="fitting-procedure" class="section level2">
<h2>Fitting procedure</h2>
<p>Each of the models will use the data from one of the 10 vowels (in the <code>Vowel</code> variable) and will have either the <code>F1_lobanov_2.0</code> or the <code>F2_lobanov_2.0</code> variable as the dependent/predicted measure.</p>
<p>All models will be fit uniformly, i.e. with the same fixed and random effects structures.</p>
<p>The fixed effects are:</p>
<ul>
<li><p>An interaction between <code>participant_year_of_birth</code> and <code>Gender</code></p></li>
<li><p><code>participant_year_of_birth</code></p></li>
<li><p><code>Gender</code></p></li>
<li><p><code>Speech_rate</code></p></li>
</ul>
<p>The random effects are:</p>
<ul>
<li><p><code>Speaker</code></p></li>
<li><p><code>Word</code></p></li>
</ul>
<p>The <code>participant_year_of_birth</code> variable is modeled with a smooth term with 10 knots, this is to account for the non-linear ‘wiggliness’ of the effect.</p>
<p>To run the models in an efficient way and store the by-speaker intercepts, we use a <code>for</code> loop to iterate through each of the vowels, extracting the intercepts from each model and adding them to a data frame.</p>
<p>A for loop works by iterating over each value in a series, here we will loop through each value in our <code>Vowels</code> variable and extract the relevant information.</p>
<p>e.g the for loop will start with <code>DRESS</code>, run the GAMM for F1, extract the by-speaker intercepts from that model, it will then run the GAMM for F2, extract the speaker intercepts from this model, then add the 2 sets of intercepts to a data frame (<code>gam_intercepts.tmp</code>). The loop will then move on to the next vowel, <code>FLEECE</code> and do exactly the same process. The loop will finish once all vowels have been ‘looped’ through.</p>
<p>This will result in a data frame comprising:</p>
<ul>
<li><p>494 rows (one row per speaker)</p></li>
<li><p>1 column identifying the speaker name</p></li>
<li><p>20 additional columns identifying the variable being modeled (e.g. F1_DRESS), the numeric values here represent the by-speaker intercepts from that variable’s model</p></li>
</ul>
<p><strong>Note, this process takes several hours (six and half hours on my machine) to complete</strong>. The output has been stored in files in the <code>GAMM_output</code> folder, for quick reference. Please see those files or load them in to your R session for the rest of the analysis if you do not run the following code chunk.</p>
<p>The intercepts are saved as <code>gamm_intercepts.csv</code>, the model summaries can be found in the <code>model_summaries</code> sub-folder, where each model summary is stored as a <code>.rds</code> file, e.g. <code>gam_summary_F1_DRESS.rds</code> contains the model summary for F1_DRESS.</p>