# A Transformer-Based Framework for Counterfactual Estimation of Antihypertensive Treatment Effect on COVID-19 Infection Risk - A Proof-of-Concept Study

**Authors:** Tran Q B Tran, Stefanie Lip, Honghan Wu, Shyam Visweswaran, Jill P Pell, Sandosh Padmanabhan

PMC · DOI: 10.1093/ajh/hpaf055 · American Journal of Hypertension · 2025-04-18

## TL;DR

This study uses a transformer-based model to estimate how antihypertensive drugs affect the risk of COVID-19 infection, finding that some drugs may offer protection.

## Contribution

A novel transformer-X-learner framework is introduced for causal inference in real-world healthcare data.

## Key findings

- The transformer-X-learner outperformed traditional methods with an F1 score of 0.82 and AUPRC of 0.78.
- Beta-blockers and calcium channel blockers showed protective effects against COVID-19.
- Treatment effects were consistent across age, gender, and socioeconomic categories.

## Abstract

Transformer-based neural networks excel in modelling high-dimensional, time-series data with complex dependencies. This proof-of-concept study applies a transformer-X-learner framework to estimate treatment effects using real-world data, using antihypertensive drug exposure and COVID-19 risk as an exemplar.

We conducted a case-control study of 303,220 NHS Greater Glasgow and Clyde patients aged ≥ 40 years during the first two COVID-19 pandemic waves. Using a transformer-X-learner framework that incorporated temporal patterns in medication usage and comorbidities, we controlled for confounding effects and estimated individual and average treatment effects ACEIs, beta-blockers (BBs), calcium channel blockers (CCBs), thiazides (THZs), and statins on 180-day SARS-CoV-2 infection risk.

The transformer-X-learner framework outperformed traditional approaches, achieving an F1 score of 0.82 and area under the precision-recall curve (AUPRC) of 0.78. ACEIs showed a negligible overall impact on COVID-19 risk (ATE: 0.97%±5.5), while BBs (-8.3%±7.3%) and CCBs (-9.7%±8.1%) were protective. Statins (3.5%±6.1%) and THZs (4.3%±10.8%) showed slight increases in risk. Treatment effects were consistent across age, gender, and socioeconomic categories.

ACEIs do not substantially increase the risk of COVID-19 infection while the protective effects of BBs and CCBs warrant further investigation. This study highlights the potential of transformer-based causal inference models as a powerful tool for evaluating treatment safety and efficacy in complex healthcare scenarios.

Graphical Abstract

## Linked entities

- **Diseases:** COVID-19 (MONDO:0100096)

## Full-text entities

- **Diseases:** COVID-19 (MESH:D000086382)
- **Chemicals:** THZs (MESH:D049971), ACEIs (-)
- **Species:** Homo sapiens (human, species) [taxon 9606]

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12260164/full.md

## Figures

3 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12260164/full.md

## References

40 references — full list in the complete paper: https://tomesphere.com/paper/PMC12260164/full.md

---
Source: https://tomesphere.com/paper/PMC12260164