Groups Analysis Code for 'Performance of Crisis Standards of Care Guidelines in a National Cohort of Critically Ill COVID-19 Patients"
This code is for the groups analysis
Running Instructions:
Rscript Groups_Analysis.R [input file] [group size] [number of iterations] [size of each bootstrap] [final output filename]
Example: Rscript Groups_Analysis.R input.txt 2 100 1000 final.txt
*** Note: Code was slightly modified to do analysis by Race ***
INPUT DESCRIPTIONS:
- Input File: see "Example Input" for columns and format
- Group size: The size of each group (the paper did groups of 2 and groups of 5)
- Number of Iterations: The total n for the distribution of percentages (the paper used 100)
- Size of each Bootstrap: the number of random groups in each iteration to develop the percentages
- Final output: name of final output
INPUT FORMATTING:
Necessary Columns IDs and Information:
- Outcomes : 0 or 1
- NY: New York Algorithm's Scores
- Colorado: Colorado Algorithm's Scores
- SOFA: Raw Sofa Algorithm's Scores
- NY_Age: New York with Age as Tie-breaker Algorithm's scores
- Colorado_Age: Colorado with Age as Tie-breaker Algorithm's scores
- SOFA_Age: SOFA with Age as Tie-breaker Algorithm's scores
Optional Columns:
- Race
- Ethnicity
- Gender
FINAL OUTPUT FORMATTING:
- Column 1: Type of Algorithm
- Column 2: Mean percentage of decisions made without lottery
- Column 3: 95% CI for percentage of decisions made without lottery
- Column 4: Mean percentage of non-lottery decisions that chose a surviving patient
- Column 5: 95% CI for percentage of non-lottery decisions that chose a surviving patient
- Colunn 6: Mean percentage of all decisions that chose a surviving patient
- Colunn 7: 95% CI of all decisions that chose a surviving patient