-
Notifications
You must be signed in to change notification settings - Fork 0
/
CompleteAnalysis.Rmd
1777 lines (1659 loc) · 76.7 KB
/
CompleteAnalysis.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
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
---
title: "Complete Questionnaire Analysis"
output: "pdf_document"
editor_options:
chunk_output_type: console
---
The underlying markdown file of this document conducts all analyses that are reported in the paper (and more).
First, it combines the different questionnaire versions in one large collection (also see `data/AllData` and `data/AllData/combination_confi.json`).
Afterwards, different analyzes are conducted and results produced. Intermediate results and further results that are not shown in this document are stored in `results/AllData`.
```{r helpers, include=FALSE}
library(tidyverse)
library(rjson)
library(stringr)
getCompleteDataPath <- function() {
source("modules/dataPath.R", local = TRUE)
source("assets/combineResultData.R", local = TRUE)
dataPath <- getDataPath()
completeDataPath <- "data/AllData"
if (dataPath != completeDataPath) {
stop("[ERROR] Set data path to 'data/AllData'")
}
if (!dir.exists(completeDataPath)) {
stop("[ERROR] Expecting 'data/AllData' to be present")
}
combinationConfigPath <- getCombinationConfigPath(completeDataPath)
if (!file.exists(combinationConfigPath)) {
stop("[ERROR] Expecting 'data/AllData' to have combination config")
}
return(completeDataPath)
}
getCompleteResultPath <- function() {
source("assets/stratification/utils.R", local = TRUE)
return(getResultDirectory())
}
IS_LATEX <- TRUE
COMPLETE_DATA_DIRECTORY <- getCompleteDataPath()
COMPLETE_RESULTS_DIRECTORY <- getCompleteResultPath()
HPI_NAME <- "HPI"
TUM_NAME <- "TUM"
HPI_FIRST_YEAR <- "SoSe 2020"
HPI_SECOND_YEAR <- "SoSe 2021"
TUM_COMPLETE_YEAR <- "WiSe 2020/21"
# Definition of different questionnaire locations and versions
INITIAL_VERSION_DIRECTORIES <- c(
"data/AYPG/HPI_Q1-Q3", # long version
"data/AYPG/HPI_Q4", # old short version
"data/TUM_Retrospective", # old short version
"data/TUM_Q1-Q4/TUM_Q1", # old short version
"data/TUM_Q1-Q4/TUM_Q2", # old short version
"data/TUM_Q1-Q4/TUM_Q3" # old short version
)
CONFLICTING_VERSION_DIRECTORIES <- c(
"data/TUM_Q1-Q4/TUM_Q4", # new short version
"data/UYG" # new short version
)
getCleanQuestionnaireNames <- function(questionnaireText) {
if (!str_detect(questionnaireText, fixed("_"))) {
return(questionnaireText)
} else if (str_detect(questionnaireText, fixed("TUM_Retrospective"))) {
return(str_replace_all(questionnaireText, "TUM_Retrospective", "Q4"))
} else { # questionnaire name with uni name and underscore
return(str_remove_all(str_remove_all(str_remove_all(questionnaireText, TUM_NAME), HPI_NAME), "_"))
}
}
runIfNotPresent <- function(runFunction, outputPath, runParameters = NULL, forceRun = FALSE, readOutput = NA) {
if (!file.exists(outputPath) | forceRun) {
if (file.exists(outputPath) & forceRun) {
print(paste0("[INFO] Forcing execution of ", substitute(runFunction), " (overwriting ", outputPath, ")"))
}
if (is.null(runParameters)) {
return(runFunction())
} else {
return(runFunction(runParameters))
}
} else {
print(paste0("[INFO] Skipping execution of ", substitute(runFunction), " (", outputPath, " is present)"))
if (typeof(readOutput) == "closure") {
return(readOutput(outputPath))
}
}
}
getCleanOption <- function(optionMeaning) {
source("modules/view/plotting/label.R", local = TRUE)
return(str_replace(replaceLabel(optionMeaning), "\n", " "))
}
getUniFromQuestionnaire <- function(questionnaire) {
if (str_detect(questionnaire, fixed(TUM_NAME))) {
return(TUM_NAME)
} else {
return(HPI_NAME)
}
}
getCourseYear <- function(questionnaire, options, row) {
if (questionnaire == "TUM_Retrospective") {
if (is.na(row$T201)) {
return(NA)
}
return(options[which(options$VAR == "T201" & options$RESPONSE == row$T201),]$MEANING)
} else if (!str_detect(questionnaire, fixed("_")) | str_detect(questionnaire, fixed(HPI_NAME))) {
return(paste("SoSe", substr(row$STARTED, 1, 4)))
} else if (str_detect(questionnaire, fixed(TUM_NAME))) {
return(TUM_COMPLETE_YEAR)
} else {
print(paste("WARNING: Unhandled COURSE_YEAR case for", questionnaire))
return("NOT HANDLED")
}
}
```
```{r view-helpers, include=FALSE}
cleanInput <- function(text) {
cleanText <- text
cleanText <- str_replace_all(cleanText, " ", " ")
cleanText <- str_replace_all(cleanText, "", " ")
return(cleanText)
}
renderTable <- function(data) {
if (IS_LATEX) {
for (rowIndex in 1:nrow(data)) {
for (colIndex in 1:ncol(data)) {
cellValue <- data[rowIndex, colIndex]
if (typeof(cellValue) == "character") {
data[rowIndex, colIndex] <- cleanInput(cellValue)
}
}
}
}
knitr::kable(data, row.names = FALSE, booktabs = TRUE, latex = IS_LATEX)
}
output_print <- function(text) {
print(cleanInput(text))
}
```
```{r combine-data, include=FALSE}
# Combine all questionnaires
# Config for combination present in COMPLETE_DATA_DIRECTORY
combineCompleteResultData <- function() {
source("assets/combineResultData.R", local = TRUE)
# Definition of output directories
initial_versions_directory = file.path(COMPLETE_DATA_DIRECTORY, "InititalVersions")
conflicting_versions_directory = file.path(COMPLETE_DATA_DIRECTORY, "NewVersions")
# First combine compatible questionnaires (to be better able to compare afterwards)
if (!dir.exists(initial_versions_directory)) {
combineResultData(INITIAL_VERSION_DIRECTORIES, initial_versions_directory, outputPostfix = "_old_versions_combined")
}
if (!dir.exists(conflicting_versions_directory)) {
combineResultData(CONFLICTING_VERSION_DIRECTORIES, conflicting_versions_directory, outputPostfix = "_new_versions_combined")
}
# Combine all data (see config in COMPLETE_DATA_DIRECTORY for merge settings)
combineResultData(c(initial_versions_directory, conflicting_versions_directory), COMPLETE_DATA_DIRECTORY, outputPostfix = "_combined")
# Add helper fields
results <- loadData(COMPLETE_DATA_DIRECTORY, DATA_PREFIX)
options <- loadData(COMPLETE_DATA_DIRECTORY, VALUES_PREFIX)
UNI <- c()
COURSE_YEAR <- c()
CLEAN_QUESTNNR <- c()
for (rowIndex in 1:nrow(results)) {
row <- results[rowIndex,]
questionnaire <- row$QUESTNNR
# Get UNI
UNI <- c(UNI, getUniFromQuestionnaire(questionnaire))
# Get CLEAN_QUESTNNR
CLEAN_QUESTNNR <- c(CLEAN_QUESTNNR, getCleanQuestionnaireNames(questionnaire))
# Get COURSE_YEAR
COURSE_YEAR <- c(COURSE_YEAR, getCourseYear(questionnaire, options, row))
}
results$UNI <- UNI
results$COURSE_YEAR <- COURSE_YEAR
results$CLEAN_QUESTNNR <- CLEAN_QUESTNNR
writeTable(results, COMPLETE_DATA_DIRECTORY, paste0(DATA_PREFIX, "_combined"))
# Check questions that should maybe be normalized
questions <- loadData(COMPLETE_DATA_DIRECTORY, VARIABLES_PREFIX)
getPatternRegex <- function(prefixes) {
return(paste0("^(", paste(prefixes, collapse = "|"), ")"))
}
relevant_question_prefixes <- c("T1", "T2", "Q1", "Q2", "Q3", "Q4", "old_", "QX")
already_normalized <- names(getCombinationConfig(COMPLETE_DATA_DIRECTORY)[["normalizeQuestionIds"]])
not_normalized <- c("T201", "T203", "T207", "Q302", "QX09")
check_normalization <- questions[which(
str_detect(questions$VAR, getPatternRegex(relevant_question_prefixes)) &
!str_detect(questions$VAR, getPatternRegex(already_normalized)) &
!str_detect(questions$VAR, getPatternRegex(not_normalized))),]
}
runIfNotPresent(combineCompleteResultData,
file.path(COMPLETE_DATA_DIRECTORY, "data_combined.csv"),
forceRun = FALSE)
```
```{r analysis-helpers, include=FALSE}
getCompleteResultData <- function() {
source("modules/data/load.R", local = TRUE)
source("genomics-lecture-specific/analyze-data/cleanResults.R", local = TRUE)
return(cleanGenotypingDependencies(
removeTumRetrospectiveFutureAnalysesWithoutPassword(
withConsent(getResultData()))))
}
getCompleteQuestions <- function() {
source("modules/data/questions.R", local = TRUE)
return(getQuestions())
}
getCompleteOptions <- function () {
source("modules/data/load.R", local = TRUE)
return(getOptionData())
}
COMPLETE_RESULTS <- getCompleteResultData()
COMPLETE_QUESTIONS <- getCompleteQuestions()
COMPLETE_OPTIONS <- getCompleteOptions()
getResultsForQuestions <- function(questionIds) {
metaColumns <- c("CLEAN_QUESTNNR", "UNI", "COURSE_YEAR")
results <- COMPLETE_RESULTS[,c(metaColumns, questionIds)]
for (rowIndex in 1:nrow(results)) {
for (questionId in questionIds) {
response <- results[rowIndex, questionId]
if (!is.na(response)) {
responseMeaning <- COMPLETE_OPTIONS[which(COMPLETE_OPTIONS$VAR == questionId & COMPLETE_OPTIONS$RESPONSE == response), "MEANING"]
results[rowIndex, questionId] <- responseMeaning
}
}
}
return(results)
}
replaceQuestionIdsWithText <- function(data, questionIds) {
columnNames <- c()
for (column in colnames(data)) {
columnName <- column
if (column %in% questionIds) {
columnName <- COMPLETE_QUESTIONS[which(COMPLETE_QUESTIONS$id == column), "text"]
}
columnNames <- c(columnNames, columnName)
}
colnames(data) <- columnNames
return(data)
}
getCommonQuestions <- function(resultList) {
source("modules/data/load.R", local = TRUE)
source("modules/data/questions.R", local = TRUE)
notInterestingForAnalysis <- c("QX02")
possibleCommonIds <- unique(unlist(lapply(resultList, getQuestionIds)))
commonIds <- c()
notAllEmpty <- function(results, questionId) {
return(!all(is.na(results[possibleCommonId]) | results[possibleCommonId] == ""))
}
for (possibleCommonId in possibleCommonIds) {
if (possibleCommonId %in% notInterestingForAnalysis) {
next
}
if (all(unlist(lapply(resultList, notAllEmpty, possibleCommonId)))) {
commonIds <- c(commonIds, possibleCommonId)
}
}
return(commonIds)
}
getComparisonSpecification <- function() {
hpiResults <- COMPLETE_RESULTS[which(COMPLETE_RESULTS$UNI == HPI_NAME & COMPLETE_RESULTS$CLEAN_QUESTNNR == "Q4"),]
tumResults <- COMPLETE_RESULTS[which(COMPLETE_RESULTS$UNI == TUM_NAME & COMPLETE_RESULTS$CLEAN_QUESTNNR == "Q4"),]
hpiFirstYearResults <- hpiResults[which(hpiResults$COURSE_YEAR == HPI_FIRST_YEAR),]
hpiSecondYearResults <- hpiResults[which(hpiResults$COURSE_YEAR == HPI_SECOND_YEAR),]
tumRetroResults <- tumResults[which(tumResults$QUESTNNR == "TUM_Retrospective"),]
tumQ4Results <- tumResults[which(tumResults$COURSE_YEAR == "SoSe 2020/21"),]
comparisonSpecification <- list(
"by_uni" = list(
"populations" = list(
"HPI" = hpiResults,
"TUM" = tumResults
),
"questions" = getCommonQuestions(list(hpiResults, tumResults))
),
"hpi_by_year" = list(
"populations" = list (
"SoSe 2020" = hpiFirstYearResults,
"SoSe 2021" = hpiSecondYearResults
),
"questions" = getCommonQuestions(list(hpiFirstYearResults, hpiSecondYearResults))
),
"tum_retro_vs_q4" = list(
"populations" = list(
"TUM Retro" = tumRetroResults,
"TUM Q4" = tumQ4Results
),
"questions" = getCommonQuestions(list(tumRetroResults, tumQ4Results))
)
)
return(comparisonSpecification)
}
getIncludedQuestionnaires <- function(results) {
includedQuestionnaires <- unique(results[,c("UNI", "COURSE_YEAR", "CLEAN_QUESTNNR")])
participantNumbers <- c()
for (rowIndex in 1:nrow(includedQuestionnaires)) {
uni <- includedQuestionnaires[rowIndex,]$UNI
courseYear <- includedQuestionnaires[rowIndex,]$COURSE_YEAR
cleanQuestionnaire <- includedQuestionnaires[rowIndex,]$CLEAN_QUESTNNR
participantNumbers <- c(participantNumbers, length(which(
results$UNI == uni &
results$COURSE_YEAR == courseYear &
results$CLEAN_QUESTNNR == cleanQuestionnaire)))
}
includedQuestionnaires$PARTICIPANTS <- participantNumbers
return(includedQuestionnaires)
}
```
```{r get-retrospective-stats, include=FALSE}
RETROSPECTIVE_STATS_NAME <- "retrospective_stats"
RETROSPECTIVE_STATS_DIRECTORY <- "retrospective-stats"
RETROSPECTIVE_STATS_PATH <- file.path(COMPLETE_RESULTS_DIRECTORY,
RETROSPECTIVE_STATS_DIRECTORY,
paste0(RETROSPECTIVE_STATS_NAME, ".csv"))
getRetrospectiveStats <- function() {
source("assets/stratification/utils.R", local = TRUE)
comparisonSpecification <- getComparisonSpecification()
retrospectiveStats <- runComparisons(comparisonSpecification,
combinedOutputFileName = RETROSPECTIVE_STATS_NAME,
combinedOutputDirectory = RETROSPECTIVE_STATS_DIRECTORY)
}
RETROSPECTIVE_STATS <- runIfNotPresent(getRetrospectiveStats, RETROSPECTIVE_STATS_PATH, forceRun = FALSE, readOutput = read.csv)
```
## Motivation stats
The following table shows students' answers regarding their motivation to participate in the course from the short version retrospective questionnaires (HPI 2020 Q4, TUM Q4', HPI 2021 Q1, and TUM 2020/21 Q1).
```{r motivation-analysis-helpers, include=FALSE}
OLD_MOTIVATION_RESULT_IDS <- COMPLETE_QUESTIONS$id[which(
startsWith(COMPLETE_QUESTIONS$id, "MN02") |
startsWith(COMPLETE_QUESTIONS$id, "ES02"))]
NEW_MOTIVATION_RESULT_IDS <- COMPLETE_QUESTIONS$id[which(startsWith(COMPLETE_QUESTIONS$id, "Q102"))]
getMotivationResults <- function(results, motivationQuestionIds) {
motivationResultRows <- c()
for (rowIndex in 1:nrow(results)) {
resultRow <- results[rowIndex,]
motivationResults <- resultRow[,motivationQuestionIds]
if (!all(is.na(motivationResults))) {
motivationResultRows <- c(motivationResultRows, rowIndex)
}
}
motivationResultColumns <- c("UNI", "COURSE_YEAR", "CLEAN_QUESTNNR", "SERIAL", OLD_MOTIVATION_RESULT_IDS, NEW_MOTIVATION_RESULT_IDS)
motivationResults <- results[motivationResultRows, motivationResultColumns]
return(motivationResults)
}
```
```{r get-motivation-stats, include=FALSE}
MOTIVATON_STATS_NAME <- "motivation_stats"
MOTIVATON_STATS_DIRECTORY <- "motivation-stats"
MOTIVATON_STATS_PATH <- file.path(COMPLETE_RESULTS_DIRECTORY,
MOTIVATON_STATS_DIRECTORY,
paste0(MOTIVATON_STATS_NAME, ".csv"))
getMotivationStats <- function() {
source("assets/stratification/utils.R", local = TRUE)
newMotivationResults <- getMotivationResults(COMPLETE_RESULTS, NEW_MOTIVATION_RESULT_IDS)
includedQuestionnaires <- getIncludedQuestionnaires(newMotivationResults)
comparisonSpecification <- list(
"by_uni" = list(
"populations" = list(
"HPI" = newMotivationResults[which(newMotivationResults$UNI == HPI_NAME),],
"TUM" = newMotivationResults[which(newMotivationResults$UNI == TUM_NAME),]
),
"questions" = NEW_MOTIVATION_RESULT_IDS
)
)
comparisonSpecification[["by_questionnaire"]] <- list("questions" = NEW_MOTIVATION_RESULT_IDS)
populations <- list()
for (rowIndex in 1:nrow(includedQuestionnaires)) {
questionnaire <- includedQuestionnaires[rowIndex,]
uni <- questionnaire$UNI
courseYear <- questionnaire$COURSE_YEAR
questionnaireName <- questionnaire$CLEAN_QUESTNNR
populationResults <- newMotivationResults[which(
newMotivationResults$UNI == uni &
newMotivationResults$COURSE_YEAR == courseYear &
newMotivationResults$CLEAN_QUESTNNR == questionnaireName),]
if (nrow(populationResults) > 0) {
populationName <- paste(questionnaireName, uni, courseYear, sep = " - ")
populations[[populationName]] <- populationResults
}
}
comparisonSpecification[["by_questionnaire"]][["populations"]] <- populations
motivation_stats <- runComparisons(comparisonSpecification, combinedOutputFileName = MOTIVATON_STATS_NAME,
combinedOutputDirectory = MOTIVATON_STATS_DIRECTORY)
## Manually analyze the differences between long Q1 and short Q4 motivations
oldMotivationResults <- getMotivationResults(COMPLETE_RESULTS, OLD_MOTIVATION_RESULT_IDS)
oldMotivationQuestions <- COMPLETE_QUESTIONS[which(COMPLETE_QUESTIONS$id %in% OLD_MOTIVATION_RESULT_IDS),]
newMotivationQuestions <- COMPLETE_QUESTIONS[which(COMPLETE_QUESTIONS$id %in% NEW_MOTIVATION_RESULT_IDS),]
redundantMotivationQuestions <- rbind(oldMotivationQuestions, newMotivationQuestions)
redundantMotivationResults <- rbind(
oldMotivationResults,
newMotivationResults[which(
newMotivationResults$UNI == HPI_NAME &
newMotivationResults$COURSE_YEAR == HPI_FIRST_YEAR),])
id <- c()
topic <- c()
responses <- c()
for (rowIndex in 1:nrow(redundantMotivationQuestions)) {
question <- redundantMotivationQuestions[rowIndex,]
if (question$id == "Q102") {
next
}
id <- c(id, question$id)
topic <- c(topic, paste(question$page, question$option))
questionResponses <- c()
for (responseValue in sort(unique(redundantMotivationResults[, question$id]), decreasing = TRUE)) {
responseMeaning <- COMPLETE_OPTIONS$MEANING[which(
COMPLETE_OPTIONS$VAR == question$id & COMPLETE_OPTIONS$RESPONSE == responseValue)]
responseCount <- length(which(redundantMotivationResults[, question$id] == responseValue))
questionResponse <- paste0(responseMeaning, ": ", responseCount)
questionResponses <- c(questionResponses, questionResponse)
}
responses <- c(responses, paste(questionResponses, collapse = "\n"))
}
collectedRedundantResults <- data.frame(id, topic, responses)
redundantMotivationResultsPath <- file.path(getResultDirectory(MOTIVATON_STATS_DIRECTORY), "redundant_motivation_results.csv")
write.csv(collectedRedundantResults, redundantMotivationResultsPath, row.names = FALSE)
return(motivation_stats)
}
MOTIVATION_STATS <- runIfNotPresent(getMotivationStats, MOTIVATON_STATS_PATH, forceRun = FALSE, readOutput = read.csv)
```
```{r motivation-table, echo=FALSE, results='asis', include=TRUE}
getCleanMotivationStats <- function(motivation_stats) {
for (rowIndex in 1:nrow(motivation_stats)) {
longQuestionText <- motivation_stats[rowIndex, "question.text"]
shortQuestionText <- stringr::str_remove(longQuestionText, stringr::fixed("What motivated you to participate in the course? Option: "))
motivation_stats[rowIndex, "question.text"] <- shortQuestionText
}
hpiCourseYears <- c()
tumCourseYears <- c()
includedQuestionnaires <- getIncludedQuestionnaires(getMotivationResults(COMPLETE_RESULTS, NEW_MOTIVATION_RESULT_IDS))
for (rowIndex in 1:nrow(includedQuestionnaires)) {
questionnaireInfo <- includedQuestionnaires[rowIndex,]
courseYearString <- paste0(questionnaireInfo$COURSE_YEAR, " (", questionnaireInfo$PARTICIPANTS, ")")
if (questionnaireInfo$UNI == HPI_NAME) {
hpiCourseYears <- c(hpiCourseYears, courseYearString)
} else {
tumCourseYears <- c(tumCourseYears, courseYearString)
}
}
topic <- c("Course year")
separator <- " "
hpi <- c(paste(hpiCourseYears, collapse = separator))
tum <- c(paste(tumCourseYears, collapse = separator))
pValue <- c("")
effectSize <- c("")
byUniStats <- motivation_stats[which(motivation_stats$comparison == "HPI<>TUM"),]
formatValues <- function(value) {
formattedValue <- str_remove_all(value, "HPI: ")
formattedValue <- str_remove_all(formattedValue, "TUM: ")
formattedValue <- str_replace_all(formattedValue, "Checked", "Yes")
formattedValue <- str_replace_all(formattedValue, "Not checked", "No")
return(formattedValue)
}
for (topicId in unique(byUniStats$question.id)) {
if (topicId == "Q102") {
next
}
topicStats <- byUniStats[which(byUniStats$question.id == topicId),]
topic <- c(topic, topicStats$question.text)
hpi <- c(hpi, formatValues(topicStats$first.group.values))
tum <- c(tum, formatValues(topicStats$second.group.values))
digits <- 2
currentPValueDigits <- digits
currentPValue <- round(topicStats$p.value, digits = currentPValueDigits)
while (currentPValue == 0) {
currentPValueDigits = currentPValueDigits + 1
currentPValue <- round(topicStats$p.value, digits = currentPValueDigits)
}
pValue <- c(pValue, currentPValue)
effectSize <- c(effectSize, paste0(
round(topicStats$effect.size, digits = digits),
" (", topicStats$strict.effect.size.interpretation, ")"))
}
cleanMotivationStats <- data.frame(topic, hpi, tum, pValue, effectSize)
cleanMotivationStats <- cleanMotivationStats[order(cleanMotivationStats$pValue),]
return(cleanMotivationStats)
}
renderTable(getCleanMotivationStats(MOTIVATION_STATS))
```
A comparison with redundant results from the short version questionnaire HPI 2020 Q4 and the long version questionnaire HPI 2020 Q1 were made manually by evaluating `results/AllData/motivation-stats/redundant_motivation_results.csv`.
Overall, the results are comparable, especially when only considering questions regarding motivation to participate in the course.
When also comparing the expectations what to learn in the course, differences occur in the areas ethics, legal, analyzing ancestry, learning about DTC, and learning about tools for genome analysis. While for most areas, the results are expected (students expect to learn about a topic but are not motivated by it), it is surprising that students retrospectively were not motivated by learning about tools for genome analysis (while being motivated by learning about the analyses and in general conducting analyzes).
## Overall results
The table below shows all retrospective results. Other interesting results that cannot be derived directly from the table are written above the table.
```{r retrospective-results-table, echo=FALSE, results='asis', include=TRUE}
getRetrospectiveTableData <- function() {
source("assets/stratification/table.R", local = TRUE)
source("assets/stratification/utils.R", local = TRUE)
includedQuestions <- c(
"QX11", # In-house genotyping
"QX16", # Learning experience
"QX15", # Recommend again
"QX08", # PGT participation
"QX10", # PGT participation today (did participate)
"QX09", # PGT participation today (did not participate)
"Q402", # Collected password
"Q403", # Plan to collect password
"Q404", # Analyzes
"Q405", # Further analyzes
"QX19", # Adequately trained
"QX18", # Attitude change
"QX17", # Attitude change direction
"QX07", # Testing wo/ counseling
"QX12", # Relatives and friends
"QX13", # Ethics
"QX14" # Obligatory
)
# Get main table data
comparisonSpecification <- getComparisonSpecification()
hpiData <- comparisonSpecification[["by_uni"]][["populations"]][[HPI_NAME]]
tumData <- comparisonSpecification[["by_uni"]][["populations"]][[TUM_NAME]]
comparisonStats <- RETROSPECTIVE_STATS[which(RETROSPECTIVE_STATS$stratification == "by_uni"),]
tableData <- getTableData(includedQuestions, comparisonStats, firstGroupData = hpiData,
secondGroupData = tumData, latex = IS_LATEX)
includedQuestionnaires <- rbind(getIncludedQuestionnaires(hpiData), getIncludedQuestionnaires(tumData))
# Add further information to table
yesAnswer <- 1
noAnswer <- 2
checked <- 2
notChecked <- 1
formatAnswerString <- function(yesCount, noCount) {
return(paste("Yes:", yesCount, " ", "No:", noCount))
}
## Add medical background data
generalBackgroundQuestionId <- "QX04"
tumRetroBackgroundQuestionId <- "T207"
implicitMedicalBackground <- TUM_COMPLETE_YEAR
hasMedicalBackground <- function(data, rowIndex) {
generalBackground <- data[rowIndex, generalBackgroundQuestionId]
tumRetroBackground <- data[rowIndex, tumRetroBackgroundQuestionId]
if (data$CLEAN_QUESTNNR[rowIndex] == implicitMedicalBackground) {
if (!is.na(generalBackground) | !is.na(tumRetroBackground)) {
output_print(paste(
"[WARNING]: Did not expect to see results in questionnaire of",
implicitMedicalBackground,
"- counting as medical background anyways"))
}
return(TRUE)
} else if (!is.na(generalBackground) & !is.na(tumRetroBackground)) {
output_print(paste("[WARNING]: Both background questions answered; skipping result"))
return(NA)
} else if (!is.na(generalBackground)) {
if (generalBackground == yesAnswer) {
return(TRUE)
} else if (generalBackground == noAnswer) {
return(FALSE)
} else {
output_print(paste(
"[WARNING]: Unexpected result", generalBackground, "for",
generalBackgroundQuestionId, "- skipping result"))
return(NA)
}
} else if (!is.na(tumRetroBackground)) {
otherAnswer <- 3
if (tumRetroBackground == yesAnswer) {
return(TRUE)
} else if (tumRetroBackground == noAnswer | tumRetroBackground == otherAnswer) {
return(FALSE)
} else {
output_print(paste(
"[WARNING]: Unexpected result", tumRetroBackground, "for",
tumRetroBackgroundQuestionId, "- skipping result"))
return(NA)
}
}
return(NA)
}
getBackgroundCounts <- function(data) {
yesCount <- 0
noCount <- 0
for (rowIndex in 1:nrow(data)) {
medicalBackground <- hasMedicalBackground(data, rowIndex)
if (!is.na(medicalBackground)) {
if (medicalBackground) {
yesCount <- yesCount + 1
} else {
noCount <- noCount + 1
}
}
}
return(formatAnswerString(yesCount, noCount))
}
backgroundResults <- data.frame(
question = c(COMPLETE_QUESTIONS[which(COMPLETE_QUESTIONS$id == generalBackgroundQuestionId), "text"]),
hpiCounts = c(getBackgroundCounts(hpiData)),
tumCounts = c(getBackgroundCounts(tumData)),
pValues = c("–"),
effectSizes = c("–"))
colnames(backgroundResults) <- colnames(tableData)
tableData <- rbind(backgroundResults, tableData)
## Add course year data
getCourseYears <- function(questionnaireInformation, uni) {
relevantQuestionnaires <- questionnaireInformation[which(questionnaireInformation$UNI == uni),]
years <- c()
for (rowIndex in 1:nrow(relevantQuestionnaires)) {
relevantQuestionnaire <- relevantQuestionnaires[rowIndex,]
courseYear <- relevantQuestionnaire$COURSE_YEAR
courseYear <- str_replace(courseYear, "SoSe", "Summer")
courseYear <- str_replace(courseYear, "WiSe", "Winter")
years <- c(years, paste0(courseYear, ": ", relevantQuestionnaire$PARTICIPANTS))
}
return(paste(years, collapse = " "))
}
courseYearData <- data.frame(
question = c("In which year did you participate in the course?"),
hpiCounts = c(getCourseYears(includedQuestionnaires, HPI_NAME)),
tumCounts = c(getCourseYears(includedQuestionnaires, TUM_NAME)),
pValues = c("–"),
effectSizes = c("–"))
colnames(courseYearData) <- colnames(tableData)
tableData <- rbind(courseYearData, tableData)
## Add joint past analyses data
detailedPastAnalysesQuestionId <- "Q404"
basicPastAnalysesQuestionId <- "T203"
getBasicPastAnalysesResults <- function(data, detailedPastAnalysesQuestionId, basicPastAnalysesQuestionId) {
results <- c()
for (rowIndex in 1:nrow(data)) {
detailedAnalysesReponse <- data[rowIndex, detailedPastAnalysesQuestionId]
basicAnalysesResponse <- data[rowIndex, basicPastAnalysesQuestionId]
if (!is.na(detailedAnalysesReponse) & !is.na(basicAnalysesResponse)) {
output_print(paste("[WARNING]: Unexpected result,", detailedPastAnalysesQuestionId, "and", basicAnalysesResponse, "were answered"))
next
}
if (!is.na(basicAnalysesResponse)) {
results <- c(results, basicAnalysesResponse)
}
if (!is.na(detailedAnalysesReponse)) {
onlyReceiveId <- paste0(detailedPastAnalysesQuestionId, "_01")
onlyReceiveResponse <- data[rowIndex, onlyReceiveId]
if (onlyReceiveResponse == checked) {
results <- c(results, noAnswer)
} else {
if (detailedAnalysesReponse > 0) {
results <- c(results, yesAnswer)
} else {
output_print(paste("[WARNING]: Unexpected result, nothing was answered for", detailedPastAnalysesQuestionId))
}
}
}
}
return(results)
}
hpiResults <- getBasicPastAnalysesResults(hpiData, detailedPastAnalysesQuestionId, basicPastAnalysesQuestionId)
tumResults <- getBasicPastAnalysesResults(tumData, detailedPastAnalysesQuestionId, basicPastAnalysesQuestionId)
valueMatrix <- data.frame(
population = c(rep(HPI_NAME, length(hpiResults)), rep(TUM_NAME, length(tumResults))),
value = c(hpiResults, tumResults))
pastAnalysesStats <- getStatistics(valueMatrix)
question <- c(COMPLETE_QUESTIONS[which(COMPLETE_QUESTIONS$id == detailedPastAnalysesQuestionId), "text"])
hpiCounts <- c(formatAnswerString(
nrow(valueMatrix[which(valueMatrix$population == HPI_NAME & valueMatrix$value == yesAnswer),]),
nrow(valueMatrix[which(valueMatrix$population == HPI_NAME & valueMatrix$value == noAnswer),])
))
tumCounts <- c(formatAnswerString(
nrow(valueMatrix[which(valueMatrix$population == TUM_NAME & valueMatrix$value == yesAnswer),]),
nrow(valueMatrix[which(valueMatrix$population == TUM_NAME & valueMatrix$value == noAnswer),])
))
pValues <- c(formatNumericValue(as.double(pastAnalysesStats[2])))
effectSizes <- c(formatEffectSize(as.double(pastAnalysesStats[7]), pastAnalysesStats[8]))
basicPastAnalysesResults <- data.frame(question, hpiCounts, tumCounts, pValues, effectSizes)
colnames(basicPastAnalysesResults) <- colnames(tableData)
tableData <- rbind(tableData, basicPastAnalysesResults)
# Further analyses (not in table)
printFurtherAnalysisResults <- function() {
# Get QX14 answers only for TUM medical students
yesCount <- 0
noCount <- 0
for (rowIndex in 1:nrow(tumData)) {
medicalBackground <- hasMedicalBackground(tumData, rowIndex)
if (!is.na(medicalBackground)) {
if (medicalBackground) {
obligatoryResponse <- tumData[rowIndex, "QX14"]
if (obligatoryResponse == yesAnswer) {
yesCount <- yesCount + 1
} else if (obligatoryResponse == noAnswer) {
noCount <- noCount + 1
} else {
output_print(paste("[WARNING]: Unexpected result for QX14:", obligatoryResponse))
}
}
}
}
output_print(paste("QX14 (should course be obligatory for medical studies) for only TUM medical:", formatAnswerString(yesCount, noCount)))
# Get number of students that did not get genotyped but think it is useful for learning
interestingQuestions <- c("QX16", "QX08", "QX10", "QX09")
questionResults <- getResultsForQuestions(interestingQuestions)
interestingResults <- questionResults[which(
questionResults$CLEAN_QUESTNNR == "Q4" & questionResults$QX16 == "Yes" & questionResults$QX08 == "No"),]
interestingResults <- replaceQuestionIdsWithText(interestingResults, interestingQuestions)
output_print(paste(nrow(interestingResults), "students think PGT is useeful for the learning experience but did not get genotyped themselves"))
}
printFurtherAnalysisResults()
return(tableData)
}
renderTable(getRetrospectiveTableData())
```
# Change over course
Different changes can be investigated:
* HPI 2020 Q1 to Q3 (long version questionnaires, `results/AllData/sankey/hpi_sose-2020_sankeys_Q1-Q3_binary.csv`)
* HPI 2020 Q1 to Q4 (matched answers of long version questionnaires to short version questionnaire; not necessarily complete, `results/AllData/sankey/hpi_sose-2020_sankeys_Q1-Q4_binary.csv`)
* TUM 2020/21 Q1 to Q4 (short version questionnaires, unpaired, `results/AllData/stacked-bar/tum_wise-2020-21.csv`)
* HPI 2021 (short version questionnaires, paired, `results/AllData/sankey/hpi_sose-2021_sankeys.csv`)
* HPI 2021 (short version questionnaires, unpaired [to be better comparable to TUM, but probably not really useful], `results/AllData/stacked-bar/hpi_sose-2021.csv`)
5-point Likert scales from long questionnaires were mapped to binary answers. The full analyses can be found in the given file parts without the `binary` postfix.
All changes are summarized in `results/AllData/evolution_stats.csv` (some colums such as power analysis are missing because it was only conducted for unpaired analyses).
```{r analyses-over-course, include=FALSE}
getEvolutionStats <- function() {
getEvolutionStatsForUniAndYear <- function(uni, year, paired, getSpecificPlotParameters, binary, outputPostfix, forceRun) {
source("assets/sankeyPlots/createCombinedSankeyPlots.R", local = TRUE)
source("assets/stratification/table.R", local = TRUE)
source("modules/view/plotting/rendering.R", local = TRUE)
source("modules/view/plotting/label.R", local = TRUE)
source("modules/statistics/utils.R", local = TRUE)
# Function definitions
getOutputFileName <- function(year, uni, outputPostfix = NA) {
fileSaveYear <- str_replace_all(str_replace_all(year, " ", "-"), "/", "-")
separator <- "_"
outputFileName <- paste(tolower(uni), tolower(fileSaveYear), sep = separator)
if (!is.na(outputPostfix)) {
outputFileName <- paste(outputFileName, outputPostfix, sep = separator)
}
return(outputFileName)
}
createSankeysForUniAndYear <- function(parameters) {
results <- parameters[["results"]]
questions <- parameters[["questions"]]
options <- parameters[["options"]]
uni <- parameters[["uni"]]
year <- parameters[["year"]]
binary <- parameters[["binary"]]
plotParameters <- parameters[["plot.parameters"]]
createCombinedSankeyPlots(plotParameters, parameters[["output.name"]],
addSubfigureKey = FALSE, binary = binary,
results = results, options = options,
questions = questions)
return(read.csv(parameters[["output.path"]]))
}
createStackedBarplotsForUniAndYear <- function(parameters) {
results <- parameters[["results"]]
questions <- parameters[["questions"]]
uni <- parameters[["uni"]]
year <- parameters[["year"]]
outputDirectory <- file.path(COMPLETE_RESULTS_DIRECTORY, parameters[["output.directory"]])
plotParameters <- parameters[["plot.parameters"]]
comparisonStatistics <- list()
plotPaths <- c()
for (questionName in names(plotParameters)) {
title <- plotParameters[[questionName]][["title"]]
if (grepl("Option: Residual option", title, fixed = TRUE)) {
next
}
uni <- plotParameters[[questionName]][["uni"]]
year <- plotParameters[[questionName]][["year"]]
questionnaires <- names(plotParameters[[questionName]][["question.list"]])
responseRows <- NULL
for (questionnaire in names(plotParameters[[questionName]][["question.list"]])) {
questionId <- plotParameters[[questionName]][["question.list"]][[questionnaire]]
questionResponses <- results[
which(results$UNI == uni &
results$COURSE_YEAR == year &
results$QUESTNNR == questionnaire),
c("QUESTNNR", "CLEAN_QUESTNNR", questionId)]
for (rowIndex in 1:nrow(questionResponses)) {
questionResponse <- questionResponses[rowIndex, questionId]
if (!is.na(questionResponse)) {
responseMeaning <- COMPLETE_OPTIONS[
which(COMPLETE_OPTIONS$VAR == questionId & COMPLETE_OPTIONS$RESPONSE == questionResponse),
"MEANING"]
if (responseMeaning == "Ja") {
responseMeaning <- "Yes"
}
questionResponses[rowIndex, questionId] <- responseMeaning
}
}
colnames(questionResponses) <- c("QUESTNNR", "CLEAN_QUESTNNR", questionName)
responseRows <- rbind(responseRows, questionResponses)
}
responses <- table(responseRows[[questionName]], responseRows$CLEAN_QUESTNNR)
# Get statistics
comparisons <- getPairwiseComparisons(colnames(responses))
statsStrings <- c()
for (comparisonName in names(comparisons)) {
population <- c()
value <- c()
for (questionnaire in colnames(responses)) {
if (questionnaire %in% comparisons[[comparisonName]]) {
for (response in row.names(responses)) {
responseCount <- responses[response, questionnaire]
if (responseCount > 0) {
for (count in 1:responseCount) {
population <- c(population, questionnaire)
value <- c(value, response)
}
}
}
}
}
valueStrings <- c()
averageValues <- c()
for (questionnaire in unique(population)) {
questionnaireResponses <- value[which(population == questionnaire)]
numericResponses <- unlist(lapply(lapply(lapply(questionnaireResponses, getCleanOption), getValueGroup), getGroupValue))
averageValues <- c(averageValues, getFormattedAverage(numericResponses))
valueString <- paste0(questionnaire, ": ", paste(questionnaireResponses, collapse = ", "))
valueStrings <- c(valueStrings, valueString)
}
values <- paste(valueStrings, collapse = "\n")
averages <- paste(averageValues, collapse = ", ")
valueMatrix <- data.frame(population, value)
stats <- getStatistics(valueMatrix)
firstCleanQuestionnaire <- comparisons[[comparisonName]][1]
secondCleanQuestionnaire <- comparisons[[comparisonName]][2]
firstQuestionnaire <- unique(responseRows$QUESTNNR[which(responseRows$CLEAN_QUESTNNR == firstCleanQuestionnaire)])
secondQuestionnaire <- unique(responseRows$QUESTNNR[which(responseRows$CLEAN_QUESTNNR == secondCleanQuestionnaire)])
if (length(firstQuestionnaire) != 1 || length(secondQuestionnaire) != 1) {
stop("Questionnaire not unique!")
}
firstQuestionId <- plotParameters[[questionName]][["question.list"]][[firstQuestionnaire]]
secondQuestionId <- plotParameters[[questionName]][["question.list"]][[secondQuestionnaire]]
comparisonStatistics[[paste(questionId, comparisonName)]] <- c(title, comparisonName, firstQuestionId, secondQuestionId,
stats, values, averages)
pValue <- formatNumericValue(as.double(stats[2]))
if (pValue <= 0.05) {
output_print(paste("[INFO] Significant change (unpaired):", uni, year, questionId, comparisonName))
}
effectSize <- formatEffectSize(as.double(stats[7]), stats[8])
statsStrings <- c(statsStrings, paste0(comparisonName, ": p = ", pValue, ", V = ", effectSize))
}
singleOutputDirectory <- file.path(outputDirectory, "single")
if (!dir.exists(singleOutputDirectory)) {
dir.create(singleOutputDirectory)
}
fileName <- file.path(singleOutputDirectory, paste(outputName, questionId, sep = "_"))
renderStackedBarplot <- function(plotParams) {
responses <- plotParams[["responses"]]
statsStrings <- plotParams[["stats.strings"]]
# Adapt responses to be plotted
newColnames <- c()
getParticipantNumber <- function(responses, questionnaire) {
return(sum(responses[,questionnaire]))
}
for (questionnaireName in colnames(responses)) {
newColname <- paste0(questionnaireName,
"\n(N = ", getParticipantNumber(responses, questionnaireName), ")")
newColnames <- c(newColnames, newColname)
}
colnames(responses) <- newColnames
newRowNames <- c()
colors <- c()
for (response in row.names(responses)) {
positiveColor <- getColor(5)
stillPositiveColor <- getColor(4)
negativeColor <- getColor(1)
neutralColor <- getColor(6)
if (response == "Checked" | response == "Ja") {
response <- "Yes"
}
if (response == "Not checked") {
response <- "No"
}
if (response == "Through the course I have become more critical about genetic analysis") {
response <- "More critical"
}
if (response == "Through the course I have gained a more positive opinion on genetic analysis") {
response <- "More positive"
}
if (response == "Yes" | response == "Absolutely necessary" | response == "More positive") {
color <- positiveColor
} else if (response == "No" | response == "More critical") {
color <- negativeColor
} else if (response == "Rather important") {
color <- stillPositiveColor
} else if (response == "I don't know" | response == "Neutral" | response == "Not answered") {
color <- neutralColor
} else {
output_print(paste0("Assigning neutral color to unhanndled response: ", response))
color <- neutralColor
}
colors <- c(colors, color)
newRowNames <- c(newRowNames, response)
}
row.names(responses) <- newRowNames
for (questionnaire in colnames(responses)) {
participants <- getParticipantNumber(responses, questionnaire)
for (response in row.names(responses)) {
responseCount <- responses[response, questionnaire]
percentage <- round(responseCount / participants * 100)
responses[response, questionnaire] <- percentage
}
}
# Create plot
title <- breakText(title, 80)
statsString <- breakText(paste(statsStrings, collapse = "; "), 100)
statsStringLines <- str_count(statsString, "\n") + 1
maxRange <- 100
par(mar=c(5 + statsStringLines, 4, 4, 11.5))
barplot(responses, main = title, border = NA, xlim = range(pretty(c(0,maxRange))),
xlab = "Students' respones (%)", horiz = TRUE)
title(sub = statsString, line = 4 + statsStringLines)
abline(v = 0:maxRange, col = "grey", lty = "dotted")
abline(v = seq(0, maxRange, by = 10), col = "grey", lty = "solid")
barplot(responses, add = TRUE, col = colors, border = NA, horiz = TRUE)
legend(par("usr")[2] + 0.05, par("usr")[4], xpd = NA, bty = "n",
legend = row.names(responses),fill = colors)
}
pngPath <- paste0(fileName, ".png")
plotPaths <- c(plotPaths, pngPath)
pdfPath <- paste0(fileName, ".pdf")
createPng(renderStackedBarplot, list("responses" = responses, "stats.strings" = statsStrings), pngPath)
createPdf(renderStackedBarplot, list("responses" = responses, "stats.strings" = statsStrings), pdfPath)
}
comparisonStatistics <- as.data.frame(do.call(rbind, comparisonStatistics))
colnames(comparisonStatistics) <- c("question.text", "comparison", "first.question.id", "second.question.id", statisticColumnNames, "values","averages")
write.csv(comparisonStatistics, parameters[["output.path"]], row.names = FALSE)
combinePlots(plotPaths, file.path(outputDirectory, parameters[["output.name"]]))
return(comparisonStatistics)
}
# Actual function
if (binary) {
if (is.na(outputPostfix)) {
outputPostfix <- "binary"
} else {
outputPostfix <- paste(outputPostfix, "binary", sep = "_")
}
}
if (!is.null(getSpecificPlotParameters)) {
plotParameters <- getSpecificPlotParameters()