formatted non-flu stats in the same way as the flu ones

This commit is contained in:
Tanushree Tunstall 2020-10-26 14:33:20 +00:00
parent efcdb1a34d
commit 61fbb2f8d6
10 changed files with 319 additions and 226 deletions

10
flu_stats_unpaired_npa.R Normal file → Executable file
View file

@ -33,8 +33,11 @@ lf = npa_adults_lf[npa_adults_lf$flustat == 1,]
table(lf$timepoint)
lf$timepoint = paste0("t", lf$timepoint)
my_sample_type = "npa"
########################################################################
# Unpaired stats at each timepoint b/w groups: wilcoxon UNpaired analysis with correction
# Unpaired stats at each timepoint b/w groups: wilcoxon UNpaired analysis
# with correction
#######################################################################
# with adjustment: fdr and BH are identical
my_adjust_method = "BH"
@ -234,7 +237,8 @@ if ( nrow(combined_unpaired_stats) == expected_rows && ncol(combined_unpaired_st
combined_unpaired_stats = subset(combined_unpaired_stats, select = -c(.y.))
# add sample_type
combined_unpaired_stats$sample_type = "npa"
cat("Adding sample type info as a column", my_sample_type, "...")
combined_unpaired_stats$sample_type = my_sample_type
# add: reflect stats method correctly i.e paired or unpaired
# incase there are NA due to LLODs, the gsub won't work!
@ -313,4 +317,4 @@ colnames(combined_unpaired_stats_f)
# write output file
#******************
cat("UNpaired stats for groups will be:", stats_time_unpaired_flu_npa)
write.csv(combined_unpaired_stats_f, stats_time_unpaired_flu_npa, row.names = FALSE)
write.csv(combined_unpaired_stats_f, stats_time_unpaired_flu_npa, row.names = FALSE)