From 538c864c7a75c67c783905e9d8f20a78214926d5 Mon Sep 17 00:00:00 2001 From: jeffeaton Date: Thu, 25 Jul 2024 17:39:33 +0100 Subject: [PATCH] adjust art_dropout to annualised rate --- NEWS.md | 4 ++++ R/spectrum.R | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 7c91cd0..d623d9a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -13,6 +13,10 @@ This has modest overall difference, but was a source of numerical differences between Spectrum and EPP-ASM. + +* Patch ART dropout implementation. Spectrum converts input ART dropout percent to an + annual rate using [dropout rate] = -log(1.0 - [input percent]). + ## eppasm 0.7.6 diff --git a/R/spectrum.R b/R/spectrum.R index c37e3f6..9d1a0b7 100644 --- a/R/spectrum.R +++ b/R/spectrum.R @@ -220,8 +220,10 @@ create_spectrum_fixpar <- function(projp, demp, hiv_steps_per_year = 10L, proj_s } else { fp$art_dropout_recover_cd4 <- art_dropout_recover_cd4 } - - fp$art_dropout <- projp$art_dropout[as.character(proj_start:proj_end)]/100 + + ## Convert input percent dropout in 12 months to an annual rate (Rob Glaubius email 25 July 2024) + fp$art_dropout <- -log(1.0 - projp$art_dropout[as.character(proj_start:proj_end)]/100) + fp$median_cd4init <- projp$median_cd4init[as.character(proj_start:proj_end)] fp$med_cd4init_input <- as.integer(fp$median_cd4init > 0) fp$med_cd4init_cat <- replace(findInterval(-fp$median_cd4init, - c(1000, 500, 350, 250, 200, 100, 50)),