create_hazard_matrix_agetime: Create Matrix Selecting Instantaneous Hazard Rate

View source: R/model_prep.R

create_hazard_matrix_agetimeR Documentation

Create Matrix Selecting Instantaneous Hazard Rate

Description

Create a matrix selecting the instantaneous hazard rate needed for survival analysis by age and time. The option to include an additional stratification variable is also available, creating a 3D hazard function.

Usage

create_hazard_matrix_agetime(
  dat,
  areas,
  area_lev,
  subset = NULL,
  time1 = "time1",
  time2 = "time2",
  timecaps = c(1, Inf),
  Ntime = NULL,
  age = "age",
  Nage = NULL,
  strat = NULL,
  Nstrat = NULL,
  circ = "circ",
  aggregated = FALSE,
  weight = NULL
)

Arguments

dat

Shell dataset (datputted by create_shell_dataset with a row for every unique record in circumcision survey data for a given area. Also includes empirical estimates for circumcision estimates for each unique record.

areas

sf shapefiles for specific country/region.

area_lev

PSNU area level for specific country.

time1

Variable name for time of birth, Default: "time1"

time2

Variable name for time circumcised or censored, Default: "time2"

age
  • Variable with age circumcised or censored. Default: "age"

strat

Variable to stratify by in using a 3D hazard function, Default: NULL

circ

Variables with circumcision matrix, Default: "circ"

aggregated

agggregated = FALSE treats every area_id as its own object, allowing for the use of surveys for lower area hierarchies. aggregated = TRUE means we only look at area level of interest.

weight

variable to weigh circumcisions by when aggregating for lower area hierarchies (only applicable for aggregated = TRUE)

Value

Matrix for selecting instantaneous hazard rate.

See Also

create_shell_dataset


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