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

Duplicated reporting test on ART input data should also check for duplicated sex or age group reporting #195

Open
3 tasks
jeffeaton opened this issue Dec 10, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@jeffeaton
Copy link
Collaborator

This code checks to see if ART data has been multiply entered for an area_id, for example entered at the district level and also at the provincial level:

naomi/R/model.R

Lines 1140 to 1147 in a69325b

## Check no areas with duplicated reporting
art_duplicated_check <- dat %>%
dplyr::left_join(
naomi_mf$area_aggregation,
by = "area_id"
) %>%
dplyr::count(model_area_id, age_group, sex, calendar_quarter) %>%
dplyr::filter(n > 1)

It should also check if a sex or age group has been duplicated. For example, data should not be entered for both male/female and both sexes in a particular age group, or for age 15+ and all ages.

  • Expand check for sex and age dimensions
  • This check should also be applied to ANC testing data now
  • This check should be performed as part of input data validation, not at model fitting step.

I recall writing some code that does that check...but I can't remember where and I can't think of where it would be if not in this ART input data validation.


Reproducible example: this error of both male/female and both reporting in the Zimbabwe datasets should be identified:

setwd("~/Imperial College London/Naomi Support - WP - General/7/")

source("../debug-functions.R")
jobid <- "b64d9f9f0133fb63e4f6049a76cb1090"

devtools::load_all("~/Downloads/naomi")

inp <- hintr_inputs_ready(jobid)

data <- format_data_input(inp$data)
options <- format_options(inp$options)
validate_model_options(data, options)

naomi_data <- naomi_prepare_data(data, options)

This throws a different error right now. But it should error for the inputs issue. And ideally error on validate_model_options().

@jeffeaton jeffeaton added the enhancement New feature or request label Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant