Published June 16, 2026 | Version v1

R Script for the Statistical Analysis of the Study: 'Clinical Trajectories and Determinants of One-Year Survival in Cardiogenic Shock: A Multistate Analysis of the ALTSHOCK-ENIGMA Registry'

Description

This repository contains the complete, reproducible R code used for the statistical analyses in the ENIGMA Project (2026). The script implements a comprehensive analytical pipeline to map the complex clinical trajectories of patients, from acute hospital admission to post-discharge outcomes.

The analysis relies on advanced survival analysis, specifically:

  • Data Wrangling & Time-to-Event Alignment: Precise calculation of time-dependent variables to track the onset and duration of Mechanical Circulatory Support (IABP, Impella, ECMO) and Heart Replacement Therapies (HRT).

  • Multiple Imputation (mice): Handling of missing clinical data at discharge (e.g., LVEF, TAPSE, OMT score) across 10 imputed datasets, with custom conditional matrices to exclude imputation for in-hospital deaths.

  • Multi-State Modeling (mstate): Expansion of patient timelines into a robust 13-state transition model, tracking transitions between acute therapies, various discharge settings (Home, Rehab, Hospice), and mortality.

  • Convolution & State Occupation Probabilities (SOP): Integration of in-hospital multinomial regression models (nnet) with post-discharge generalized linear models to simulate and plot dynamic State Occupation Probabilities over a 365-day follow-up.

In strict compliance with EU General Data Protection Regulation (GDPR) and ethical committee requirements, the original dataset containing sensitive patient health information is not included in this public repository. 

Files

Files (1.5 MB)

Name Size Download all
md5:e11054116a2b97b126befbfce275df65
1.5 MB Download

Additional details

Related works

Is part of
Journal article: 10.1136/bmjopen-2024-092790 (DOI)

Funding

Ministero della Salute
PNRR-MCNT2-2023-12377767

Dates

Created
2026-06-16

Software

Programming language
R
Development Status
Active