179 lines
4.1 KiB
R
Executable file
179 lines
4.1 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$T1_resp_score)
|
|
table(fp_adults_ics$obesity)
|
|
|
|
df = fp_adults_ics[fp_adults_ics$T1_resp_score<3,]
|
|
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
|
|
#============
|
|
# vl_pfu_ul: t2
|
|
wilcox.test(df_ob$vl_pfu_ul_npa2, df_nob$vl_pfu_ul_npa2)
|
|
wilcox_test(vl_pfu_ul_npa2 ~ obesity, data = df)
|
|
|
|
foo = data.frame(df$obesity, df$vl_pfu_ul_npa2)
|
|
na_c = sum(is.na(foo$df.vl_pfu_ul_npa2))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$vl_pfu_ul_npa2, df$obesity, median, na.rm = T)
|
|
tapply(df$vl_pfu_ul_npa2, df$obesity, summary, na.rm = T)
|
|
|
|
# 1l29: t1
|
|
wilcox.test(df_ob$il29_npa1, df_nob$il29_npa1)
|
|
|
|
foo = data.frame(df$obesity, df$il29_npa1)
|
|
na_c = sum(is.na(foo$df.il29_npa1))
|
|
nrow(df) - na_c
|
|
|
|
tapply(df$il29_npa1, df$obesity, median, na.rm = T)
|
|
tapply(df$il29_npa1, df$obesity, summary, na.rm = T)
|
|
|
|
# tnfr1: t3
|
|
wilcox.test(df_ob$tnfr1_npa3, df_nob$tnfr1_npa3)
|
|
|
|
foo = data.frame(df$obesity, df$tnfr1_npa3)
|
|
na_c = sum(is.na(foo$df.tnfr1_npa3))
|
|
nrow(df) - na_c
|
|
|
|
|
|
tapply(df$tnfr1_npa3, df$obesity, median, na.rm = T)
|
|
tapply(df$tnfr1_npa3, df$obesity, summary, na.rm = T)
|
|
|
|
boxplot(df_ob$tnfr1_npa3, df_nob$tnfr1_npa3)
|
|
|
|
# rantes: t1
|
|
wilcox.test(df_ob$rantes_npa1, df_nob$rantes_npa1)
|
|
|
|
foo = data.frame(df$obesity, df$rantes_npa1)
|
|
na_c = sum(is.na(foo$df.rantes_npa1))
|
|
nrow(df) - na_c
|
|
|
|
#============
|
|
# 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)
|