-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexploration.R
97 lines (68 loc) · 2.68 KB
/
exploration.R
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
# Exploratory data analysis:
# cohort characteristic, numeric variable distribution, distribution plots,
# principle component analysis and assessment of spontaneous clustering tendency
# tools ------
library(plyr)
library(tidyverse)
library(rlang)
library(stringi)
library(readODS)
library(trafo)
library(exda)
library(rstatix)
library(DescTools)
library(psych)
library(clustTools)
library(ggrepel)
library(ggvenn)
library(ComplexUpset)
library(soucer)
library(furrr)
insert_head()
explore <- exda::explore
var <- clustTools::var
source_all('./tools/tools.R',
message = TRUE,
crash = TRUE)
# analysis globals -------
insert_msg('Analysis globals')
eda_globals <- list()
eda_globals$variables <- ptsd$var_lexicon %>%
filter(type %in% c('characteristic', 'response')) %>%
mutate(type = ifelse(format == 'numeric', 'violin', 'stack'),
types = ifelse(type == 'violin', 'wilcoxon_r', 'cramer_v')) %>%
select(variable, type, types)
eda_globals$numeric_vars <- eda_globals$variables %>%
filter(type == 'violin') %>%
.$variable
eda_globals$factor_vars <- eda_globals$variables %>%
filter(type != 'violin') %>%
.$variable
# launching the exploration scripts -----
insert_msg('Launching the exploration scripts')
c('./exploration scripts/missingness.R',
'./exploration scripts/mental_incomplete.R',
'./exploration scripts/cohort.R',
'./exploration scripts/mental_comorbidity.R',
'./exploration scripts/distribution.R',
'./exploration scripts/consistency.R',
'./exploration scripts/bias.R',
'./exploration scripts/partition.R',
'./exploration scripts/pca.R',
'./exploration scripts/time_psycho.R') %>%
source_all(message = TRUE,
crash = TRUE)
## cached result of the power estimation analysis
access_cache(cache_path = './cache/power.RData',
script_path = './exploration scripts/power.R',
message = 'Loading cached power estimation results')
## observation time dependency of psychometric variables
c('./exploration scripts/time_psycho.R',
'./exploration scripts/time_symptoms.R') %>%
source_all(message = TRUE, crash = TRUE)
## cached results of the comparison with the Austrian general population
access_cache(cache_path = './cache/aut_stats.RData',
script_path = './exploration scripts/sociodemographic.R',
message = 'Loading cached comparison with the Austrian population.')
# END -----
insert_tail()