Description of Included Files
- "Virulence_Trade-off.Rproj" This file lets R know the relative file paths for loading and saving files.
- "SymptomActivity.bib" This file has all of the citation saved as a bibTex.
- "Symptom Questionnaire_Redacted.pdf": This is a copy of the electronic questionnaire patients with an upper respiratory symptoms were required to fill out. All identifying information has been redacted.
- "DataDictionary_VirulenceTradeOff.xlsx": This document provides a description of all the variables included in the analysis.
-
"1 Anonymized Data" folder contains the de-identified data for the analyses
- An R script that merges all of the individual data sets and creates and saves "Data.Rda" and "Data.csv" in the "1 Anonymized Data" Folder. This script is not included since the raw data sets are not included to protect patient privacy.
-
"2 Data Cleaning Script" folder contains one R script that cleans the data for the analyses
- "Data Merging Script.R": R script that merges all of the individual data sets and creates and saves "Data.Rda" in the "1 Anonymized Data" Folder. This script is not included since the raw data sets are not included to protect patient privacy.
- "Data Cleaning.R": This R script does all of the data preparation, creating all the required variables for the analysis. This script also produces the data sets used for the analyses and saves them in the "3 Clean Data" folder.
-
"4 Analysis Scripts" folder has 4 R scripts that analyze the clean data and produce the results presented in the main text and supplement.
- "Flu Symptoms Activity Models.R" This script creates the univariate/multivariate linear regression table, the Spearman rank correlation, and the CMH trend tests. Results are saved in "5 Results"
- "Flu Symptoms Activity Plots.R" This script creates all of the plots. Results are saved in "5 Results"
- "Flu Symptoms Activity Tables.R" This script creates all of the tables. Results are saved in "5 Results"
- "Multivariate Subset Selection.R" This script does the variable selection for the multivariate model. Results are saved in "5 Results"
-
"6 Manuscript" folder has 2 files in it used to create the manuscript.
- "Manuscript.Rmd" This Rmd file creates the basic manuscript word document (formatting will not be identical)
- "proceedings-of-the-royal-society-b.csl" is a style file to format the citations in the manuscript
-
"7 Supplemental Material" folder has 2 files used to create this document
- "Supplemental Material.Rmd" This Rmd file creates the basic supplemental material word document (formatting will not be identical)
- "proceedings-of-the-royal-society-b.csl" is a style file to format the citations in the supplement
Reproducing The Results
The files required to reproduce the results are 2 R Markdown files, 4 R script, and one anonymized data file. These files allow the reproduction of all results shown in the main text and SM. To reproduce the results follow these steps.
First, install R, Rstudio, and Pandoc (when you install Rstudio Pandoc should automatically install). Microsoft Word or Open Office Word is also required.
Second, save the zip file from Dryad on your local computer. Open the folder and double click "Virulence_Trade-off". This should open Rstudio (if prompted, select Rstudio as the app to open this file type). Then open and run the files below in the specified order.
-
R script "Data Cleaning.R" in the "2 Data Cleaning Script" folder uses "Data.Rda" and produces two clean data sets used for all further analyses. The data sets are all saved in the "3 Clean Data" folder and include:
- "SympAct_Any_Pos.Rda" Contains data for all influenza patients regardless of diagnosis method.
- "SympAct_Lab_Pos.Rda" Contains data for influenza patients diagnosed based on a PCR or rapid antigen test.
It is important to note that "SympAct_Lab_Pos.Rda" is a subset of "SympAct_Any_Pos.Rda" based on the method of diagnosis.
- Four R scripts in the "4 Analysis Scripts" folder ("Flu Symptoms Activity Univariate Model.R", "Flu Symptoms Activity Univariate Plots.R", and "Flu Symptoms Activity Univariate Tables.R", "Multivariate Subset Selection.R"). The order you run these scripts does not matter. Results of each script are automatically saved in the "5 Results" folder.
- R Markdown "Manuscript.Rmd" is in the "6 Manuscript" folder. This combines all the relevant results and creates the main text as a Word document (some reformatting is required).
- R Markdown "Supplemental Material.Rmd" in the "7 Supplemental Material" folder generates the supplementary material as Word document.
Funding provided by: National Institutes of Health
Crossref Funder Registry ID: http://dx.doi.org/10.13039/100000002
Award Number: U19AI117891
Funding provided by: Roche
Crossref Funder Registry ID: http://dx.doi.org/10.13039/100004337
Award Number: