Replication package: Inpatient occupancy and the seasonality of emergency department waiting times — a five-region panel analysis of mainland Portugal, 2016–2025
Authors/Creators
- 1. Universidade Nova de Lisboa Escola Nacional de Saúde Pública
Description
Replication package (data snapshot, code, outputs and logs) for: Lourenço A, Santana R. Inpatient occupancy and the seasonality of emergency department waiting times: a five-region panel analysis of mainland Portugal, 2016–2025. Manuscript under peer review, 2026.
The archive contains a snapshot of the six open datasets retrieved from the SNS Transparency Portal of the Portuguese Ministry of Health (https://transparencia.sns.gov.pt) between 18 and 22 April 2026; the analytical panel (five regional health administrations plus the national series, 110 months); the Stata and Mata code; and the logs of the runs reported in the manuscript. One command reproduces everything: do 00_master.do from inside 03_stata/. See README.md inside the archive.
Version v2.0. The whole pipeline, from the raw files to the figures, now runs in Stata (StataNow/SE 19.5): the panel construction, the STL decomposition (implemented in Mata as a line-by-line port of the original procedure of Cleveland et al. 1990) and the threshold searches replace the Python scripts of versions 1.0–1.1, which are retired. The analytical panel, the STL components and the deterministic threshold profiles reproduce the version 1.1 outputs to 4 × 10⁻¹⁰ or better; Tables 2 and 3 are byte-identical. The only values that change are the two sup-Wald bootstrap p-values (occupancy threshold 0.184, previously 0.193; coverage threshold 0.090, previously 0.106), which depend on the random draws; neither conclusion changes. The raw data snapshot is unchanged. Previous version: https://doi.org/10.5281/zenodo.23454762.