-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchecks.R
executable file
·68 lines (48 loc) · 2.03 KB
/
checks.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
#!/usr/bin/Rscript
getwd()
setwd('~/git/covid_analysis/')
getwd()
############################################################
# TASK: checking stats from manuscript
############################################################
# source data
source("read_data.R")
#%%========================================================
# read file
lf_data = read.csv(infile_icu_lf , stringsAsFactors = F)
dim(lf_data)
wf_data = read.csv(infile_icu_wf , stringsAsFactors = F)
dim(wf_data)
lf_t1 = lf_data[lf_data$timepoint == "t1",]
lf_death_t1 = lf_t1[lf_t1$outcomes == 0,]
lf_recovered_t1 = lf_t1[lf_t1$outcomes == 1,]
wf_death = wf_data[wf_data$outcomes == 0,]
wf_recovered = wf_data[wf_data$outcomes == 1,]
kruskal.test(wf_death$Angiopoietin2_pgmL_t1, wf_death$Angiopoietin2_pgmL_t2, wf_death$Angiopoietin2_pgmL_t3)
friedman.test(wf_death$Angiopoietin2_pgmL_t1, wf_recovered$Angiopoietin2_pgmL_t1)
wilcox.test(wf_data$sRAGE_pgmL_t1, wf_data$sRAGE_pgmL_t3)
# checks
# sRAGE
wilcox.test(wf$sRAGE_pgmL_t1, wf$sRAGE_pgmL_t3, paired = T) # 0.00039
ks.test(wf_death$sRAGE_pgmL_t1, wf_death$sRAGE_pgmL_t2, wf_death$sRAGE_pgmL_t3)
ks.test(wf_death$sRAGE_pgmL_t1, wf_death$sRAGE_pgmL_t3)
wilcox.test(wf_death$sRAGE_pgmL_t1, wf_death$sRAGE_pgmL_t3, paired = T)
summary(wf_death$sRAGE_pgmL_t1)
ks.test(lf_death_t1$value[lf_death_t1$mediator == "sRAGE"]
, lf_recovered_t1$value[lf_recovered_t1$mediator == "sRAGE"])
#t1
median(lf_t1$value[lf_t1$mediator == "sRAGE"])
summary(lf_t1$value[lf_t1$mediator == "sRAGE"])
# t2
lf_t2 = lf_data[lf_data$timepoint == "t2",]
median(lf_t2$value[lf_t2$mediator == "sRAGE"], na.rm = T)
summary(lf_t2$value[lf_t2$mediator == "sRAGE"], na.rm = T)
#t3
lf_t3 = lf_data[lf_data$timepoint == "t3",]
median(lf_t3$value[lf_t3$mediator == "sRAGE"], na.rm = T)
summary(lf_t3$value[lf_t3$mediator == "sRAGE"], na.rm = T)
# for trend
lf_death = lf_data[lf_data$outcomes == 0,]
lf_recovered = lf_data[lf_data$outcomes == 1,]
ks.test(lf_death$value[lf_death$mediator == "sRAGE"]
, lf_recovered$value[lf_recovered$mediator == "sRAGE"])