Skip to content

Comments

2025/2026 SHIPP update#39

Open
rtesra wants to merge 17 commits intomasterfrom
2025-shipp-update
Open

2025/2026 SHIPP update#39
rtesra wants to merge 17 commits intomasterfrom
2025-shipp-update

Conversation

@rtesra
Copy link
Contributor

@rtesra rtesra commented Nov 24, 2025

Updates to SHIPP calculations after 2025/2026 survey update:

  • Fix for KP new infections exceeding new infections in a given age/district
  • Fix for PSE for KPs exceeding size of non-regular partners group
  • Add survey_year included in generate_shipp_tool call

Updates to SHIPP calculations to separate KPs from elevated risk group:

Adapted shipp_combine_cats_female() to replace 'elevrisk' group with 'sexnonkp and 'kp' group:

  • Calculate new variables for non-KP risk group (combining sexcohab and sexnonreg)
  • No need to create new KP group as single female KP group
  • Corrected denominator error - to check with @krisher1
  • Calculated low, mod, high and v.high incidence risk groups for:
    • Non-KP total: sexcohab + sexnonreg
    • Non-KP: One cohabiting partner (sexcohab)
    • Non-KP: Non-regular partner
    • KP: FSW (sexpaid12m)

Adapted shipp_combine_cats_male() to replace 'elevrisk' group with 'sexnonkp and 'kp' group:

  • Calculate new variables for non-KP risk group (combining sexcohab and sexnonreg)

  • Calculate new variables for KP risk group (combining pwid and msm)

  • Calculated low, mod, high and v.high incidence risk groups for:

    • Non-KP total: sexcohab + sexnonreg
    • Non-KP: One cohabiting partner (sexcohab)
    • Non-KP: Non-regular partner
    • KP: PWID + MSM

Add fixes for:
-KP new infections exceeding new infections in a given age/district
-PSE for KPs exceeding size of non-regular partners group
-survey_year included in call
@rtesra rtesra changed the title Update SHIPP template with 2025 survey update Fixes for 2025 survey update Nov 24, 2025
@rtesra rtesra changed the title Fixes for 2025 survey update 2025/2026 SHIPP update Jan 2, 2026
@rtesra rtesra requested review from jeffeaton, krisher1 and r-ash January 5, 2026 07:26
Copy link
Collaborator

@jeffeaton jeffeaton left a comment

Choose a reason for hiding this comment

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

Thanks very much -- I've done a couple of formatting PRs, mostly for standardizing white space around operators.

See a few questions and comments; nothing substantive.

Comment on lines +8 to +9
Year set to year of most recent survey with sexual risk behaviour data and to 2018 for countries where
most recent sexual risk behaviour survey is older that 2018.
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the rationale for specifying this as 2018 for earlier surveys rather than the year of the survey? [Not suggesting a change, just a question for interest and clarification.]

R/shipp.R Outdated
Comment on lines 1143 to 1157
survey_year = 2018,
survey_year = 2022,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The NEWS.md refers to default survey year being set to 2018, but here in the code 2018 is changed to 2022. Is that referring to the same thing, or is this different from the changes about default year referenced in the NEWS bullet?

R/shipp.R Outdated
Comment on lines 1393 to 1446
survey_year = 2018,
survey_year = 2022,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as previous question about 2018 vs. 2022 in NEWS

R/shipp.R Outdated
Comment on lines 1806 to 1807
incidence_sexnonkp = ((incidence_sexnonreg * susceptible_sexnonreg) +
(incidence_sexcohab * susceptible_sexcohab)) / susceptible_sexnonkp,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this be equivalently calculated as

incidence_sexnonkp = infections_sexnonkp / susceptible_sexnonkp

?

Might prefer that for clarity if that's correct

R/shipp.R Outdated
Comment on lines 1810 to 1840
# Non-KP total: sexcohab + sexnonreg
pop_low_inc_nonkp = ifelse(incidence_sexnonkp < 0.002, susceptible_sexnonkp, 0.0),
pop_mod_inc_nonkp = ifelse(incidence_sexnonkp >= 0.002 & incidence_sexnonkp < 0.005,
susceptible_sexnonkp, 0.0),
pop_high_inc_nonkp = ifelse(incidence_sexnonkp >= 0.005 & incidence_sexnonkp < 0.02,
susceptible_sexnonkp, 0.0),
pop_vhigh_inc_nonkp = ifelse(incidence_sexnonkp >= 0.02, susceptible_sexnonkp, 0),

