Skip to content

Overhaul severe and mortality outcomes#8

Open
pwinskill wants to merge 8 commits intomainfrom
severe_inc
Open

Overhaul severe and mortality outcomes#8
pwinskill wants to merge 8 commits intomainfrom
severe_inc

Conversation

@pwinskill
Copy link
Copy Markdown
Member

@pwinskill pwinskill commented May 7, 2025

Aim: to make assumptions about severe treatment (hospitalisation) coverage and resulting probability of death more transparent and flexible.

The refactor replaces the hard‑wired Griffin‑2016 shortcut, where all malaria deaths were simply taken as 0.215 times the modelled incidence of hospital‑treated severe cases, with an explicit two‑stream calculation that first separates severe episodes into hospital and community compartments, then applies setting‑specific case‑fatality ratios to each stream. A new column, ft_sev, lets users supply (and vary over time) the proportion of severe cases that reach hospital. A warning‑backed default of 0.8 preserves backward compatibility - when this default is used the original 0.215 deaths‑to‑hospitalised‑cases ratio is recovered.

The flow is as follows:

  1. Estimate total severe inc based on original parameterisation from Griffen et al (2016) outputting hospitalised severe malaria inc, with an assummed 80% of severe cases hospitalised.
  2. Split total severe inc into hospitalised and community severe inc based on user-specified (or default) ft_sev parameter that defines the proportion of severe cases that are hospitalised.
  3. Rescale severe incidence metrics to account for the impact of first-line treatment reducing progression to severe.
  4. Use hospital and community-specific severe case fatality rates to convert to mortality.

The same treatment‑coverage multiplier that used to be applied is still applied to both severe streams before mortality is derived, making the algebra transparent and allowing referral improvements to be explored independently of first‑line treatment scale‑up.

image

Adding derivation of the 80% for reference

Let
mH = severe case fatality hospital: 0.065
mC= severe case fatality community: 0.6
λH= severe incidence hospital
λC= severe incidence community
ν = scaling factor linking hospitalised severe incidence to total malaria deaths: 0.215

Total deaths (predicted two ways) are:

image

Solving for the ratio of non‑hospitalised to hospitalised severe cases gives:
image

Coverage (ρ): the share of severe episodes treated in hospital, is therefore:
image

Which = 80%

Comment thread R/epi.R Outdated
Comment thread R/epi.R Outdated
Comment thread R/rates.R Outdated
Comment thread R/epi.R Outdated
Comment thread R/rates.R

rates <- x |>
dplyr::select(dplyr::all_of(c("timestep", "ft", clinical_cols, severe_cols, denominator_cols))) |>
dplyr::select(dplyr::all_of(c("timestep", "ft", "ft_sev", clinical_cols, severe_cols, denominator_cols))) |>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will the ft_sev be defined? I can see it gets set to 0.8 in the absence of other inputs, but would it be anticipated to be an output of malaria simulation? Or is it possible to input it as a parameter in get_rates (I may have misunderstood!)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it means you can assign the proportion quite flexibly and through time, but it just means that it needs to be done actively before the get_rates function is called, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, yes, the user can specify the ft_sev column prior to running get rates manual if they so wish, if not, it will default to the 0.8.

pwinskill and others added 4 commits June 13, 2025 14:05
…n-downscaled) severe inc was lost, and simplified algebra
Co-authored-by: RJSheppard <73181123+RJSheppard@users.noreply.github.com>
Co-authored-by: RJSheppard <73181123+RJSheppard@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 22, 2025

Codecov Report

❌ Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.69%. Comparing base (50c7756) to head (1335cf7).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
R/rates.R 85.71% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main       #8       +/-   ##
===========================================
- Coverage   98.37%   87.69%   -10.69%     
===========================================
  Files           5        6        +1     
  Lines         123      195       +72     
===========================================
+ Hits          121      171       +50     
- Misses          2       24       +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants