Title: Joint analysis of duration of ventilation, length of intensive care, and mortality of COVID-19 patients: a multistate approach Authors: Derek Hazard, Klaus Kaier, Maja von Cube, Marlon Grodd, Lars Bugiera, Jerome Lambert, Martin Wolkewitz Derek Hazard was responsible for writing the code. Jerome Lambert and Marlon Grodd contributed to the development of the code. For questions, comments, and remarks on the code, please contact Derek Hazard at hazard@imbi.uni-freiburg.de Configurations on which code was tested: R version 4.0.1 (2020-06-06) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 18362) Matrix products: default locale: [1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C [5] LC_TIME=German_Germany.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] mstate_0.2.12 survival_3.1-12 loaded via a namespace (and not attached): [1] compiler_4.0.1 Matrix_1.2-18 tools_4.0.1 [4] RColorBrewer_1.1-2 splines_4.0.1 grid_4.0.1 [7] lattice_0.20-41 README: Code should be executed with R version 4.0.1 To reproduce the results presented in the manuscript, make sure Example2_Data.csv, ext_mstate.R, LOS_boot.R, and Example2_Analysis.R are in the same working directory folder. Then run Example2_Analysis.R The data Example2_Data.csv was extracted from Figure 2 in: Grein J, Ohmagari N, Shin D, Diaz G, Asperges E, Castagna A, et al. Compassionate Use of Remdesivir for Patients with Severe Covid-19. New England Journal of Medicine. 2020 Apr 10;0(0):null. doi: 10.1056/NEJMoa2007016 Codebook for Example1_Data.csv Variable Value Explanation id 1 to 53 id from 1 to 2 state entered at time 'entry' to 0 to 4 state entered at time 'exit' entry 0 to 24 time of entry into state 'from' exit 1 to 28 time of entry into state 'to' State 0: Censored State 1: Noninvasive Positive Pressure Ventilation, Nasal High-Flow Oxygen Therapy, Low-Flow Oxygen, Ambient Air State 2: ECMO and Invasive Mechanical Ventilation State 3: Discharge State 4: Death