Skip to main content

Stroke modelling: outcome calculations with time to treatment.

Project description

Stroke outcome

GitHub Badge Jupyter Book Badge PyPI DOI

Toolkit for calculating patient outcomes after stroke depending on time to treatment.

➡️ Get started

This toolkit works with Python versions 3.8 and up.

Install the package with:

pip install stroke-outcome

And follow the links to the code demonstrations in the "External resources" section below.

🏥 Motivation in brief:

Disability levels may be measured in various ways. In this project we are using the modified Rankin Scale (mRS). It is a commonly used scale for measuring the degree of disability or dependence in the daily activities of people who have suffered a stroke. The scale runs from 0-6, running from perfect health without symptoms to death.

In addition to mRS, we may calculate utility-weighted mRS (UW-mRS). UW-mRS incorporates both treatment effect and patient perceived quality of life as a single outcome measure for stroke trials.

Patients with ischaemic stroke can be defined by the location of the clot: those with a large vessel occlusion (LVO); and those not with a large vessel occlusion (nLVO). Patients with an nLVO can be treated with thrombolysis (IVT), a clot-busting medication. Patients with an LVO can be treated with IVT and/or thrombectomy (MT), which physically removes the clot.

This method calculates disability outcome estimates for three patient-treatment cohorts:

  1. nLVO-IVT (patients with an nLVO that are treated with IVT),
  2. LVO-IVT (patients with an LVO that are treated with IVT),
  3. LVO-MT (patients with an LVO that are treated with MT).

The result is provided as a distribution of disability (with six levels) following reperfusion treatment at any point between these two time stages:

  1. receiving reperfusion treatment as soon as their stroke began (this will be referred to as time of stroke onset, and we will use the terminology “t = 0”), and
  2. receiving reperfusion treatment at the duration after stroke onset where the treatment has no effect (this will be referred to as time of no effect, and we will use the terminology “t = No Effect”).

The method is built by synthesising data from multiple sources to define the distribution of disability for each of the three patient-treatment cohorts at the two time stages (t = 0 & t = No Effect), and we use interpolation to determine the disability distribution at any point in between.

For more details, please see the online book.

📦 Package details:

The package includes the following data:

  • mRS cumulative probability distributions as derived in the online book.
  • A selection of utility scores for each mRS level.

Optionally, other data can be used instead of these provided files. The required formats are described in the continuous outcome demo.

The package includes the following processes:

  • Continuous outcomes: Each "patient" uses the average mRS across a population mRS probability distribution. The average mRS score may be any number between 0 and 6, for example 1.2.
  • Discrete outcomes: Each patient is given a single mRS score out of the population mRS probability distribution. The score must be a whole number from 0 to 6.

The following images summarise the differences between the methods:

Summary of continuous method. There is an mRS distribution when treated and an mRS distribution when not treated. The patient's mRS is the mean across the distribution. Summary of discrete method. There is an mRS distribution when treated and an mRS distribution when not treated. The patient's mRS is selected from whichever part of the distribution contains a fixed cumulative probability score.

📚 External resources

The following resources are not included within the package files and are accessible on the GitHub repository.

Each major aspect of the package has a demonstration and a documentation file. The demonstration is a minimal example of running the code, and the documentation uses a simple example to show the concepts behind the methods.

A conda environment file, environment.yml, is provided in the GitHub repository for use with the demonstration Jupyter notebooks.

Continuous outcomes Discrete outcomes
Demo Jupyter Notebook Jupyter Notebook
Docs Jupyter Notebook Jupyter Notebook

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stroke-outcome-0.1.6.tar.gz (35.7 kB view hashes)

Uploaded Source

Built Distribution

stroke_outcome-0.1.6-py3-none-any.whl (35.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page