Select data for model fitting

select_naomi_data(
  naomi_mf,
  survey_hiv_indicators,
  anc_testing,
  art_number,
  prev_survey_ids,
  artcov_survey_ids,
  recent_survey_ids,
  vls_survey_ids = NULL,
  artnum_calendar_quarter_t1 = naomi_mf[["calendar_quarter1"]],
  artnum_calendar_quarter_t2 = naomi_mf[["calendar_quarter2"]],
  anc_clients_year_t2 =
    year_labels(calendar_quarter_to_quarter_id(naomi_mf[["calendar_quarter2"]])),
  anc_clients_year_t2_num_months = 12,
  anc_prev_year_t1 =
    year_labels(calendar_quarter_to_quarter_id(naomi_mf[["calendar_quarter1"]])),
  anc_prev_year_t2 =
    year_labels(calendar_quarter_to_quarter_id(naomi_mf[["calendar_quarter2"]])),
  anc_artcov_year_t1 = anc_prev_year_t1,
  anc_artcov_year_t2 = anc_prev_year_t2,
  use_kish_prev = TRUE,
  deff_prev = 1,
  use_kish_artcov = TRUE,
  deff_artcov = 1,
  use_kish_recent = TRUE,
  deff_recent = 1,
  use_kish_vls = TRUE,
  deff_vls = 1,
  use_survey_aggregate = FALSE,
  spec_program_data = NULL
)

Arguments

naomi_mf

A Naomi model frame object.

survey_hiv_indicators

Data frame of survey estimates, or NULL to exclude any survey data.

anc_testing

Data frame of ANC routine testing outcomes, or NULL to exclude any ANC data.

art_number

Data frame of number currently receiving ART, or NULL to exclude any ART data.

prev_survey_ids

A character vector of survey_ids for prevalence data.

artcov_survey_ids

A character vector of survey_ids for ART coverage data.

recent_survey_ids

A character vector of survey_ids for recent HIV infection status.

vls_survey_ids

A character vector of survey_ids for survey VLS among all HIV+ persons.

artnum_calendar_quarter_t1

Calendar quarter for first time point for number on ART.

artnum_calendar_quarter_t2

Calendar quarter for second time point for number on ART.

anc_clients_year_t2

Calendar year (possibly multiple) for number of ANC clients at year 2.

anc_prev_year_t1

Calendar year (possibly multiple) for first time point for ANC prevalence.

anc_prev_year_t2

Calendar year (possibly multiple) for second time point for ANC prevalence.

anc_artcov_year_t1

Calendar year (possibly multiple) for first time point for ANC ART coverage.

anc_artcov_year_t2

Calendar year (possibly multiple) for second time point for ANC ART coverage.

deff_prev

Approximate design effect for survey prevalence.

deff_artcov

Approximate design effect for survey ART coverage.

deff_recent

Approximate design effect for survey proportion recently infected.

deff_vls

Approximate design effect for survey viral load suppression.

spec_program_data

Object of class "spec_program_data" consisting of aggregated program data inputs to Spectrum. Provided for checking against Naomi inputs. If NULL then checks are not conducted.

anc_clients_year_t2_num_monhts

Number of months of reporting reflected in the year(s) recorded in anc_clients_year_t2.

Details

See example datasets for examples of required template for data sets. *_survey_ids must be reflected in survey_hiv_indicators.

ART coverage and VLS survey data should not be included from the same survey. This is checked by the function call and will throw an error.

The deff_* arguments are approximate design effects used to scale the effective sample size for survey observations. Stratified design effects are will not be the same as full survey DEFF and there is not a straightforward way to approximate these.

The option use_aggregate_survey = TRUE allows for aggregate versions of survey data to be used in model fitting, for example age 15-49 prevalence instead of five-year age group prevalence or province-level survey data instead of district level data. This maybe useful if cluster coordinates or survey microdata are not available. This option assumes that the survey_hiv_indicators is alreaddy subsetted to exactly the data to be used. All stratifications must also appear in the naomi_data$mf_out stratifications.