Contains everything necessary to obtain the results from the Journal of Clinical Monitoring and Computing original research paper (Figure and Table numbers need to be updated).
doi: 10.1007/s10877-022-00908-z
A folder must be created that contains the raw ACS NSQIP data.
-
clean.py:
Takes the raw ACS NSQIP data and cleans it. Can change the name of the input/output files if you want to clean different subsamples.
-
split.py:
Creates resampled data files for the combined, early and late reintubation outcomes so the number of events is equal to the number of non-events. This is also where the plots in Figure 1 come from.
-
model.py:
Contains a bunch of different functions to help with modeling. Some code can be uncommented in the first function, called set_up, to run the models with the CPT-specific risk values as the only predictor.
-
test.py
For running the models on the full data. The outcome/response variable can be specified (i.e. reintub, early_reintub, late_reintub). Results are output to csv.
-
compare.py
Takes the results csv from test.py and runs the rank sums test in terms of brier score. It also gets the average of each statistic and displays those (this is where the results from Tables 1-5 come from).
-
heuristic.py
Performs the heruistic feature analysis for a specific outcome/response variable.
-
reduce.py
Takes the top 20 variables from the heuristic analysis (must be copied over manually at the moment) and creates plots of performance vs. number of features for both Brier score and c-statistic (this is where Figures 2-4 come from).
-
score.py
For determining the coefficients from the logistic regression models fit using the optimal number of features from the plots of performance vs. number of features (this is where the results from Tables 6-9 come from).