Saved in:
Bibliographic Details
Main Author: January G. Msemakweli
Format: Recurso digital
Language:
Published: Zenodo 2026
Online Access:https://doi.org/10.5281/zenodo.19155046
Tags: Add Tag
No Tags, Be the first to tag this record!
Table of Contents:
  • <h1>Pandemic Disruptions and Post-COVID Patterns of Antimicrobial Resistance-Associated Notifications in Sweden</h1> <p>Analysis of pandemic disruptions and post-COVID patterns of antimicrobial resistance–associated notifications in Sweden: regional incidence for <strong>ESBL/CARBA</strong>, <strong>VRE</strong>, and <strong>MRSA</strong>.</p> <h2>Overview</h2> <ul> <li><strong>Pre-COVID (2015–2019):</strong> baseline</li> <li><strong>COVID (2020–2021):</strong> pandemic period</li> <li><strong>Post-COVID (2022–2025):</strong> recovery</li> </ul> <p>The analysis uses negative binomial regression (period-based IRR and interrupted time-series) with region fixed effects, log-population offset, and <strong>cluster-robust standard errors</strong> (clustered by county, HC1 via <code>sandwich::vcovCL</code>) to account for within-county temporal dependence. Population denominators come from Statistics Sweden (SCB) via the PxWeb API.</p> <p>A <strong>sensitivity analysis</strong> re-runs both models on 2015–2024 only (excluding 2025), because the 2025 population denominator is derived from SCB's monthly table rather than the finalized annual total.</p> <h2>Data</h2> <p>| File | Description | |------|-------------| | <code>AMR_Associated_Infections.csv</code> | Regional case counts and incidence rates (per 100,000) by year. Source: Swedish Public Health Agency (Folkhälsomyndigheten) / SmiNet. |</p> <p>Population data are fetched from SCB (annual table <code>BefolkningNy</code> for 2015–2024; 2025 uses the monthly table <code>BefolkManadCKM</code> if needed). Results are cached under the project or parent folder (e.g. <code>../scb_population_county_2015_2024.csv</code>).</p> <h2>Project structure</h2> <p>| File / folder | Purpose | |---------------|---------| | <code>AMR_Associated_Infections_Analysis.R</code> | Main R script: load data, fetch SCB population, build long-format data, run period and ITS models (with cluster-robust SEs), sensitivity analysis (excluding 2025), produce summary and IRR/ITS tables. | | <code>AMR_Associated_Infections_Analysis.Rmd</code> | R Markdown report: same analysis as the R script, rendered to PDF with formatted tables, figures, and narrative interpretation. | | <code>make_amr_its_counterfactual_plots.R</code> | Build ITS counterfactual figures (observed vs fitted vs no-interruption) and write CSVs + PNGs into <code>amr_its_plots/</code>. | | <code>make_amr_its_counterfactual_panel.R</code> | Single panel figure combining ESBL/CARBA, VRE, and MRSA counterfactual plots. | | <code>create_amr_maps.R</code> | Choropleth maps of mean regional incidence by period (Pre-COVID, COVID, Post-COVID) for ESBL-CARBA, VRE, MRSA; outputs <code>map_amr_infections_combined.png</code>. | | <code>amr_its_plots/</code> | Output folder for ITS national series CSVs and counterfactual PNGs. |</p> <h2>Requirements</h2> <ul> <li><strong>R</strong> (tested with a recent R 4.x).</li> <li><strong>R packages:</strong><br> <code>tidyverse</code>, <code>MASS</code>, <code>broom</code>, <code>sandwich</code>, <code>lmtest</code>, <code>pxweb</code>, <code>knitr</code>, <code>kableExtra</code> for the main script / Rmd;<br> <code>make_amr_its_counterfactual_*.R</code> also use <code>patchwork</code> and <code>cowplot</code>;<br> <code>create_amr_maps.R</code> uses <code>sf</code>, <code>rnaturalearth</code>, <code>ggspatial</code>, <code>RColorBrewer</code>, <code>patchwork</code>, <code>ggrepel</code>.</li> </ul> <p>Install from CRAN if needed, e.g.:</p> <pre><code>install.packages(c("tidyverse", "MASS", "broom", "sandwich", "lmtest", "pxweb", "knitr", "kableExtra", "patchwork", "cowplot", "sf", "rnaturalearth", "ggspatial", "RColorBrewer", "ggrepel")) </code></pre> <h2>How to run</h2> <ol> <li><p><strong>Set working directory</strong> to the folder that contains <code>AMR_Associated_Infections.csv</code> (the <code>AMR</code> folder).</p> </li> <li><p><strong>Main analysis (tables and model objects):</strong></p> <pre><code>source("AMR_Associated_Infections_Analysis.R") </code></pre> <p>This loads data, fetches/caches SCB population, runs period and ITS models with cluster-robust SEs, runs the sensitivity analysis (excluding 2025), and prints/formats tables (summary stats, IRR table, ITS effects, AIC, and their sensitivity counterparts). If <code>amr_its_plots/</code> and <code>map_amr_infections_combined.png</code> already exist, it will include those figures.</p> </li> <li><p><strong>PDF report:</strong></p> <pre><code>rmarkdown::render("AMR_Associated_Infections_Analysis.Rmd") </code></pre> </li> <li><p><strong>ITS counterfactual figures and CSVs</strong> (optional; creates or updates <code>amr_its_plots/</code>):</p> <pre><code>Rscript make_amr_its_counterfactual_plots.R </code></pre> <p>Or the combined panel:</p> <pre><code>Rscript make_amr_its_counterfactual_panel.R </code></pre> </li> <li><p><strong>Maps</strong> (optional; creates <code>map_amr_infections_combined.png</code>):</p> <pre><code>Rscript create_amr_maps.R </code></pre> </li> </ol> <p>Recommended order: run <code>make_amr_its_counterfactual_plots.R</code> (and optionally <code>create_amr_maps.R</code>) first if you want the main script / Rmd to display the pre-generated figures; otherwise the main script still runs all models and tables.</p> <h2>Outputs</h2> <ul> <li><strong>Console / R environment:</strong> <code>summary_stats</code>, <code>national_trends</code>, <code>all_irr</code>, <code>its_effects</code>, <code>aic_tbl</code>, <code>regional_summary</code>, and their <code>_no2025</code> sensitivity counterparts, plus formatted <code>kable</code> tables.</li> <li><strong>amr_its_plots/:</strong><ul> <li>CSVs: <code>its_national_series_esbl_carba.csv</code>, <code>its_national_series_vre.csv</code>, <code>its_national_series_mrsa.csv</code> (observed and fitted/counterfactual series).</li> <li>PNGs: counterfactual plots per pathogen (and panel if you ran the panel script).</li> </ul> </li> <li><strong>Root:</strong> <code>map_amr_infections_combined.png</code> (from <code>create_amr_maps.R</code>).</li> </ul> <h2>Statistical methods</h2> <ul> <li><strong>Period model:</strong> Negative binomial regression with period indicator (Pre-COVID / COVID / Post-COVID), region fixed effects, log-population offset, and cluster-robust SEs by county.</li> <li><strong>ITS model:</strong> Negative binomial interrupted time-series with step/slope changes at 2020 and 2022, region fixed effects, log-population offset, and cluster-robust SEs by county.</li> <li><strong>Sensitivity:</strong> Both models re-run on 2015–2024 only (excluding 2025) to assess robustness to the provisional 2025 population denominator.</li> </ul> <h2>References</h2> <ul> <li>Swedish Public Health Agency. <a href="https://www.folkhalsomyndigheten.se/">Sjukdomsstatistik / Disease statistics</a>.</li> <li>Statistics Sweden (SCB). <a href="https://www.scb.se/en/About-us/open-data-api/">PxWeb API</a>.</li> </ul>