Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHIPP tool integration #413

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open

SHIPP tool integration #413

wants to merge 69 commits into from

Conversation

rtesra
Copy link
Collaborator

@rtesra rtesra commented Nov 1, 2023

To do:

  • Add tests
  • Add function to update excel workbook with outputs from agyw_format_naomi()
  • Add scale to KP consensus estimates from KP workbook
  • Add scale to new infections estimates from KP workbook or Goals ASM database
  • Test workbook on multiple countries

@vimc-robot
Copy link

Thanks. Corresponding hintr PR at hivtools/hintr#478

R/agyw-integration.R Outdated Show resolved Hide resolved
@rtesra rtesra changed the title initial commit agyw tool integration Nov 10, 2023
R/car.R Outdated
@@ -74,7 +74,7 @@ scale_gmrf_precision <- function(Q,
A = matrix(1, ncol = ncol(Q)),
eps = sqrt(.Machine$double.eps)) {

nb <- spdep::mat2listw(abs(Q), style = "M")$neighbours
nb <- spdep::mat2listw(abs(Q), style = "B")$neighbours
Copy link
Contributor

Choose a reason for hiding this comment

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

Note I've updated this using Paddy's fix from #391 which should stop the huge amount of warnings. We can close that PR after this has been merged

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually tried that and it broke everything, just suppressing this warning on "M" for now as I can't find an equivalent to this which won't trigger a warning

R/agyw-integration.R Outdated Show resolved Hide resolved
R/agyw-integration.R Outdated Show resolved Hide resolved
@r-ash
Copy link
Contributor

r-ash commented Jan 24, 2024

On warnings in general, Ashton, Robert we should add a clearer error for if the workbook fails to generate. So far we have the following warnings/errors in place:
Error: If area hierarchy if Naomi inputs does not match any of external data inputs. Flags which area_ids are inconsistent and tells user to contact support.
Warning: (I'll add this in now) If KP consensus estimate is larger than 5% of matched population denominator. Tells user that default proportions will be used instead.
Error: If sum of disaggregated infections does not equal total infections - tells user to contact support. This shouldn't happen now that we flag the mismatched area_ids at the start but left it for edge cases (who knows).

Errors sounds good, I will add some specific error handling into the excel file generation to return a nicer message should this fail.

Note about the warnings, these are not surfaced at the moment for downloads. So fine to add these here if you want but users won't see them until we add some specific handling for this in the front end. It will require a new endpoint in hintr to get these surfaced.

In general also after seeing the other warnings I am reluctant to use them. I think people have been trained to ignore the warnings.

That said, see the note above about a few floating calls to t_ which I think you want to wrap in a warning?

r-ash and others added 16 commits January 24, 2024 15:22
add placeholder for incidence adjustment code
Added KP adjustment to incidence estimates to match Spectrum KP new infection estimates for women & men - results in updated estimates of incidence for other behavioural groups as well
- Align SHIPP vignette with the methods used
- Minor code fixes for adjusting KP new infections to either KP workbook or Goals estimates under the assumption that a consensus KP new infection estimate is never missing
@rtesra rtesra changed the title agyw tool integration SHIPP tool integration Feb 21, 2024
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.

6 participants