added plot_data_na.R for plotting non-asthmatics fp adults
This commit is contained in:
parent
3b6776af24
commit
e71a2ccd40
1 changed files with 60 additions and 0 deletions
60
plot_data_na.R
Executable file
60
plot_data_na.R
Executable file
|
@ -0,0 +1,60 @@
|
|||
#!/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")
|
||||
|
||||
# check: adult variable and age variable discrepancy!
|
||||
metadata_all$mosaic[metadata_all$adult==1 & metadata_all$age<=18]
|
||||
|
||||
#===============================
|
||||
# data assignment for plots
|
||||
#================================
|
||||
#-----------
|
||||
# npa
|
||||
#-----------
|
||||
wf_fp_npa = npa_wf[npa_wf$flustat == 1,]
|
||||
lf_fp_npa = npa_lf[npa_lf$flustat == 1,]
|
||||
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$flustat == 1,]
|
||||
lf_fp_sam = sam_lf[sam_lf$flustat == 1,]
|
||||
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$flustat == 1,]
|
||||
lf_fp_serum = serum_lf[serum_lf$flustat == 1,]
|
||||
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"])
|
||||
########################################################################
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue