-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
700 lines (575 loc) · 27.5 KB
/
README.Rmd
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
---
title: "Replication code for \"Crossing the Linguistic Causeway: A Binational Approach for Translating Soundscape Attributes to Bahasa Melayu\""
output: github_document
always_allow_html: true
#Bhan, Lam (2022) [Nanyang Technological University]
#ORCID: 0000-0001-5193-6560
#GitHub: https://github.com/bhanlam/
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE,warning = FALSE, message = FALSE)
library(pander)
library(dataverse)
library(dplyr)
library(stringr)
library(kableExtra)
library(tidyr)
library(rstatix)
library(muStat)
library(conover.test)
library(fmsb)
library(RColorBrewer)
source("helper.R")
```
This repository contains the code accompanying the publication "Crossing the Linguistic Causeway: A Binational Approach for Translating Soundscape Attributes to Bahasa Melayu". This paper is hosted on [arXiv]() and the raw dataset is hosted at [10.21979/N9/0NE37R](https://doi.org/10.21979/N9/0NE37R).
## Environment
The code has been tested on the following platform.
```{r session, message=FALSE, echo=FALSE}
pander(sessionInfo())
```
## Data preparation
The raw data file is retrieved and cleaned.
### Dataloader
The raw dataset is retrieved from the DR-NTU (Data) [https://researchdata.ntu.edu.sg] Dataverse repository at [10.21979/N9/0NE37R](https://doi.org/10.21979/N9/0NE37R) and processed.
```{r dataloader, message=FALSE}
#Set dataverse server
Sys.setenv("DATAVERSE_SERVER" = "https://researchdata.ntu.edu.sg")
#Retrieve raw data in csv
dataset <- get_dataframe_by_name(
filename = "SATPQn.csv",
dataset = "doi:10.21979/N9/0NE37R",
original = TRUE,
.f = read.csv)
```
### Data cleaning
The raw data headers are first converted to ASCII to remove UTF-8 formatting. The survey responses are subsetted to remove participant data with "country of residence" that is neither Singapore (SG) or Malaysia (MY). The resulting dataset consists of 63 participant responses after the removal of 3 participants.
This is followed by extraction of individual dataframes corresponding to the respective criteria categories for main and derived axis attributes, respectively.
```{r cleaning, message=FALSE}
#convert column names to ASCII
colnames(dataset)<-iconv(colnames(dataset),
from = 'UTF-8',
to = 'ASCII//TRANSLIT')
#remove non-SG/MY respondents
sgmydata <- dataset %>%
dplyr::rename(COUNTRY=Current.country.of.residence) %>%
mutate(COUNTRY=ifelse(COUNTRY=="Malaysia","MY", COUNTRY)) %>%
mutate(COUNTRY=ifelse(COUNTRY=="Singapore","SG", COUNTRY)) %>%
mutate(COUNTRY=ifelse(COUNTRY=="Europe","Others", COUNTRY)) %>%
mutate(COUNTRY=ifelse(COUNTRY=="Asia (excl. MY and SG)",
"Others", COUNTRY)) %>%
filter(!str_detect(COUNTRY, "Others"))
#define column names for main and derived axes
mainColnames<-c('COUNTRY','APPR','UNDR','ANTO','BIAS',
'ASSOCCW','IMPCCW','ASSOCW','IMPCW','CANDIDATE')
derivedColnames<-c('COUNTRY','APPR','UNDR','ASSOCCW',
'IMPCCW','ASSOCW','IMPCW','CANDIDATE')
#extract responses for each PAQ attribute and rename columns with criteria
#main axes
eventdf<-sgmydata %>%
select(matches('that.meriah|is.meriah|COUNTRY')) %>%
mutate(candidate="meriah") %>% setNames(mainColnames)
pleasdf<-sgmydata %>%
select(matches('menyenangkan|COUNTRY')) %>%
mutate(candidate="menyenangkan") %>% setNames(mainColnames)
uneventdf<-sgmydata %>%
select(matches('tidak.meriah|COUNTRY')) %>%
mutate(candidate="tidak meriah") %>% setNames(mainColnames)
annoydf<-rbind(sgmydata %>%
select(matches('membingitkan|COUNTRY')) %>%
mutate(candidate="membingitkan") %>%
setNames(mainColnames),
sgmydata %>%
select(matches('menjengkelkan|COUNTRY')) %>%
mutate(candidate="menjengkelkan") %>%
setNames(mainColnames))
#dervied axes
vibrantdf<-rbind(sgmydata %>% select(matches('rancak|COUNTRY')) %>%
mutate(candidate="rancak") %>%
setNames(derivedColnames),
sgmydata %>% select(matches('bersemarak|COUNTRY')) %>%
mutate(candidate="bersemarak") %>%
setNames(derivedColnames))
calmdf<-rbind(sgmydata %>% select(matches('tenang|COUNTRY')) %>%
mutate(candidate="tenang") %>%
setNames(derivedColnames),
sgmydata %>% select(matches('menenangkan|COUNTRY')) %>%
mutate(candidate="menenangkan") %>%
setNames(derivedColnames))
monotdf<-rbind(sgmydata %>% select(matches('that.membosankan|COUNTRY')) %>%
mutate(candidate="membosankan") %>%
setNames(derivedColnames),
sgmydata %>% select(matches('tidak.berubah.oleh.itu.membosankan|COUNTRY')) %>%
mutate(candidate="tidak berubah oleh itu membosankan") %>%
setNames(derivedColnames),
sgmydata %>% select(matches('kurang.kepelbagaian.oleh.itu.membosankan|COUNTRY')) %>%
mutate(candidate="kurang kepelbagaian oleh itu membosankan") %>%
setNames(derivedColnames))
chaoticdf<-rbind(sgmydata %>% select(matches('huru.hara|COUNTRY')) %>%
mutate(candidate="huru-hara") %>%
setNames(derivedColnames),
sgmydata %>% select(matches('kelam.kabut|COUNTRY')) %>%
mutate(candidate="kelam-kabut") %>%
setNames(derivedColnames))
```
### Cleaning of demographic information
```{r democlean, message=FALSE}
#column names
demoCol <- c("Prof.zsm","Prof.eng","COUNTRY","LoSOut","DISCIPLINE")
sgmydata_demo <- sgmydata %>%
select(2:6) %>% setNames(demoCol) %>%
mutate(DISCIPLINE=ifelse(grepl('*Science*',DISCIPLINE, ignore.case=T),
"Sciences", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*Physic*',DISCIPLINE, ignore.case=T),
"Sciences", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*Math*',DISCIPLINE, ignore.case=T),
"Sciences", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*English*',DISCIPLINE, ignore.case=T),
"HASS", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*Psychology*',DISCIPLINE, ignore.case=T),
"HASS", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*Literature*',DISCIPLINE, ignore.case=T),
"HASS", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*Sociology*',DISCIPLINE, ignore.case=T),
"HASS", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*Media*',DISCIPLINE, ignore.case=T),
"HASS", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*geog*',DISCIPLINE, ignore.case=T),
"HASS", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*Music*',DISCIPLINE, ignore.case=T),
"Audio-related", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*Sound*',DISCIPLINE, ignore.case=T),
"Audio-related", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*Audio*',DISCIPLINE, ignore.case=T),
"Audio-related", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*Acoustic*',DISCIPLINE, ignore.case=T),
"Audio-related", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*engineering*',DISCIPLINE, ignore.case=T),
"Engineering", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(grepl('*tech*',DISCIPLINE, ignore.case=T),
"Engineering", DISCIPLINE)) %>%
mutate(DISCIPLINE=ifelse(!grepl('Sciences|Engineering|HASS|Audio-related',
DISCIPLINE, ignore.case=F),
"Others", DISCIPLINE))
```
### Formulation of criteria scores
Main Axes: APPR, UNDR, CLAR, ANTO, ORTH, NCON, IBAL
Derived Axes: APPR, UNDR, CLAR, CONN, IBAL
```{r formulation, message=FALSE}
#compute formulation across df of attributes on main axes
main.formulated<-list(eventdf,pleasdf,uneventdf,annoydf) %>%
lapply(mainForm)
#compute formulation across df of attributes on derived axes
der.formulated<-list(vibrantdf,calmdf,monotdf,chaoticdf) %>%
lapply(derForm)
eventformdf<-main.formulated[[1]]
pleasformdf<-main.formulated[[2]]
uneventformdf<-main.formulated[[3]]
annoyformdf<-main.formulated[[4]] %>%
mutate(SPLITCANDIDATE=paste(COUNTRY,CANDIDATE))
vibrantformdf<-der.formulated[[1]] %>%
mutate(SPLITCANDIDATE=paste(COUNTRY,CANDIDATE))
calmformdf<-der.formulated[[2]] %>%
mutate(SPLITCANDIDATE=paste(COUNTRY,CANDIDATE))
monotformdf<-der.formulated[[3]] %>%
mutate(SPLITCANDIDATE=paste(COUNTRY,CANDIDATE))
chaoticformdf<-der.formulated[[4]] %>%
mutate(SPLITCANDIDATE=paste(COUNTRY,CANDIDATE))
```
## Demographic
The demographics of the 63 participants are summarised based on "length of stay outside SG/MY", "disiciplines", "malay language proficiency", and "english language proficiency".
```{r demoplots, message=FALSE}
#LoS
sgmydata_demo %>%
group_by(LoSOut) %>%
summarise(Singapore=sum(COUNTRY=="SG"),Malaysia=sum(COUNTRY=="MY")) %>%
kbl(caption = "Length of Stay Outside SG/MY") %>%
kable_classic(full_width = F, html_font = "Cambria")
#Disicpline
sgmydata_demo %>%
group_by(DISCIPLINE) %>%
summarise(Singapore=sum(COUNTRY=="SG"),Malaysia=sum(COUNTRY=="MY")) %>%
kbl(caption = "Discipline") %>%
kable_classic(full_width = F, html_font = "Cambria")
#Malay Language Proficiency
sgmydata_demo %>%
group_by(Prof.zsm) %>%
summarise(Singapore=sum(COUNTRY=="SG"),Malaysia=sum(COUNTRY=="MY")) %>%
kbl(caption = "Malay Language Proficiency") %>%
kable_classic(full_width = F, html_font = "Cambria")
#English Language Proficiency
sgmydata_demo %>%
group_by(Prof.zsm) %>%
summarise(Singapore=sum(COUNTRY=="SG"),Malaysia=sum(COUNTRY=="MY")) %>%
kbl(caption = "English Language Proficiency") %>%
kable_classic(full_width = F, html_font = "Cambria")
```
## Exploratory analysis
Compute criteria mean scores of all PAQ attributes across the combined, SG, and MY populations.
```{r explore,message=FALSE}
#Combined cases
#main axes
mainAxCOMBmean <- rbind(cbind(data.frame(PAQ="eventful"),mainAxSummary(eventformdf)),
cbind(data.frame(PAQ="pleasant"),mainAxSummary(pleasformdf)),
cbind(data.frame(PAQ="uneventful"),mainAxSummary(uneventformdf)),
cbind(data.frame(PAQ="annoying"),mainAxSummary(annoyformdf))) %>%
mutate(COUNTRY="Combined")
#derived axes
derAxCOMBmean <-rbind(cbind(data.frame(PAQ="vibrant"),derAxSummary(vibrantformdf)),
cbind(data.frame(PAQ="calm"),derAxSummary(calmformdf)),
cbind(data.frame(PAQ="monotonous"),derAxSummary(monotformdf)),
cbind(data.frame(PAQ="chaotic"),derAxSummary(chaoticformdf))) %>%
mutate(COUNTRY="Combined")
#Split cases (SG/MY)
#main axes
mainAxSPLITmean <- rbind(cbind(data.frame(PAQ="eventful"),mainAxSummarySPLIT(eventformdf)),
cbind(data.frame(PAQ="pleasant"),mainAxSummarySPLIT(pleasformdf)),
cbind(data.frame(PAQ="uneventful"),mainAxSummarySPLIT(uneventformdf)),
cbind(data.frame(PAQ="annoying"),mainAxSummarySPLIT(annoyformdf)))
#derived axes
derAxSPLITmean <-rbind(cbind(data.frame(PAQ="vibrant"),derAxSummarySPLIT(vibrantformdf)),
cbind(data.frame(PAQ="calm"),derAxSummarySPLIT(calmformdf)),
cbind(data.frame(PAQ="monotonous"),derAxSummarySPLIT(monotformdf)),
cbind(data.frame(PAQ="chaotic"),derAxSummarySPLIT(chaoticformdf)))
#pivot dataframe for visualisation
summaryMean<-rbind(rbind(mainAxCOMBmean,mainAxSPLITmean) %>%
pivot_longer(cols=!c(PAQ,CANDIDATE,COUNTRY),
names_to="CRITERIA",
values_to="mean"),
rbind(derAxCOMBmean,derAxSPLITmean) %>%
pivot_longer(cols=!c(PAQ,CANDIDATE,COUNTRY),
names_to="CRITERIA",
values_to="mean")) %>%
group_by(PAQ,CRITERIA,CANDIDATE) %>%
summarise(Combined=mean[COUNTRY=="Combined"],
SG=mean[COUNTRY=="SG"],
MY=mean[COUNTRY=="MY"])
#Plot table of mean scores
summaryMean %>%
kbl(caption = "Mean evaluation scores for the
PAQ attributes for all evaluation criteria across combined,
SG and MY populations") %>%
kable_classic(full_width = F, html_font = "Cambria")
```
### Radar plots of mean scores (combined SG & MY)
```{r radplotcomb, message=FALSE}
#Plot mean scores in a radar chart
mainAXisradardf <- rbind(
data.frame(rbind(rep(1,7),rep(0.4,7))) %>%
setNames(c("APPR","UNDR","CLAR","ANTO","ORTH","NCON","IBAL")) %>%
`rownames<-`(c("Max","Min")),
mainAxCOMBmean %>% select(APPR:IBAL) %>%
`rownames<-`(mainAxCOMBmean$CANDIDATE))
derAXisradardf <- rbind(
data.frame(rbind(rep(1,5),rep(0.4,5))) %>%
setNames(c("APPR","UNDR","CLAR","CONN","IBAL")) %>%
`rownames<-`(c("Max","Min")),
derAxCOMBmean %>% filter(!grepl('kurang|bersemarak|berubah|kelam|menenangkan', CANDIDATE)) %>% select(APPR:IBAL) %>% `rownames<-`(derAxCOMBmean %>% filter(!grepl('kurang|bersemarak|berubah|kelam|menenangkan', CANDIDATE)) %>% .$CANDIDATE))
#define color palette
set2 <- RColorBrewer::brewer.pal(7, "Set2")
#Main Axis
op1 <- par(mar = c(0, 0, 0, 0))
create_beautiful_radarchart(mainAXisradardf,
#caxislabels = c(0, 0.25, 0.5, 0.75, 1),
caxislabels = c(0.4, 0.55, 0.7, 0.85, 1),
color = set2,
vlcex = .9,calcex=.7,
plty=c(1,2,3,4,5,6,7))
# Add an horizontal legend
legend(
x = "bottomright",
legend = paste(c("eventful |","pleasant |","uneventful |",
"annoying |","annoying |"),
row.names(mainAXisradardf)[-c(2,1)]),
horiz = FALSE,
bty = "n", pch = 20 , col = set2,
text.col = "black", cex = .9, pt.cex = 1.5
)
par(op1)
#Derived Axis
op2 <- par(mar = c(0, 0, 0, 0))
create_beautiful_radarchart(derAXisradardf,
#caxislabels = c(0, 0.25, 0.5, 0.75, 1),
caxislabels = c(0.4, 0.55, 0.7, 0.85, 1),
color = set2,
vlcex = .9,calcex=.7,
plty=c(1,2,3,4,5,6,7))
# Add an horizontal legend
legend(
x = "topright",
legend = paste(c("vibrant |","calm |","monotonous |",
"chaotic |"),
row.names(derAXisradardf)[-c(2,1)]),
horiz = FALSE,
bty = "n", pch = 20 , col = set2,
text.col = "black", cex = .9, pt.cex = 1.5
)
par(op2)
```
### Radar plots of mean scores (by population)
```{r radplotSplit, message=FALSE}
#Plot mean scores in a radar chart
mainAXisradardf.sg <- rbind(
data.frame(rbind(rep(1,7),rep(0.4,7))) %>%
setNames(c("APPR","UNDR","CLAR","ANTO","ORTH","NCON","IBAL")) %>%
`rownames<-`(c("Max","Min")),
mainAxSPLITmean %>% filter(COUNTRY=="SG") %>% select(APPR:IBAL) %>%
`rownames<-`(mainAxCOMBmean$CANDIDATE))
mainAXisradardf.my <- rbind(
data.frame(rbind(rep(1,7),rep(0.4,7))) %>%
setNames(c("APPR","UNDR","CLAR","ANTO","ORTH","NCON","IBAL")) %>%
`rownames<-`(c("Max","Min")),
mainAxSPLITmean %>% filter(COUNTRY=="MY") %>% select(APPR:IBAL) %>%
`rownames<-`(mainAxCOMBmean$CANDIDATE))
derAXisradardf.sg <- rbind(
data.frame(rbind(rep(1,5),rep(0.4,5))) %>%
setNames(c("APPR","UNDR","CLAR","CONN","IBAL")) %>%
`rownames<-`(c("Max","Min")),
derAxSPLITmean %>% filter(COUNTRY=="SG") %>%
filter(!grepl('kurang|bersemarak|berubah|kelam|menenangkan', CANDIDATE)) %>%
select(APPR:IBAL) %>%
`rownames<-`(derAxCOMBmean %>%
filter(!grepl('kurang|bersemarak|berubah|kelam|menenangkan', CANDIDATE)) %>%
.$CANDIDATE))
derAXisradardf.my <- rbind(
data.frame(rbind(rep(1,5),rep(0.4,5))) %>%
setNames(c("APPR","UNDR","CLAR","CONN","IBAL")) %>%
`rownames<-`(c("Max","Min")),
derAxSPLITmean %>% filter(COUNTRY=="MY") %>%
filter(!grepl('kurang|bersemarak|berubah|kelam|menenangkan', CANDIDATE)) %>%
select(APPR:IBAL) %>%
`rownames<-`(derAxCOMBmean %>%
filter(!grepl('kurang|bersemarak|berubah|kelam|menenangkan', CANDIDATE)) %>%
.$CANDIDATE))
#define color palette
set2 <- RColorBrewer::brewer.pal(7, "Set2")
#Main Axis
op.main.sg <- par(mar = c(0, 0, 0, 0))
create_beautiful_radarchart(mainAXisradardf.sg,
#caxislabels = c(0, 0.25, 0.5, 0.75, 1),
caxislabels = c(0.4, 0.55, 0.7, 0.85, 1),
color = set2,
vlcex = .9,calcex=.7,
plty=c(1,2,3,4,5,6,7))
# Add an horizontal legend
legend(
x = "bottomright",
legend = paste(c("eventful |","pleasant |","uneventful |",
"annoying |","annoying |"),
row.names(mainAXisradardf.sg)[-c(2,1)]),
horiz = FALSE,
bty = "n", pch = 20 , col = set2,
text.col = "black", cex = .9, pt.cex = 1.5
)
par(op.main.sg)
#Derived Axis
op.der.sg <- par(mar = c(0, 0, 0, 0))
create_beautiful_radarchart(derAXisradardf.sg,
#caxislabels = c(0, 0.25, 0.5, 0.75, 1),
caxislabels = c(0.4, 0.55, 0.7, 0.85, 1),
color = set2,
vlcex = .9,calcex=.7,
plty=c(1,2,3,4,5,6,7))
# Add an horizontal legend
legend(
x = "topright",
legend = paste(c("vibrant |","calm |","monotonous |",
"chaotic |"),
row.names(derAXisradardf.sg)[-c(2,1)]),
horiz = FALSE,
bty = "n", pch = 20 , col = set2,
text.col = "black", cex = .9, pt.cex = 1.5
)
par(op.der.sg)
#Main Axis
op.main.my <- par(mar = c(0, 0, 0, 0))
create_beautiful_radarchart(mainAXisradardf.my,
#caxislabels = c(0, 0.25, 0.5, 0.75, 1),
caxislabels = c(0.4, 0.55, 0.7, 0.85, 1),
color = set2,
vlcex = .9,calcex=.7,
plty=c(1,2,3,4,5,6,7))
# Add an horizontal legend
legend(
x = "bottomright",
legend = paste(c("eventful |","pleasant |","uneventful |",
"annoying |","annoying |"),
row.names(mainAXisradardf.my)[-c(2,1)]),
horiz = FALSE,
bty = "n", pch = 20 , col = set2,
text.col = "black", cex = .9, pt.cex = 1.5
)
par(op.main.my)
#Derived Axis
op.der.my <- par(mar = c(0, 0, 0, 0))
create_beautiful_radarchart(derAXisradardf.my,
#caxislabels = c(0, 0.25, 0.5, 0.75, 1),
caxislabels = c(0.4, 0.55, 0.7, 0.85, 1),
color = set2,
vlcex = .9,calcex=.7,
plty=c(1,2,3,4,5,6,7))
# Add an horizontal legend
legend(
x = "topright",
legend = paste(c("vibrant |","calm |","monotonous |",
"chaotic |"),
row.names(derAXisradardf.my)[-c(2,1)]),
horiz = FALSE,
bty = "n", pch = 20 , col = set2,
text.col = "black", cex = .9, pt.cex = 1.5
)
par(op.der.my)
```
## Statistical analysis
### One translation candidate
Due to differences in sample size, Kruskal-Wallis test was adopted to examine the statistical differences between SG and MY populations for PAQ attributes with only a single translation candidate, i.e. *eventful*, *uneventful*, and *pleasant*.
```{r kwtsolo, message=FALSE}
#KWT for solo translation candidates
kwtSolo<-rbind(kwTest(eventformdf,type = "main", ivar = "COUNTRY") %>% mutate(PAQ="eventful"),
kwTest(uneventformdf,type = "main", ivar = "COUNTRY") %>% mutate(PAQ="uneventful"),
kwTest(pleasformdf,type = "main", ivar = "COUNTRY") %>% mutate(PAQ="pleasant"))
#Display KWT results
kwtSolo %>%
group_by(PAQ,CRITERION) %>%
mutate(pvalue=as.numeric(pvalue),
effect=as.numeric(effect)) %>%
kbl(caption = "Kruskal-Wallis p-value and effect sizes for eventful, uneventful, and pleasant",
digits = 3, booktabs=T) %>%
kable_classic(full_width = F, html_font = "Cambria")
```
### Mulitple translation candidate
With multiple translation candidates, the data takes the form of a replicated, unbalanced completed block design. The Prentice test (PT), a generalised form of the Friedman test was adopted to evaluate the differences between the candidates (blocks) as well as the influence of country of residence (groups).
For differences detected at 5% significance level, a post-hoc Mann-Whitney-Wilcoxon rank sum test (MWWT) with Bonferroni correction was conducted for relevant pairs.
```{r ptMain, message=FALSE}
#generate p-values and effect size with prentice test
pt<-rbind(cbind(PAQ="annoying",prenticeTest(annoyformdf,type="main")),
cbind(PAQ="vibrant",prenticeTest(vibrantformdf,"derived")),
cbind(PAQ="calm",prenticeTest(calmformdf,"derived")),
cbind(PAQ="monotonous",prenticeTest(monotformdf,"derived")),
cbind(PAQ="chaotic",prenticeTest(chaoticformdf,"derived"))) %>%
cbind(TEST="PT",.)
pt %>%
group_by(PAQ,CRITERION) %>%
mutate(pvalue=as.numeric(pvalue)) %>%
kbl(caption = "Prentice test p-value for annoying, vibrant, calm, monotonous, chaotic",
digits = 3, booktabs=T) %>%
kable_classic(full_width = F, html_font = "Cambria")
#MWW Rank Sum Test
#identify which PAQ attribute and its respective criterion are < 5% significance level
pt_sig <- pt %>%
filter(pvalue<0.05)
pt_sig %>% select(c(PAQ,CRITERION)) %>%
kbl(caption = "PAQ attributes and criterions with p < 0,05",
booktabs=T) %>%
kable_classic(full_width = F, html_font = "Cambria")
#Annoying
#unqiue criterion <5%
annoyCrit<-pt_sig %>% filter(PAQ=="annoying") %>%
select(CRITERION) %>% unique(.) %>% .$CRITERION
annoySIG<-annoyformdf %>% select(c(COUNTRY,annoyCrit, CANDIDATE,))
#calm
#unique criterion <5%
calmCrit<-pt_sig %>% filter(PAQ=="calm") %>%
select(CRITERION) %>% unique(.) %>% .$CRITERION
calmSIG<-calmformdf %>% select(c(COUNTRY,calmCrit, CANDIDATE,))
#monotonous
#unique criterion <5%
monotCrit<-pt_sig %>% filter(PAQ=="monotonous") %>%
select(CRITERION) %>% unique(.) %>% .$CRITERION
monotSIG<-monotformdf %>% select(c(COUNTRY,monotCrit, CANDIDATE,))
#chaotic
#unique criterion <5%
chaoticCrit<-pt_sig %>% filter(PAQ=="chaotic") %>%
select(CRITERION) %>% unique(.) %>% .$CRITERION
chaoticSIG<-chaoticformdf %>% select(c(COUNTRY,chaoticCrit, CANDIDATE,))
#combine MWWT results for all PAQ attributes
mwwtResults <- rbind(mwwTest(df=annoySIG, criterion=annoyCrit, PAQ="annoying"),
mwwTest(df=calmSIG, criterion=calmCrit, PAQ="calm"),
mwwTest(df=monotSIG, criterion=monotCrit, PAQ="monotonous"),
mwwTest(df=chaoticSIG, criterion=chaoticCrit, PAQ="chaotic"))
mwwtResults %>%
kbl(caption = "Mann-Whitney-Wilcoxon test results",
booktabs=T, digits = 3) %>%
kable_classic(full_width = F, html_font = "Cambria")
```
### Intra-country differences
The Kruskal-Wallis test was employed to examine whether there are differences between translation candidates within each country (i.e. SG or MY).
A pairwise posthoc Conover-Iman test was conducted when significant differences were found at 5% significance levels.
```{r intrakwt, message=FALSE}
#SG
intrakwt_SG <- rbind(annoyformdf %>% filter(COUNTRY=="SG") %>%
kwTest(df = .,type = "main",ivar = "CANDIDATE") %>%
mutate(PAQ="annoying"),
vibrantformdf %>% filter(COUNTRY=="SG") %>%
kwTest(df = .,type = "derived",ivar = "CANDIDATE") %>%
mutate(PAQ="vibrant"),
calmformdf %>% filter(COUNTRY=="SG") %>%
kwTest(df = .,type = "derived",ivar = "CANDIDATE") %>%
mutate(PAQ="calm"),
monotformdf %>% filter(COUNTRY=="SG") %>%
kwTest(df = .,type = "derived",ivar = "CANDIDATE") %>%
mutate(PAQ="monotonous"),
chaoticformdf %>% filter(COUNTRY=="SG") %>%
kwTest(df = .,type = "derived",ivar = "CANDIDATE") %>%
mutate(PAQ="chaotic")) %>% mutate(COUNTRY="SG")
intrakwt_SG %>%
mutate(pvalue=as.numeric(pvalue),effect=as.numeric(effect)) %>%
kbl(caption = "Intra-country Kruskal-Wallis Test in SG",
booktabs=T, digits = 3) %>%
kable_classic(full_width = F, html_font = "Cambria")
#MY
intrakwt_MY <- rbind(annoyformdf %>% filter(COUNTRY=="MY") %>%
kwTest(df = .,type = "main",ivar = "CANDIDATE") %>%
mutate(PAQ="annoying"),
vibrantformdf %>% filter(COUNTRY=="MY") %>%
kwTest(df = .,type = "derived",ivar = "CANDIDATE") %>%
mutate(PAQ="vibrant"),
calmformdf %>% filter(COUNTRY=="MY") %>%
kwTest(df = .,type = "derived",ivar = "CANDIDATE") %>%
mutate(PAQ="calm"),
monotformdf %>% filter(COUNTRY=="MY") %>%
kwTest(df = .,type = "derived",ivar = "CANDIDATE") %>%
mutate(PAQ="monotonous"),
chaoticformdf %>% filter(COUNTRY=="MY") %>%
kwTest(df = .,type = "derived",ivar = "CANDIDATE") %>%
mutate(PAQ="chaotic")) %>% mutate(COUNTRY="MY")
intrakwt_MY %>%
mutate(pvalue=as.numeric(pvalue),effect=as.numeric(effect)) %>%
kbl(caption = "Intra-country Kruskal-Wallis Test in MY",
booktabs=T, digits = 3) %>%
kable_classic(full_width = F, html_font = "Cambria")
#CIT
#identify which PAQ attribute and its respective criterion are < 5% significance level
intrakwtSG_sig <- intrakwt_SG %>%
filter(pvalue<0.05)
intrakwtSG_sig %>% select(c(PAQ,CRITERION)) %>%
kbl(caption = "PAQ attributes and criterions in SG with p < 0,05",
booktabs=T) %>%
kable_classic(full_width = F, html_font = "Cambria")
intrakwtMY_sig <- intrakwt_MY %>%
filter(pvalue<0.05)
intrakwtMY_sig %>% select(c(PAQ,CRITERION)) %>%
kbl(caption = "PAQ attributes and criterions in SG with p < 0,05",
booktabs=T) %>%
kable_classic(full_width = F, html_font = "Cambria")
#monotonous
#unique criterion <5%
monotCrit_SG<-intrakwtSG_sig %>% filter(PAQ=="monotonous") %>%
select(CRITERION) %>% unique(.) %>% .$CRITERION
monotSIG_SG<-monotformdf %>% select(c(COUNTRY,monotCrit_SG, CANDIDATE))
monotCrit_MY<-intrakwtMY_sig %>% filter(PAQ=="monotonous") %>%
select(CRITERION) %>% unique(.) %>% .$CRITERION
monotSIG_MY<-monotformdf %>% select(c(COUNTRY,monotCrit_MY, CANDIDATE))
#CIT for monotonous across SG and MY
citResults<-rbind(ciTest(df=monotSIG_SG,
criterion = monotCrit_SG,
PAQ="monotonous") %>% mutate(COUNTRY="SG"),
ciTest(df=monotSIG_MY,
criterion = monotCrit_MY,
PAQ="monotonous") %>% mutate(COUNTRY="MY"))
#Plot CIT results
citResults %>%
mutate(pvalue=as.numeric(pvalue),adjval=as.numeric(adjval)) %>%
kbl(caption = "Conover-Iman test results",
booktabs=T, digits = 4) %>%
kable_classic(full_width = F, html_font = "Cambria")
```