renamed reg_cols_extraction.R to colnames_clinical_meds.R
This commit is contained in:
parent
66f49a0eed
commit
702ff4e327
4 changed files with 5 additions and 29 deletions
|
@ -10,7 +10,7 @@ getwd()
|
||||||
# Input: source data
|
# Input: source data
|
||||||
#====================
|
#====================
|
||||||
source("read_data.R")
|
source("read_data.R")
|
||||||
source("reg_cols_extraction.R")
|
source("colnames_clinical_meds.R")
|
||||||
########################################################################
|
########################################################################
|
||||||
# quick sanity checks
|
# quick sanity checks
|
||||||
table(adult_df$ia_exac_copd==1 & adult_df$asthma == 1) # check this is 4
|
table(adult_df$ia_exac_copd==1 & adult_df$asthma == 1) # check this is 4
|
||||||
|
|
|
@ -10,7 +10,7 @@ getwd()
|
||||||
# Input: source data for clinical
|
# Input: source data for clinical
|
||||||
#====================
|
#====================
|
||||||
source("data_extraction_formatting_clinical.R")
|
source("data_extraction_formatting_clinical.R")
|
||||||
#source("reg_cols_extraction.R")
|
#source("colnames_clinical_meds.R")
|
||||||
#=======================================
|
#=======================================
|
||||||
# Data for mediator to include in regression
|
# Data for mediator to include in regression
|
||||||
#=======================================
|
#=======================================
|
||||||
|
|
|
@ -20,31 +20,7 @@ source("data_extraction_formatting_clinical.R")
|
||||||
outfile_name_clinical = paste0("flu_stats_clinical_unpaired.csv")
|
outfile_name_clinical = paste0("flu_stats_clinical_unpaired.csv")
|
||||||
outfile_clinical_unpaired = paste0(outdir_stats, outfile_name_clinical)
|
outfile_clinical_unpaired = paste0(outdir_stats, outfile_name_clinical)
|
||||||
outfile_clinical_unpaired
|
outfile_clinical_unpaired
|
||||||
#===============================
|
|
||||||
# data assignment for stats
|
|
||||||
#================================
|
|
||||||
wf = npa_wf[npa_wf$flustat == 1,]
|
|
||||||
lf = npa_lf[npa_lf$flustat == 1,]
|
|
||||||
lf$timepoint = paste0("t", lf$timepoint)
|
|
||||||
lf = lf[!lf$mediator == "vitd",]
|
|
||||||
########################################################################
|
|
||||||
# clear variables
|
|
||||||
rm(sam_lf, sam_wf
|
|
||||||
, serum_lf, serum_wf)
|
|
||||||
rm(colnames_sam_df, expected_rows_sam_lf
|
|
||||||
, colnames_serum_df, expected_rows_serum_lf)
|
|
||||||
|
|
||||||
rm(pivot_cols)
|
|
||||||
|
|
||||||
# sanity checks
|
|
||||||
table(lf$timepoint)
|
|
||||||
|
|
||||||
#if (table(lf$flustat) == table(npa_lf$flustat)[[2]]){
|
|
||||||
# cat("Analysing Flu positive patients for:", my_sample_type)
|
|
||||||
#}else{
|
|
||||||
# cat("FAIL: problem with subsetting data for:", my_sample_type)
|
|
||||||
# quit()
|
|
||||||
#}
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Unpaired stats for clinical data b/w groups: wilcoxon UNpaired analysis
|
# Unpaired stats for clinical data b/w groups: wilcoxon UNpaired analysis
|
||||||
# No correction required
|
# No correction required
|
||||||
|
@ -73,9 +49,9 @@ gathercols <- c("age", "los", "onset2final", "onsfindeath", "onset_2_initial", "
|
||||||
|
|
||||||
clinical_lf = gather_(clinical_df_numerical, keycol, valuecol, gathercols)
|
clinical_lf = gather_(clinical_df_numerical, keycol, valuecol, gathercols)
|
||||||
|
|
||||||
#==============
|
#====================
|
||||||
# unpaired: t1
|
# unpaired: clinical
|
||||||
#==============
|
#====================
|
||||||
sum(is.na(clinical_lf$value))
|
sum(is.na(clinical_lf$value))
|
||||||
|
|
||||||
foo = clinical_lf[which(is.na(clinical_lf$value)),]
|
foo = clinical_lf[which(is.na(clinical_lf$value)),]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue