shared tail of the sibling-history prep functions
finalize_sib_prep.RdSummarises 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
- keep_varmap_only
- verbose
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.