183 lines
4.3 KiB
R
Executable file
183 lines
4.3 KiB
R
Executable file
#!/usr/bin/Rscript
|
|
getwd()
|
|
setwd("~/git/mosaic_2020/")
|
|
getwd()
|
|
########################################################################
|
|
# TASK: check stats
|
|
########################################################################
|
|
# load libraries, packages and local imports
|
|
source("Header_TT.R")
|
|
|
|
#=============
|
|
# Input
|
|
#=============
|
|
source("data_extraction_mediators.R")
|
|
#source("read_data.R")
|
|
|
|
########################################################################
|
|
#=============
|
|
# Data extraction for non-severe
|
|
#=============
|
|
table(fp_adults_ics$asthma)
|
|
table(fp_adults_ics$obesity)
|
|
|
|
df = fp_adults_ics[fp_adults_ics$asthma == 1,]
|
|
table(df$obesity)
|
|
|
|
df_ob = df[df$obesity == 1,]
|
|
df_nob = df[df$obesity == 0,]
|
|
|
|
rm(npa_lf, npa_wf, sam_lf, sam_wf, serum_lf, serum_wf, fp_adults_ics)
|
|
|
|
#============
|
|
# npa
|
|
#============
|
|
# il8: t2
|
|
wilcox.test(df_ob$il8_serum2, df_nob$il8_serum2)
|
|
wilcox_test(il8_serum2 ~ obesity, data = df)
|
|
|
|
foo = data.frame(df$obesity, df$il8_serum2)
|
|
na_c = sum(is.na(foo$df.il8_serum2))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$il8_serum2, df$obesity, median, na.rm = T)
|
|
tapply(df$il8_serum2, df$obesity, summary, na.rm = T)
|
|
|
|
# il8_2: t2
|
|
wilcox.test(df_ob$il8_2_serum2, df_nob$il8_2_serum2)
|
|
wilcox_test(il8_2_serum2 ~ obesity, data = df)
|
|
|
|
foo = data.frame(df$obesity, df$il8_2_serum2)
|
|
na_c = sum(is.na(foo$df.il8_2_serum2))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$il8_2_serum2, df$obesity, median, na.rm = T)
|
|
tapply(df$il8_2_serum2, df$obesity, summary, na.rm = T)
|
|
|
|
|
|
# il4: t3
|
|
wilcox.test(df_ob$il4_serum3, df_nob$il4_serum3)
|
|
wilcox_test(il4_serum3 ~ obesity, data = df)
|
|
|
|
foo = data.frame(df$obesity, df$il4_serum3)
|
|
na_c = sum(is.na(foo$df.il4_serum3))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$il4_serum3, df$obesity, median, na.rm = T)
|
|
tapply(df$il4_serum3, df$obesity, summary, na.rm = T)
|
|
|
|
# ifnb: t3
|
|
wilcox.test(df_ob$ifnb_serum3, df_nob$ifnb_serum3)
|
|
wilcox_test(ifnb_serum3 ~ obesity, data = df)
|
|
|
|
foo = data.frame(df$obesity, df$ifnb_serum3)
|
|
na_c = sum(is.na(foo$df.ifnb_serum3))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$ifnb_serum3, df$obesity, median, na.rm = T)
|
|
tapply(df$ifnb_serum3, df$obesity, summary, na.rm = T)
|
|
|
|
#============
|
|
# sam
|
|
#============
|
|
# tarc: t3
|
|
wilcox.test(df_ob$tarc_sam3
|
|
, df_nob$tarc_sam3)
|
|
|
|
foo = data.frame(df$obesity, df$tarc_sam3)
|
|
na_c = sum(is.na(foo$df.tarc_sam3))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$tarc_sam3, df$obesity, median, na.rm = T)
|
|
|
|
|
|
# il13: t3
|
|
wilcox.test(df_ob$il13_sam3
|
|
, df_nob$il13_sam3)
|
|
|
|
foo = data.frame(df$obesity, df$il13_sam3)
|
|
na_c = sum(is.na(foo$df.il13_sam3))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$il13_sam3, df$obesity, median, na.rm = T)
|
|
|
|
|
|
# eotaxin: t1
|
|
wilcox.test(df_ob$eotaxin_sam1
|
|
, df_nob$eotaxin_sam1)
|
|
|
|
foo = data.frame(df$obesity, df$eotaxin_sam1)
|
|
na_c = sum(is.na(foo$df.eotaxin_sam1))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$eotaxin_sam1, df$obesity, median, na.rm = T)
|
|
|
|
|
|
#============
|
|
# serum
|
|
#============
|
|
# ifna2a: t1
|
|
wilcox.test(df_ob$ifna2a_serum1,
|
|
df_nob$ifna2a_serum1)
|
|
|
|
foo = data.frame(df$obesity, df$ifna2a_serum1)
|
|
na_c = sum(is.na(foo$df.ifna2a_serum1))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$ifna2a_serum1, df$obesity, median, na.rm = T)
|
|
|
|
|
|
# mip17: t1
|
|
wilcox.test(df_ob$mip17_serum1,
|
|
df_nob$mip17_serum1)
|
|
|
|
foo = data.frame(df$obesity, df$mip17_serum1)
|
|
na_c = sum(is.na(foo$df.mip17_serum1))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$mip17_serum1, df$obesity, median, na.rm = T)
|
|
|
|
# il1: t1
|
|
wilcox.test(df_ob$il1_serum1
|
|
, df_nob$il1_serum1)
|
|
|
|
foo = data.frame(df$obesity, df$il1_serum1)
|
|
na_c = sum(is.na(foo$df.il1_serum1))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$il1_serum1, df$obesity, median, na.rm = T)
|
|
tapply(df$il1_serum1, df$obesity, summary, na.rm = T)
|
|
boxplot(df_ob$il1_serum1, df_nob$il1_serum1)
|
|
|
|
|
|
# ifna2a: t2
|
|
wilcox.test(df_ob$ifna2a_serum2,
|
|
df_nob$ifna2a_serum2)
|
|
|
|
foo = data.frame(df$obesity, df$ifna2a_serum2)
|
|
na_c = sum(is.na(foo$df.ifna2a_serum2))
|
|
nrow(df) - na_c
|
|
|
|
|
|
tapply(df$ifna2a_serum2, df$obesity, median, na.rm = T)
|
|
|
|
# ifna2a: t3
|
|
wilcox.test(df_ob$ifna2a_serum3,
|
|
df_nob$ifna2a_serum3)
|
|
|
|
foo = data.frame(df$obesity, df$ifna2a_serum3)
|
|
na_c = sum(is.na(foo$df.ifna2a_serum3))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$ifna2a_serum3, df$obesity, median, na.rm = T)
|
|
|
|
|
|
# ifnb: t3
|
|
wilcox.test(df_ob$ifnb_serum3
|
|
, df_nob$ifnb_serum3)
|
|
|
|
foo = data.frame(df$obesity, df$ifnb_serum3)
|
|
na_c = sum(is.na(foo$df.ifnb_serum3))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$ifnb_serum3, df$obesity, median, na.rm = T)
|