added and moved plot_data for non-asthmatics and non-severe analysis
This commit is contained in:
parent
c3b1ba9a0e
commit
3338de800a
2 changed files with 117 additions and 0 deletions
59
plot_data_na.R
Executable file
59
plot_data_na.R
Executable file
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/Rscript
|
||||
getwd()
|
||||
setwd("~/git/mosaic_2020/")
|
||||
getwd()
|
||||
############################################################
|
||||
# TASK: boxplots at T1
|
||||
# FIXME: currently not rendering, problem with NAs for stats?
|
||||
############################################################
|
||||
|
||||
#=============
|
||||
# Input
|
||||
#=============
|
||||
#source("data_extraction_formatting_non_asthmatics.R")
|
||||
source("data_extraction_mediators.R")
|
||||
|
||||
#===============================
|
||||
# data assignment for plots
|
||||
#================================
|
||||
#-----------
|
||||
# npa
|
||||
#-----------
|
||||
wf_fp_npa = npa_wf[npa_wf$asthma == 0,]
|
||||
lf_fp_npa = npa_lf[npa_lf$asthma == 0,]
|
||||
lf_fp_npa$timepoint = paste0("t", lf_fp_npa$timepoint)
|
||||
lf_fp_npa$timepoint = as.factor(lf_fp_npa$timepoint)
|
||||
lf_fp_npa$obesity = as.factor(lf_fp_npa$obesity)
|
||||
|
||||
table(lf_fp_npa$mediator)
|
||||
head(lf_fp_npa$value[lf_fp_npa$mediator == "vitd"])
|
||||
lf_fp_npa = lf_fp_npa[!lf_fp_npa$mediator == "vitd",]
|
||||
table(lf_fp_npa$mediator)
|
||||
|
||||
#-----------
|
||||
# sam
|
||||
#-----------
|
||||
wf_fp_sam = sam_wf[sam_wf$asthma == 0,]
|
||||
lf_fp_sam = sam_lf[sam_lf$asthma == 0,]
|
||||
lf_fp_sam$timepoint = paste0("t", lf_fp_sam$timepoint)
|
||||
lf_fp_sam$timepoint = as.factor(lf_fp_sam$timepoint)
|
||||
lf_fp_sam$obesity = as.factor(lf_fp_sam$obesity)
|
||||
|
||||
table(lf_fp_sam$mediator)
|
||||
head(lf_fp_sam$value[lf_fp_sam$mediator == "vitd"])
|
||||
lf_fp_sam = lf_fp_sam[!lf_fp_sam$mediator == "vitd",]
|
||||
table(lf_fp_sam$mediator)
|
||||
|
||||
#-----------
|
||||
# serum
|
||||
#-----------
|
||||
wf_fp_serum = serum_wf[serum_wf$asthma == 0,]
|
||||
lf_fp_serum = serum_lf[serum_lf$asthma == 0,]
|
||||
lf_fp_serum$timepoint = paste0("t", lf_fp_serum$timepoint)
|
||||
lf_fp_serum$timepoint = as.factor(lf_fp_serum$timepoint)
|
||||
lf_fp_serum$obesity = as.factor(lf_fp_serum$obesity)
|
||||
|
||||
head(lf_fp_sam$value[lf_fp_serum$mediator == "vitd"])
|
||||
########################################################################
|
||||
|
||||
rm(npa_lf, npa_wf, sam_lf, sam_wf, serum_lf, serum_wf)
|
58
plot_data_ns.R
Normal file
58
plot_data_ns.R
Normal file
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/Rscript
|
||||
getwd()
|
||||
setwd("~/git/mosaic_2020/")
|
||||
getwd()
|
||||
############################################################
|
||||
# TASK: boxplots at T1
|
||||
# FIXME: currently not rendering, problem with NAs for stats?
|
||||
############################################################
|
||||
|
||||
#=============
|
||||
# Input
|
||||
#=============
|
||||
source("data_extraction_mediators.R")
|
||||
|
||||
#===============================
|
||||
# data assignment for plots
|
||||
#================================
|
||||
#-----------
|
||||
# npa
|
||||
#-----------
|
||||
wf_fp_npa = npa_wf[npa_wf$T1_resp_score != 3,]
|
||||
lf_fp_npa = npa_lf[npa_lf$T1_resp_score != 3,]
|
||||
lf_fp_npa$timepoint = paste0("t", lf_fp_npa$timepoint)
|
||||
lf_fp_npa$timepoint = as.factor(lf_fp_npa$timepoint)
|
||||
lf_fp_npa$obesity = as.factor(lf_fp_npa$obesity)
|
||||
|
||||
table(lf_fp_npa$mediator)
|
||||
head(lf_fp_npa$value[lf_fp_npa$mediator == "vitd"])
|
||||
lf_fp_npa = lf_fp_npa[!lf_fp_npa$mediator == "vitd",]
|
||||
table(lf_fp_npa$mediator)
|
||||
|
||||
#-----------
|
||||
# sam
|
||||
#-----------
|
||||
wf_fp_sam = sam_wf[sam_wf$T1_resp_score != 3,]
|
||||
lf_fp_sam = sam_lf[sam_lf$T1_resp_score != 3,]
|
||||
lf_fp_sam$timepoint = paste0("t", lf_fp_sam$timepoint)
|
||||
lf_fp_sam$timepoint = as.factor(lf_fp_sam$timepoint)
|
||||
lf_fp_sam$obesity = as.factor(lf_fp_sam$obesity)
|
||||
|
||||
table(lf_fp_sam$mediator)
|
||||
head(lf_fp_sam$value[lf_fp_sam$mediator == "vitd"])
|
||||
lf_fp_sam = lf_fp_sam[!lf_fp_sam$mediator == "vitd",]
|
||||
table(lf_fp_sam$mediator)
|
||||
|
||||
#-----------
|
||||
# serum
|
||||
#-----------
|
||||
wf_fp_serum = serum_wf[serum_wf$T1_resp_score != 3,]
|
||||
lf_fp_serum = serum_lf[serum_lf$T1_resp_score != 3,]
|
||||
lf_fp_serum$timepoint = paste0("t", lf_fp_serum$timepoint)
|
||||
lf_fp_serum$timepoint = as.factor(lf_fp_serum$timepoint)
|
||||
lf_fp_serum$obesity = as.factor(lf_fp_serum$obesity)
|
||||
|
||||
head(lf_fp_sam$value[lf_fp_serum$mediator == "vitd"])
|
||||
########################################################################
|
||||
|
||||
rm(npa_lf, npa_wf, sam_lf, sam_wf, serum_lf, serum_wf, fp_adults_ics)
|
Loading…
Add table
Add a link
Reference in a new issue