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 Example1_Data.csv, ext_mstate.R, LOS_boot.R, and Example1_Analysis.R are in the same working directory folder. Then run Example1_Analysis.R The data Example1_Data.csv was extracted from Figure 2 in: Bhatraju PK, Ghassemieh BJ, Nichols M, Kim R, Jerome KR, Nalla AK, et al. Covid-19 in Critically Ill Patients in the Seattle Region — Case Series. New England Journal of Medicine. 2020 Mar 30;0(0):null. doi: 10.1056/NEJMoa2004500 Codebook for Example1_Data.csv Variable Value Explanation id 1 to 24 id from 1 to 2 state entered at time 'entry' to 0 to 4 state entered at time 'exit' entry 0 to 16 time of entry into state 'from' exit 1 to 31 time of entry into state 'to' State 0: Censored State 1: ICU without mechanical ventilation and acute care State 2: ICU with mechanical ventilation State 3: Discharge State 4: Death