{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Example output from stroke outcome model\n", "\n", "In this notebook we provide an example of the output from the stroke outcome model assuming IVT is delivered at 90 mins and MT is delivered at 120 mins after stroke onset.\n", "\n", "The model provides a sample distribution of mRS scores for 1,000 patients." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load packages and data file" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "pycharm": { "name": "#%%\n" } }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import pandas as pd\n", "from outcome_utilities.clinical_outcome import Clinical_outcome\n", "\n", "import warnings\n", "warnings.filterwarnings(\"ignore\")\n", "\n", "# Load mRS distributions\n", "mrs_dists = pd.read_csv(\n", " './outcome_utilities/mrs_dist_probs_cumsum.csv', index_col='Stroke type')" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Set up MatPlotLib\n", "%matplotlib inline\n", "# Change default colour scheme:\n", "plt.style.use('seaborn-colorblind')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## View the loaded mRS distributions\n", "For each stroke type (by row) the the imported table shows the cumulative proportion of patients with each mRS score (0-6)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | 0 | \n", "1 | \n", "2 | \n", "3 | \n", "4 | \n", "5 | \n", "6 | \n", "
---|---|---|---|---|---|---|---|
Stroke type | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
pre_stroke_nlvo | \n", "0.582881 | \n", "0.745419 | \n", "0.848859 | \n", "0.951082 | \n", "0.993055 | \n", "1.000000 | \n", "1.0 | \n", "
pre_stroke_nlvo_ivt_deaths | \n", "0.576469 | \n", "0.737219 | \n", "0.839522 | \n", "0.940620 | \n", "0.982131 | \n", "0.989000 | \n", "1.0 | \n", "
pre_stroke_lvo | \n", "0.417894 | \n", "0.560853 | \n", "0.679283 | \n", "0.843494 | \n", "0.957269 | \n", "1.000000 | \n", "1.0 | \n", "
pre_stroke_lvo_ivt_deaths | \n", "0.403644 | \n", "0.541728 | \n", "0.656119 | \n", "0.814731 | \n", "0.924626 | \n", "0.965900 | \n", "1.0 | \n", "
pre_stroke_lvo_mt_deaths | \n", "0.401178 | \n", "0.538419 | \n", "0.652112 | \n", "0.809754 | \n", "0.918978 | \n", "0.960000 | \n", "1.0 | \n", "
no_treatment_nlvo | \n", "0.197144 | \n", "0.460000 | \n", "0.580032 | \n", "0.707768 | \n", "0.855677 | \n", "0.917702 | \n", "1.0 | \n", "
no_effect_nlvo_ivt_deaths | \n", "0.197271 | \n", "0.460000 | \n", "0.577583 | \n", "0.702252 | \n", "0.845244 | \n", "0.904454 | \n", "1.0 | \n", "
t0_treatment_nlvo_ivt | \n", "0.429808 | \n", "0.630000 | \n", "0.738212 | \n", "0.848427 | \n", "0.929188 | \n", "0.956300 | \n", "1.0 | \n", "
no_treatment_lvo | \n", "0.050000 | \n", "0.129000 | \n", "0.265000 | \n", "0.429000 | \n", "0.676000 | \n", "0.811000 | \n", "1.0 | \n", "
no_effect_lvo_ivt_deaths | \n", "0.047898 | \n", "0.123576 | \n", "0.253858 | \n", "0.410962 | \n", "0.647576 | \n", "0.776900 | \n", "1.0 | \n", "
no_effect_lvo_mt_deaths | \n", "0.047534 | \n", "0.122637 | \n", "0.251930 | \n", "0.407841 | \n", "0.642658 | \n", "0.771000 | \n", "1.0 | \n", "
t0_treatment_lvo_ivt | \n", "0.112916 | \n", "0.200000 | \n", "0.327377 | \n", "0.484757 | \n", "0.698212 | \n", "0.811443 | \n", "1.0 | \n", "
t0_treatment_lvo_mt | \n", "0.312767 | \n", "0.434474 | \n", "0.552066 | \n", "0.709276 | \n", "0.849898 | \n", "0.912750 | \n", "1.0 | \n", "