prepare_survey_data: Prepare Survey Data

View source: R/prepare_survey_data.R

prepare_survey_dataR Documentation

Prepare Survey Data

Description

Prepare survey data required to run the circumcision model. Can also optionally apply normalise_weights_kish, to normalise survey weights and apply Kish coefficients.

Usage

prepare_survey_data(
  areas,
  survey_circumcision,
  survey_individuals = NULL,
  survey_clusters = NULL,
  area_lev,
  start_year = 2006,
  cens_year = NULL,
  cens_age = 59,
  rm_missing_type = FALSE,
  norm_kisk_weights = TRUE,
  strata.norm = c("survey_id", "area_id"),
  strata.kish = c("survey_id")
)

Arguments

areas

sf shapefiles for specific country/region.

survey_circumcision
  • Information on male circumcision status from surveys. If this is a list or contains more than one country, the function is performed for each country present, returning a list.

survey_individuals
  • Information on the individuals surveyed.

survey_clusters
  • Information on the survey clusters.

area_lev
  • Desired admin boundary level to perform the analysis on.

start_year
  • Year to begin the analysis on, Default: 2006

cens_year
  • Year to censor the circumcision data by (Sometimes some weirdness at the final survey year, e.g. v small number of MCs), Default: NULL

cens_age
  • Age to censor the circumcision data at, Default: 59

rm_missing_type
  • Indicator to decide whether you would like to keep surveys where there is no MMC/TMC disinction. These surveys may still be useful for determining MC levels, Default: FALSE

norm_kisk_weights
  • Indicator to decide whether to normalise survey weights and apply Kish coefficients, Default: TRUE

strata.norm

Stratification variables for normalising survey weights, Default: c("survey_id", "area_id")

strata.kish

Stratification variables for estimating and applying the Kish coefficients, Default: "survey_id"

Value

Survey data with required variables to run circumcision model.

See Also

normalise_weights_kish


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