If you are interested in a specific part of the analysis, or you want to
rerun the code in chunks, or there is any other reason you don't want to
use the Wrapper.R
script, here is a description of the code files and the
order in which they should be run.
Figures.R
: this script processes the results of our calculations and makes the figures used in the manusucript and the appendix.Tables.R
: this script generates the tables (in flextable.Rds
format) that are included in the manuscript and the appendix.- Note that you need to run all of the analysis and model building scripts before you can recreate the Figures, Tables, or Products.
This folder contains scripts that define helper functions for use elsewhere. They are defined here to make the code in other scripts easier to read. You do not need to run any of the scripts in this folder to reproduce the analysis, they will be utilized automatically by the scripts that need them.
This scripts do the mathematical calculations for several parts of our analysis,
mainly calculating the CDR results for each patient, computing agreement
statistics with CIs, and sensitivity analyses for the choice of test/treat
thresholds. The scripts that calculate CIs may be computationally intensive to
run. If you want to run the scripts manually (i.e. without using wrapper.R
)
then you should run them in the order they appear in this list.
CPR-Calculations.R
: calculates the different CDRs used for this project. (Note that at the beginning of this project we were using the acronym CPR for clinical prediction rule instead of CDR. They are the same thing, we just thought that CPR was too confusing for a clinical journal.)CPR-Validation.R
: calculates performance metrics for the various CDRs on our dataset.Dx-Agreement.R
: calculates agreement statistics between the multiple diagnostic methods used in our study. Note that clinicians were not blinded to test results so these statistics are likely inflated.Score-Agreement.R
: calculates agreements between the CDRs on the patient data and on the clinician data, i.e. comparing patient and clinician assessments of the patetient's symptoms.Symptoms-IRR.R
: calculates agreement statistics between reports of individual symptoms.thresholds-sensitivity-analysis.R
: this script must be run after the model-building scripts below!!
These scripts fit multiple predictive models to the symptom data. The scripts that implement machine learning models may be computationally intensive or time-consuming to run. If you run these scripts manually they may not run unless you run them in the order specified here.
Data-Processing-for-Model-Building.R
: gets the data into the correct format so it is ready to use with thetidymodels
set of packages.…-Models-…-Data.R
: Fits the specified models to the specified data set. You should be able to run these in any order, but we recommend running them in the order they show up in the folder.ZZZ-Result-Processing.R
: processes the fitted model objects and wrangles the model data into the correct format for making figures and tables.
- Run the scripts in the
Analysis
folder (EXCEPT forthresholds-sensitivity-analysis.R
) - Run the scripts in the
Model-Building
folder - Run
Analysis/thresholds-sensitivity-analysis.R
- Run the
Figures.R
andTables.R
scripts - Knit the manuscript and appendix files.