Skip to contents

Summarises a prepped ego/sibling pair, optionally drops sibling reports that are missing survival status or sex, and assembles the returned list. Shared by prep_dhs_sib_histories, prep_nrsim_sib_histories and prep_mics_sib_histories so that the three preps cannot drift apart.

Usage

finalize_sib_prep(
  ego.dat,
  sib.dat,
  cur.survey,
  miss_col,
  resp.attrib,
  keep_missing = FALSE,
  keep_varmap_only = FALSE,
  verbose = TRUE
)

Arguments

ego.dat

the prepped ego dataset

sib.dat

the prepped sibling dataset

cur.survey

the survey id

miss_col

the list returned by check_varmap_cols()

resp.attrib

named vector of ego variables from the varmap, used by keep_varmap_only

keep_missing

see prep_dhs_sib_histories

keep_varmap_only

see prep_dhs_sib_histories

verbose

see prep_dhs_sib_histories

Value

a list with entries survey, ego.dat, sib.dat and summ

Details

Unless keep_missing = TRUE, three kinds of sibling report are dropped: those with unknown survival status, those with unknown sex, and those with no usable date of birth or no sampling weight. The last cannot be placed in an age group, so they contribute neither exposure nor events – and left in, a single one turns an entire exposure cell into NA, since the estimator sums over the cell.