threemc_ppc2: Posterior Predictive Distribution and checks on OOS survey

View source: R/ppc_2.R

threemc_ppc2R Documentation

Posterior Predictive Distribution and checks on OOS survey

Description

Aggregate specified numeric columns by population-weighted age groups (rather than single year ages), split by specified categories. Using an alternative method to previously.

Usage

threemc_ppc2(
  fit,
  out,
  survey_circumcision_test,
  areas = NULL,
  area_lev = 1,
  age_groups = c("0-4", "5-9", "10-14", "15-19", "20-24", "25-29", "30-34", "35-39",
    "40-44", "45-49", "50-54", "54-59"),
  N = 1000,
  seed = 123
)

Arguments

fit

Fit object returned by naomi::sample_tmb, which includes, among other things, the optimised parameters and subsequent sample for our TMB model.

out

Results of model fitting (at specified model area_lev) outputted by compute_quantiles.

survey_circumcision_test

survey_circumcision dataset loaded with read_circ_data. Do not preprocess with prepare_survey_data If performing an OOS validation of model performance, you should filter this dataset for the years "held back" from your model fit.

areas

sf shapefile for specific country/region. Only required if survey_circumcision_test has records for area levels higher (i.e. more granular) than area_lev, in which case they must be reassigned to their parent_area_id at area_lev, Default = NULL.

area_lev

Area level you wish to aggregate to when performing posterior predictive comparisons with survey estimates.

age_groups

Age groups to aggregate by, Default: c("0-4", "5-9", "10-14", "15-19", "20-24", "25-29", "30-34", "35-39", "40-44", "45-49", "50-54", "54-59")

N

Number of samples to generate, Default: 1000

seed

Random seed used for taking binomial sample from posterior predictive distribution.

type

Decides type of circumcision coverage to perform PPC on, must be one of "MC", "MMC", or "TMC", Default = "MMC"

CI_range

CI interval about which you want to compare empirical and posterior predictive estimates for left out surveys, Default = c(0.5, 0.8, 0.95)

Value

data.frame with samples aggregated by aggr_cols and weighted by population.


mrc-ide/threemc documentation built on Feb. 9, 2024, 5:16 p.m.