# KP: FSW (sexpaid12m)
pop_low_inc_kp = ifelse(incidence_sexpaid12m < 0.002, susceptible_sexpaid12m, 0.0),
pop_mod_inc_kp = ifelse(incidence_sexpaid12m >= 0.002 & incidence_sexpaid12m < 0.005,
susceptible_sexpaid12m, 0.0),
pop_high_inc_kp = ifelse(incidence_sexpaid12m >= 0.005 & incidence_sexpaid12m < 0.02,
susceptible_sexpaid12m, 0.0),
pop_vhigh_inc_kp = ifelse(incidence_sexpaid12m >= 0.02, susceptible_sexpaid12m, 0.0),

# Non-KP: One cohabiting partner (sexcohab)
pop_low_inc_cohab = ifelse(incidence_sexcohab < 0.002, susceptible_sexcohab, 0.0),
pop_mod_inc_cohab = ifelse(incidence_sexcohab >= 0.002 & incidence_sexcohab < 0.005,
susceptible_sexcohab, 0.0),
pop_high_inc_cohab = ifelse(incidence_sexcohab >= 0.005 & incidence_sexcohab < 0.02,
susceptible_sexcohab, 0.0),
pop_vhigh_inc_cohab = ifelse(incidence_sexcohab >= 0.02, susceptible_sexcohab, 0.0),

# Non-KP: Non-regular partner
pop_low_inc_sexnonreg = ifelse(incidence_sexnonreg < 0.002, susceptible_sexnonreg, 0.0),
pop_mod_inc_sexnonreg = ifelse(incidence_sexnonreg >= 0.002 & incidence_sexnonreg < 0.005,
susceptible_sexnonreg, 0.0),
pop_high_inc_sexnonreg = ifelse(incidence_sexnonreg >= 0.005 & incidence_sexnonreg < 0.02,
susceptible_sexnonreg, 0.0),
pop_vhigh_inc_sexnonreg = ifelse(incidence_sexnonreg >= 0.02, susceptible_sexnonreg, 0.0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the source and importance of the 0.002, 0.005, and 0.02 magic numbers in the code block below? Are those the incidence threshold categories specified by UNAIDS?

Can we add a comment at the top of this block describing what those numbers are?
And perhaps ideally code those once to variables and reuse the variable name throughout the code below.

R/shipp.R Outdated
Comment on lines 1923 to 1924
incidence_sexnonkp = ((incidence_sexnonreg * susceptible_sexnonreg) +
(incidence_sexcohab* susceptible_sexcohab))/susceptible_sexnonkp,
Copy link
Collaborator

Choose a reason for hiding this comment

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

See comment above -- about whether this can be simplified using the infections_sexnonkp created on the previous line.

R/shipp.R Outdated

# Create new variables for population sizes by incidence category

# Non-KP total: sexcohab + sexnonreg
Copy link
Collaborator

Choose a reason for hiding this comment

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

See comment above about changing magic numbers to variable.

rtesra added 2 commits January 7, 2026 11:48
Update to sum pop groups by risk category by 5-year age band
prev_sexnonreg = plhiv_sexnonreg/(susceptible_sexnonreg + plhiv_sexnonreg),
prev_sexpaid12m = plhiv_sexpaid12m/(susceptible_sexpaid12m + plhiv_sexpaid12m),
rr_sexpaid12m = NA)
rr_sexpaid12m = incidence_sexpaid12m/incidence_sexcohab)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@krisher1 RR calculated here for combined age categories

@@ -1910,11 +1953,25 @@ shipp_combine_cats_female <- function(age_filter, shipp, naomi_output) {

shipp_combine_cats_male <- function(age_filter, shipp, naomi_output) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@krisher1 Updated to sum population groups from 5-year age bands

rtesra and others added 2 commits January 8, 2026 12:16
Updated risk population sums
-Input consensus_est = NA if not using Goals or KP Workbooks for the KP new infections
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.

3 participants