| Title: | Harmonized Orphanhood Mortality Estimation |
|---|---|
| Description: | Implements indirect methods for estimating adult mortality from orphanhood data: the Brass and Hill (1973) method, the regression-based method of Timaeus (1992) <https://pubmed.ncbi.nlm.nih.gov/12317481/>, and the extended orphanhood method of Luy (2012) <doi:10.1007/s13524-012-0101-4> for low-mortality populations. Besides the coefficients published by Luy for Italy, the package derives context-specific coefficients (weighting factors, reference-period parameters and the conversion of the mean age at childbearing of surviving parents to that of all parents) for any population and survey date from user-supplied period fertility, population, cohort mortality and period life table data, following the procedure of Luy (2009) <https://www.oeaw.ac.at/fileadmin/subsites/Institute/VID/PDF/Publications/EDRP/edrp_2009_03.pdf>. Estimates are harmonized into comparable adult mortality indicators (30q30, 45q15 and e30) with a relational logit model, and diagnostic tools assess the sensitivity of results to the mean age at childbearing and to the choice of model life table family. |
| Authors: | Tamara Vaz [aut, cre] |
| Maintainer: | Tamara Vaz <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.2 |
| Built: | 2026-10-09 19:44:52 UTC |
| Source: | https://github.com/tamaravaz/home |
Opens the interactive dashboard for indirect adult mortality estimation
using the orphanhood-based methods implemented in the HOME package.
The application provides a graphical interface to om_estimate_index,
om_plot_linearity, om_sensitivity_Mn, and
om_sensitivity_modelLT.
app_HOME()app_HOME()
The Shiny application is located in inst/shiny/home_app/ and is
launched via shiny::runApp(). An active R session with the
shiny, bslib, ggplot2, plotly, DT,
readxl, and writexl packages is required; these are listed
under Suggests in the package DESCRIPTION file.
This function is called for its side effect of launching a Shiny
application. It does not return a meaningful value; the return value of
shiny::runApp() is returned invisibly.
om_estimate_index for the underlying estimation
function.
if (interactive()) { app_HOME() }if (interactive()) { app_HOME() }
Derives population-specific weighting factors , reference-date
parameters , and the surviving-parent to all-parent
mean-age conversion for the Luy orphanhood method, reproducing the
calculation workbooks behind Luy (2009, 2010 supplement) and Luy (2012).
om_calibrate_luy( sex_parent, asfr, cohort_qx, pop_age = NULL, survey_date, age_respondent = seq(20, 60, by = 5), mean_age_grid = NULL, period_lx = NULL, weighting = c("Nf", "f"), mixing = c("luy", "exact"), smoothing = c("graphical", "lsq"), cohort_lag = 4, male_shift = 4, age_range = NULL, s_factors = seq(0.5, 1.5, by = 0.05) )om_calibrate_luy( sex_parent, asfr, cohort_qx, pop_age = NULL, survey_date, age_respondent = seq(20, 60, by = 5), mean_age_grid = NULL, period_lx = NULL, weighting = c("Nf", "f"), mixing = c("luy", "exact"), smoothing = c("graphical", "lsq"), cohort_lag = 4, male_shift = 4, age_range = NULL, s_factors = seq(0.5, 1.5, by = 0.05) )
sex_parent |
Character. |
asfr |
Data frame of period age-specific fertility rates of
women. Required columns: |
cohort_qx |
Data frame of cohort probabilities of dying of
the parent's sex. Required columns: |
pop_age |
Data frame of population size (not exposure) of
the parent's sex. Optional; if provided, requires columns |
survey_date |
Numeric. Interview date as a decimal year ( |
age_respondent |
Numeric vector of respondent age group lower bounds. |
mean_age_grid |
Numeric vector of (integer) mean ages at childbearing. Defaults to 22:35 (mothers) and 24:37 (fathers), as in Luy. |
period_lx |
Optional data frame of period life tables of
the parent's sex, columns |
weighting |
|
mixing |
|
smoothing |
|
cohort_lag |
Integer, default 4 (Luy 2009). Years subtracted, in
addition to |
male_shift |
Numeric. Years by which female ASFR are shifted to obtain paternal schedules (Luy: 4). |
age_range |
Numeric length-2 vector, youngest and oldest parental age.
Defaults to |
s_factors |
Numeric vector of multipliers applied to the model
|
For each respondent age group (exposure years) and
each target mean age at childbearing :
The empirical ASFR of the respondents' five birth years is averaged
and summarised by Schmertmann's graphical parameters (,
, , ; fathers: rates shifted by
male_shift years, ). The quadratic-spline
schedule is moved to – measured as – by stepping , and fine-tuning with the
Brass relational Gompertz model.
The parental cohorts' probabilities of dying are averaged with
fixed weights and chained into a survival curve ;
.
is the mean time before the survey of the reconstructed
deaths; the reference period is .
.
, come from regressing on
across logit-relevelled mortality scenarios.
Weights. weighting = "Nf" (default) uses as in the 2010 supplement and in the package's built-in
coefficients; "f" uses as in Luy (2009).
Mixing. mixing = "luy" (default) averages the
probabilities of dying with weights fixed at the respondents' birth, as
Luy's workbooks do. "exact" mixes the cohort survival curves,
, which is the demographically exact proportion of
parents alive; the two diverge strongly at older respondent ages, so only
"luy" reproduces the published tables.
Parental cohorts (cohort_lag). Respondents aged
to at the survey were born in the five calendar years
to .
Luy (2009, pp. 10 and 16) approximates their parents by the parents who
gave birth in the middle of these five years, ; in his calculation workbooks a parent aged (completed
years) at that birth belongs to the cohort born in . Hence the parental cohort is
and is the probability of dying of cohort
at age , i.e. in calendar year , for with (Luy
2009, p. 10: exposure of years plus the time of the
interview within the survey year).
Unobserved ages. No closure rule is applied to the cohort
series. A probability of dying that is not in cohort_qx (e.g. ages
beyond the last age of a cohort's table, such as the open interval
110+) is kept as NA and gets no weight: in each year
the weighted average of the probabilities of dying is taken over the
cohorts observed in that year,
with (mixing = "luy") or (mixing = "exact"). This distinguishes the absence of
observations from a probability of dying of 0 and prevents unobserved
ages from contributing to the calculation. Luy's workbooks filled these
cells with (1998 survey) or (2003 survey). If no
parental cohort is observed in some year (data that end before
the calendar year ), , ,
and are NA. The share of the weights
observed in each year is returned in the intermediates
(om_luy_intermediates(cal, "w_observed")). In a complete cohort
life table the last, open age interval (e.g. 110+) has : the
cohort is extinct and no older age is needed.
How closely Luy is reproduced. Fed with Luy's own schedules and
cohort probabilities, the calculation reproduces his published
(Luy 2009) to within about 1% and his reference periods
exactly. Run on independent data (e.g. HMD/HFD for Italy), the
differences from the built-in tables are below about 1% up to
, a few per cent at –55 and larger at
, where Luy's values depend on how he filled the ages after
the end of the cohort series (see above) and on his source tables ending
around age 100. Treat the coefficients with caution.
Mean age of all vs. surviving parents. The tables are indexed by
the mean age at childbearing of all parents. If your survey only
records the parent's age for living parents, convert it first with the
returned mac table (survivors' mean in the column header, all
parents' mean in the cells), as Luy does with his Tables A.5-A.8.
A named list with elements "Female" and "Male";
the one matching sex_parent holds a list of four data frames
(the other is NULL). Each data frame has one row per respondent
age group (column Age_Group = ) and one column per mean
age at childbearing in mean_age_grid (named "22",
"23", ...), the layout of the built-in coefficients, so that the
result can be passed to custom_coef_luy in
om_estimate_index:
wnweighting factors , with
(Luy 2009, eq. 1; Tables A.9–A.12).
an, bn
reference-period parameters, with
years before the survey (Luy
2009, Tables A.13–A.20).
macmean age at childbirth of all parents (cells) given the mean age of surviving parents (column names) (Luy 2009, Tables A.5–A.8).
NA marks cells that could not be computed (see the warnings).
Attributes:
diagnosticsdata frame, one row per age group and mean
age: Age_Group, mean_age, model survival
S_model, reference year ref_year, t_n,
W, Brass-Gompertz gompertz_alpha, Schmertmann
P and H, and weight_dropped (share of the
weights of parental cohorts absent from cohort_qx).
intermediateslist by age group with every intermediate
quantity of the calculation, laid out like Luy's workbooks; extract
with om_luy_intermediates.
settingslist of the arguments used.
Luy, M. (2009). Estimating mortality differentials in developed populations from survey information on maternal and paternal orphanhood. European Demographic Research Papers 2009-3; supplement, August 2010.
Luy, M. (2012). Estimating mortality differences in developed countries from survey information on maternal and paternal orphanhood. Demography, 49(2), 607-627.
Schmertmann, C. P. (2003). A system of model fertility schedules with graphically intuitive parameters. Demographic Research, 9(5), 81-110.
om_estimate_index, om_luy_intermediates,
om_luy_data_needs
# synthetic inputs in the standard long format asfr <- expand.grid(age = 15:49, year = 1950:2000) asfr$rate <- 0.1 * exp(-0.5 * ((asfr$age - 28) / 5.5)^2) cohort_qx <- expand.grid(age = 0:110, cohort = 1900:1990) cohort_qx$qx <- pmin(1, 0.00005 * exp(0.095 * cohort_qx$age)) cohort_qx <- cohort_qx[cohort_qx$cohort + cohort_qx$age <= 2003, ] pop_age <- expand.grid(age = 0:110, year = 1950:2000) pop_age$n <- 1e5 * exp(-0.01 * pop_age$age) period_lx <- expand.grid(age = 0:110, year = 1980:2003) period_lx$lx <- 1e5 * exp(-0.00005 / 0.095 * (exp(0.095 * period_lx$age) - 1)) cal <- om_calibrate_luy("Female", asfr = asfr, cohort_qx = cohort_qx, pop_age = pop_age, period_lx = period_lx, survey_date = 2003.9, age_respondent = c(20, 40)) cal$Female$wn # W(n) cal$Female$mac # mean age of all parents given that of surviving parents # use the coefficients in the estimation est <- om_estimate_index(method = "luy", sex_parent = "Female", age_respondent = c(20, 40), p_surv = c(0.95, 0.75), mean_age_parent = 27, surv_date = 2003.9, custom_coef_luy = cal) est$estimates# synthetic inputs in the standard long format asfr <- expand.grid(age = 15:49, year = 1950:2000) asfr$rate <- 0.1 * exp(-0.5 * ((asfr$age - 28) / 5.5)^2) cohort_qx <- expand.grid(age = 0:110, cohort = 1900:1990) cohort_qx$qx <- pmin(1, 0.00005 * exp(0.095 * cohort_qx$age)) cohort_qx <- cohort_qx[cohort_qx$cohort + cohort_qx$age <= 2003, ] pop_age <- expand.grid(age = 0:110, year = 1950:2000) pop_age$n <- 1e5 * exp(-0.01 * pop_age$age) period_lx <- expand.grid(age = 0:110, year = 1980:2003) period_lx$lx <- 1e5 * exp(-0.00005 / 0.095 * (exp(0.095 * period_lx$age) - 1)) cal <- om_calibrate_luy("Female", asfr = asfr, cohort_qx = cohort_qx, pop_age = pop_age, period_lx = period_lx, survey_date = 2003.9, age_respondent = c(20, 40)) cal$Female$wn # W(n) cal$Female$mac # mean age of all parents given that of surviving parents # use the coefficients in the estimation est <- om_estimate_index(method = "luy", sex_parent = "Female", age_respondent = c(20, 40), p_surv = c(0.95, 0.75), mean_age_parent = 27, surv_date = 2003.9, custom_coef_luy = cal) est$estimates
Produces a three-panel diagnostic display combining the internal consistency check with sensitivity analyses for mean age of childbearing and model life table family.
om_dashboard( object, index = "30q30", family_type = "UN", range_m = seq(-1.5, 1.5, 0.5) )om_dashboard( object, index = "30q30", family_type = "UN", range_m = seq(-1.5, 1.5, 0.5) )
object |
An object of class |
index |
Character. Mortality index to display in sensitivity panels.
One of |
family_type |
Character. Life table family system for the family
sensitivity panel. One of |
range_m |
Numeric vector. Offsets applied to the mean age of
childbearing. Default: |
Invisibly returns the gtable object produced by
gridExtra::grid.arrange().
om_plot_linearity,
om_sensitivity_Mn,
om_sensitivity_modelLT
result <- om_estimate_index( method = "luy", sex_parent = "Female", age_respondent = seq(20, 60, by = 5), p_surv = c(0.987, 0.967, 0.934, 0.908, 0.882, 0.835, 0.769, 0.669, 0.565), mean_age_parent = rep(27, 9), surv_date = 1998.5 ) om_dashboard(result, index = "30q30", family_type = "UN")result <- om_estimate_index( method = "luy", sex_parent = "Female", age_respondent = seq(20, 60, by = 5), p_surv = c(0.987, 0.967, 0.934, 0.908, 0.882, 0.835, 0.769, 0.669, 0.565), mean_age_parent = rep(27, 9), surv_date = 1998.5 ) om_dashboard(result, index = "30q30", family_type = "UN")
Estimates conditional survivorship probabilities using orphanhood methods and harmonizes them into common adult mortality indices using a one-parameter relational logit model.
om_estimate_index( method = c("luy", "timaeus", "brass"), sex_parent = c("Female", "Male"), age_respondent, p_surv, mean_age_parent, surv_date, num_respondents = NULL, model_family = "General", e0 = 60, custom_coef_luy = NULL )om_estimate_index( method = c("luy", "timaeus", "brass"), sex_parent = c("Female", "Male"), age_respondent, p_surv, mean_age_parent, surv_date, num_respondents = NULL, model_family = "General", e0 = 60, custom_coef_luy = NULL )
method |
Character. Estimation method. One of |
sex_parent |
Character. Sex of the parent. One of |
age_respondent |
Numeric vector. Lower bound of respondent age groups
(e.g., |
p_surv |
Numeric vector. Proportion of respondents reporting the parent alive, one value per age group. |
mean_age_parent |
Numeric scalar or vector. Mean age of parents at
respondent's birth ( |
surv_date |
Numeric. Survey reference date as a decimal year
(e.g., |
num_respondents |
Numeric vector. Optional. Number of respondents per age group. Reserved for future use; currently has no effect on estimates. |
model_family |
Character. Model life table family used as the relational
logit standard. UN families: |
e0 |
Numeric. Life expectancy at birth ( |
custom_coef_luy |
Optional. A named list containing at least the
element matching |
Three orphanhood-based estimation methods are supported. Regardless of the method selected, estimates are harmonized into three comparable mortality indices:
30q30: Probability of dying between ages 30 and 60.
45q15: Probability of dying between ages 15 and 60.
e30: Life expectancy at age 30.
For the Brass method, adjacent orphanhood proportions are paired across
successive age groups. The first observation yields NA by
construction because no preceding adjacent proportion exists.
An object of class OrphanhoodEstimate, a named list with:
estimatesData frame of estimated adult mortality indices by respondent age group. Columns:
MethodCitation label of the estimation method used.
RefYearEstimated reference year of the mortality estimate, expressed as a decimal year.
AgeLower bound of the respondent age group () used to
derive the orphanhood estimate.
bInitial exact age of the conditional survivorship interval.
Equals 30 for Luy (2012); 25 for Timaeus (1992) females,
35 for males; 25 for Brass and Hill (1973) females, 32.5 or 37.5
for males depending on .
n_bTerminal exact age of the survivorship interval
(). For Luy (2012) this equals
.
l(b)Estimated survivorship at exact age , derived from
the relational logit model.
l(n_b)Estimated survivorship at exact age , derived from
the relational logit model.
lx_ratioConditional survivorship probability ,
i.e.\ the probability of surviving from exact age
to exact age . This is the key observable quantity
derived from the orphanhood method and used to estimate
Alpha.
AlphaRelational logit level parameter estimated by
solving against the
standard life table. Higher values indicate lower mortality.
30q30Probability of dying between exact ages 30 and 60.
45q15Probability of dying between exact ages 15 and 60.
e30Life expectancy at exact age 30.
metaNamed list of metadata: sex of the parent, model life table family,
family system type ("UN" or "CD"), method identifier,
and primary index name.
inputsNamed list of the original input arguments, retained for
reproducibility and use by om_sensitivity_Mn and
om_sensitivity_modelLT.
Brass, W. and Hill, K. H. (1973). Estimating adult mortality from orphanhood. In Proceedings of the International Population Conference, Liege 1973, Vol. 3, pp. 111–123. IUSSP.
Luy, M. (2009). Estimating mortality differentials in developed populations from survey information on maternal and paternal orphanhood. European Demographic Research Papers 2009-3. Vienna Institute of Demography.
Luy, M. (2012). Estimating mortality differences in developed countries from survey information on maternal and paternal orphanhood. Demography, 49(2), 607–627. doi:10.1007/s13524-012-0101-4
Timaeus, I. M. (1992). Estimation of adult mortality from paternal orphanhood: a reassessment and a new approach. Population Bulletin of the United Nations, 33, 47–63.
United Nations (1983). Manual X: Indirect Techniques for Demographic Estimation. New York: United Nations.
om_sensitivity_Mn, om_sensitivity_modelLT,
om_plot_linearity, om_calibrate_luy
result <- om_estimate_index( method = "brass", sex_parent = "Female", age_respondent = c(20, 25, 30, 35, 40, 45), p_surv = c(0.906, 0.840, 0.747, 0.631, 0.518, 0.400), mean_age_parent = 28.8, surv_date = 1975.64, model_family = "General" ) print(result)result <- om_estimate_index( method = "brass", sex_parent = "Female", age_respondent = c(20, 25, 30, 35, 40, 45), p_surv = c(0.906, 0.840, 0.747, 0.631, 0.518, 0.400), mean_age_parent = 28.8, surv_date = 1975.64, model_family = "General" ) print(result)
Lists, for a given survey date, the calendar years, ages and cohorts that
each input of om_calibrate_luy must cover, following the
timing conventions of Luy (2009) and his calculation workbooks.
om_luy_data_needs( survey_date, sex_parent = c("Female", "Male"), age_respondent = seq(20, 60, by = 5), cohort_lag = 4, male_shift = 4, age_range = NULL, max_age = 110 ) ## S3 method for class 'LuyDataNeeds' print(x, ...)om_luy_data_needs( survey_date, sex_parent = c("Female", "Male"), age_respondent = seq(20, 60, by = 5), cohort_lag = 4, male_shift = 4, age_range = NULL, max_age = 110 ) ## S3 method for class 'LuyDataNeeds' print(x, ...)
survey_date |
Numeric. Interview date as a decimal year ( |
sex_parent |
Character. |
age_respondent |
Numeric vector of respondent age group lower bounds. |
cohort_lag |
Integer, default 4 (Luy 2009). Years subtracted, in
addition to |
male_shift |
Numeric. Years by which female ASFR are shifted to obtain paternal schedules (Luy: 4). |
age_range |
Numeric length-2 vector, youngest and oldest parental age.
Defaults to |
max_age |
Last age of the cohort life tables, an open interval (default 110, as in the Human Mortality Database). |
x |
An object of class |
... |
Ignored. |
For respondent age group (respondents aged to
), survey date , exposure years and
parental age at the respondent's birth (Luy 2009, pp. 10–18):
asfr and pop_age: the respondents' five birth years
to ;
ASFR at ages 15–49 (female rates, also for fathers), population at
the parental ages (15–49 mothers, 19–53 fathers).
cohort_qx: parental cohort (see cohort_lag in
om_calibrate_luy), from age to , i.e. from calendar year
to .
period_lx: ages 30 and (the ratio
, Luy 2009, eq. 1) in the years around the
reference period. The reference period depends on mortality; it always
lies between and , and in practice within the
"typical" range shown ( to , plus
one year for the linear interpolation between calendar years).
Oldest age. The age reached by the oldest parents at the end of
the exposure, , can exceed the last age of a life table
(for : 111 for mothers, 115 for fathers). It is capped at
max_age: the last age of a life table is an open interval (e.g.
110+, ages 0 to 110+ are 111 age classes) in which , so no
older age exists in the data or is needed. Ages without data are not
filled in by om_calibrate_luy(); they get no weight (see
Details there).
A data frame of class "LuyDataNeeds" with one row per
respondent age group and the columns
nrespondent age group (lower bound).
birth_yearsrespondents' birth years: years needed in
asfr and pop_age.
asfr_agesages needed in asfr (female ages).
pop_agesages needed in pop_age (parent's sex).
cohortsparental birth cohorts needed in
cohort_qx.
cohort_agesages of those cohorts needed in
cohort_qx (capped at max_age).
cohort_last_yearlast calendar year the cohort series
must reach, .
period_agesages read from period_lx: 30 and
.
period_years_boundsyears within which the reference period always lies.
period_years_typicalyears within which it usually lies.
The attribute "overall" holds the ranges over all age groups,
which the print method shows first.
Luy, M. (2009). Estimating mortality differentials in developed populations from survey information on maternal and paternal orphanhood. European Demographic Research Papers 2009-3. Vienna Institute of Demography.
om_calibrate_luy, om_luy_validate_inputs
om_luy_data_needs(2003.9, "Female") om_luy_data_needs(1998.5, "Male")om_luy_data_needs(2003.9, "Female") om_luy_data_needs(1998.5, "Male")
Returns the intermediate quantities computed by
om_calibrate_luy for each respondent age group, arranged
like the sheets of Luy's workbooks (Multipliers_*_NEW_REF_YEARS.xls), so
that they can be compared cell by cell with his values.
om_luy_intermediates( cal, what = c("summary", "f_prime", "weights", "N", "f_empirical", "q", "q_bar", "L", "w_observed"), n = NULL, format = c("wide", "long") )om_luy_intermediates( cal, what = c("summary", "f_prime", "weights", "N", "f_empirical", "q", "q_bar", "L", "w_observed"), n = NULL, format = c("wide", "long") )
cal |
Output of |
what |
Which quantity:
|
n |
Respondent age group(s). Default: all. |
format |
|
With format = "wide": for one age group, the matrix (or
named vector for "N" and "f_empirical", data frame for
"summary"); for several, a list of them named by age group. With
format = "long": a data frame with column n, the row and
column identifiers (age, k, mean_age; for
"q" also the parental cohort) and value. The
"summary" columns are mean_age, S_model,
ref_year, t_n, lx_ratio, W, mac,
P, H and gompertz_alpha.
Luy, M. (2009). Estimating mortality differentials in developed populations from survey information on maternal and paternal orphanhood. European Demographic Research Papers 2009-3. Vienna Institute of Demography.
# synthetic inputs in the standard long format asfr <- expand.grid(age = 15:49, year = 1950:2000) asfr$rate <- 0.1 * exp(-0.5 * ((asfr$age - 28) / 5.5)^2) cohort_qx <- expand.grid(age = 0:110, cohort = 1900:1990) cohort_qx$qx <- pmin(1, 0.00005 * exp(0.095 * cohort_qx$age)) cohort_qx <- cohort_qx[cohort_qx$cohort + cohort_qx$age <= 2003, ] pop_age <- expand.grid(age = 0:110, year = 1950:2000) pop_age$n <- 1e5 * exp(-0.01 * pop_age$age) period_lx <- expand.grid(age = 0:110, year = 1980:2003) period_lx$lx <- 1e5 * exp(-0.00005 / 0.095 * (exp(0.095 * period_lx$age) - 1)) cal <- om_calibrate_luy("Female", asfr = asfr, cohort_qx = cohort_qx, pop_age = pop_age, period_lx = period_lx, survey_date = 2003.9, age_respondent = c(20, 40)) om_luy_intermediates(cal, "f_prime", n = 40) # Luy's "MODELED f(x)/TFR" om_luy_intermediates(cal, "summary", n = 40) head(om_luy_intermediates(cal, "q", format = "long"))# synthetic inputs in the standard long format asfr <- expand.grid(age = 15:49, year = 1950:2000) asfr$rate <- 0.1 * exp(-0.5 * ((asfr$age - 28) / 5.5)^2) cohort_qx <- expand.grid(age = 0:110, cohort = 1900:1990) cohort_qx$qx <- pmin(1, 0.00005 * exp(0.095 * cohort_qx$age)) cohort_qx <- cohort_qx[cohort_qx$cohort + cohort_qx$age <= 2003, ] pop_age <- expand.grid(age = 0:110, year = 1950:2000) pop_age$n <- 1e5 * exp(-0.01 * pop_age$age) period_lx <- expand.grid(age = 0:110, year = 1980:2003) period_lx$lx <- 1e5 * exp(-0.00005 / 0.095 * (exp(0.095 * period_lx$age) - 1)) cal <- om_calibrate_luy("Female", asfr = asfr, cohort_qx = cohort_qx, pop_age = pop_age, period_lx = period_lx, survey_date = 2003.9, age_respondent = c(20, 40)) om_luy_intermediates(cal, "f_prime", n = 40) # Luy's "MODELED f(x)/TFR" om_luy_intermediates(cal, "summary", n = 40) head(om_luy_intermediates(cal, "q", format = "long"))
Checks that the data frames you prepared are in the standard long format
expected by om_calibrate_luy and, if survey_date is
given, that they cover the years, ages and cohorts the calibration needs
(see om_luy_data_needs). Run it after reading your data and
before calibrating.
om_luy_validate_inputs( asfr = NULL, cohort_qx = NULL, pop_age = NULL, period_lx = NULL, survey_date = NULL, sex_parent = c("Female", "Male"), age_respondent = seq(20, 60, by = 5), cohort_lag = 4, male_shift = 4, verbose = TRUE )om_luy_validate_inputs( asfr = NULL, cohort_qx = NULL, pop_age = NULL, period_lx = NULL, survey_date = NULL, sex_parent = c("Female", "Male"), age_respondent = seq(20, 60, by = 5), cohort_lag = 4, male_shift = 4, verbose = TRUE )
asfr, cohort_qx, pop_age, period_lx
|
Data frames to check (each
optional; |
survey_date |
Optional survey date (decimal year). If given, the
coverage of the inputs is compared with |
sex_parent |
|
age_respondent, cohort_lag, male_shift
|
As in
|
verbose |
Print a summary (default |
Invisibly, a data frame with one row per input: number of complete rows and the age and year (or cohort) ranges. Stops with an informative error if an input is malformed.
| argument | columns | content |
asfr |
age, year, rate |
period ASFR of women, births per woman (not per 1000) |
cohort_qx |
age, cohort, qx |
cohort probability of dying, 0--1 |
pop_age |
age, year, n |
population size (not exposure) |
period_lx |
year, age, lx (or qx) |
period life table |
age, year and cohort are whole numbers (completed age,
calendar year, birth year). Each key combination appears once.
Errors: not a data frame; missing columns; non-numeric columns;
non-integer ages/years/cohorts; duplicated keys; rate > 1 (per 1000)
or negative; qx outside 0–1; negative n or lx.
Warnings: rows with NA (they are ignored by the
calibration); with survey_date, years, ages or cohorts the
calibration needs but that are missing.
om_calibrate_luy, om_luy_data_needs
# synthetic inputs in the standard long format asfr <- expand.grid(age = 15:49, year = 1950:2000) asfr$rate <- 0.1 * exp(-0.5 * ((asfr$age - 28) / 5.5)^2) cohort_qx <- expand.grid(age = 0:110, cohort = 1900:1990) cohort_qx$qx <- pmin(1, 0.00005 * exp(0.095 * cohort_qx$age)) cohort_qx <- cohort_qx[cohort_qx$cohort + cohort_qx$age <= 2003, ] pop_age <- expand.grid(age = 0:110, year = 1950:2000) pop_age$n <- 1e5 * exp(-0.01 * pop_age$age) period_lx <- expand.grid(age = 0:110, year = 1980:2003) period_lx$lx <- 1e5 * exp(-0.00005 / 0.095 * (exp(0.095 * period_lx$age) - 1)) om_luy_validate_inputs(asfr, cohort_qx, pop_age, period_lx, survey_date = 2003.9, sex_parent = "Female", age_respondent = c(20, 40)) # a typical preparation error: rates per 1000 women try(om_luy_validate_inputs(asfr = transform(asfr, rate = rate * 1000)))# synthetic inputs in the standard long format asfr <- expand.grid(age = 15:49, year = 1950:2000) asfr$rate <- 0.1 * exp(-0.5 * ((asfr$age - 28) / 5.5)^2) cohort_qx <- expand.grid(age = 0:110, cohort = 1900:1990) cohort_qx$qx <- pmin(1, 0.00005 * exp(0.095 * cohort_qx$age)) cohort_qx <- cohort_qx[cohort_qx$cohort + cohort_qx$age <= 2003, ] pop_age <- expand.grid(age = 0:110, year = 1950:2000) pop_age$n <- 1e5 * exp(-0.01 * pop_age$age) period_lx <- expand.grid(age = 0:110, year = 1980:2003) period_lx$lx <- 1e5 * exp(-0.00005 / 0.095 * (exp(0.095 * period_lx$age) - 1)) om_luy_validate_inputs(asfr, cohort_qx, pop_age, period_lx, survey_date = 2003.9, sex_parent = "Female", age_respondent = c(20, 40)) # a typical preparation error: rates per 1000 women try(om_luy_validate_inputs(asfr = transform(asfr, rate = rate * 1000)))
Displays the estimated Brass logit parameter across respondent
age groups. A roughly constant indicates internal consistency
of the orphanhood-based estimates; a systematic trend suggests age-reporting
errors, adoption effects, or structural changes in mortality.
om_plot_linearity(object)om_plot_linearity(object)
object |
An object of class |
A ggplot object with respondent age group (Age) on
the x-axis and the relational logit level parameter
(Alpha) on the y-axis. A dashed horizontal line marks the median
across age groups.
om_estimate_index, om_dashboard
result <- om_estimate_index( method = "luy", sex_parent = "Female", age_respondent = seq(20, 60, by = 5), p_surv = c(0.987, 0.967, 0.934, 0.908, 0.882, 0.835, 0.769, 0.669, 0.565), mean_age_parent = rep(27, 9), surv_date = 1998.5 ) om_plot_linearity(result)result <- om_estimate_index( method = "luy", sex_parent = "Female", age_respondent = seq(20, 60, by = 5), p_surv = c(0.987, 0.967, 0.934, 0.908, 0.882, 0.835, 0.769, 0.669, 0.565), mean_age_parent = rep(27, 9), surv_date = 1998.5 ) om_plot_linearity(result)
Evaluates the sensitivity of orphanhood-based mortality estimates to
assumptions about the mean age of childbearing () by
re-estimating indices across a grid of additive offsets.
om_sensitivity_Mn(object = NULL, range_m = seq(-1.5, 1.5, 0.5), ...)om_sensitivity_Mn(object = NULL, range_m = seq(-1.5, 1.5, 0.5), ...)
object |
Optional. An object of class |
range_m |
Numeric vector of offsets (in years) applied to the baseline
mean age of childbearing. Default: |
... |
Additional arguments passed to |
An object of class OrphanhoodSensitivity, a named list with:
dataA data frame of estimates for each offset value, with columns
matching om_estimate_index()$estimates plus an additional
column Offset_M identifying the applied offset in years.
metaA named list of metadata: variable name, offset range, standard level, and estimation method.
plot.OrphanhoodSensitivity,
om_sensitivity_modelLT, om_estimate_index
result <- om_estimate_index( method = "luy", sex_parent = "Female", age_respondent = seq(20, 60, by = 5), p_surv = c(0.987, 0.967, 0.934, 0.908, 0.882, 0.835, 0.769, 0.669, 0.565), mean_age_parent = rep(27, 9), surv_date = 1998.5 ) sens <- om_sensitivity_Mn(result, range_m = seq(-2, 2, by = 0.5)) plot(sens, index = "30q30")result <- om_estimate_index( method = "luy", sex_parent = "Female", age_respondent = seq(20, 60, by = 5), p_surv = c(0.987, 0.967, 0.934, 0.908, 0.882, 0.835, 0.769, 0.669, 0.565), mean_age_parent = rep(27, 9), surv_date = 1998.5 ) sens <- om_sensitivity_Mn(result, range_m = seq(-2, 2, by = 0.5)) plot(sens, index = "30q30")
Evaluates the sensitivity of orphanhood-based mortality estimates to the assumed age pattern of mortality by re-estimating indices across multiple model life table families.
om_sensitivity_modelLT( object = NULL, type = c("UN", "CD", "All"), families = NULL, ... )om_sensitivity_modelLT( object = NULL, type = c("UN", "CD", "All"), families = NULL, ... )
object |
Optional. An object of class |
type |
Character. Family system to evaluate. One of |
families |
Optional character vector of specific family names to test,
overriding |
... |
Additional arguments passed to |
An object of class OrphanhoodSensitivityFamily, a named list
with:
dataA data frame of estimates for each family, with columns matching
om_estimate_index()$estimates plus an additional column
Family identifying the model life table family.
metaA named list of metadata: variable name, families tested, standard level, family system name, and estimation method.
plot.OrphanhoodSensitivityFamily,
om_sensitivity_Mn, om_estimate_index
result <- om_estimate_index( method = "luy", sex_parent = "Female", age_respondent = seq(20, 60, by = 5), p_surv = c(0.987, 0.967, 0.934, 0.908, 0.882, 0.835, 0.769, 0.669, 0.565), mean_age_parent = rep(27, 9), surv_date = 1998.5 ) sens_fam <- om_sensitivity_modelLT(result, type = "UN") plot(sens_fam, index = "30q30")result <- om_estimate_index( method = "luy", sex_parent = "Female", age_respondent = seq(20, 60, by = 5), p_surv = c(0.987, 0.967, 0.934, 0.908, 0.882, 0.835, 0.769, 0.669, 0.565), mean_age_parent = rep(27, 9), surv_date = 1998.5 ) sens_fam <- om_sensitivity_modelLT(result, type = "UN") plot(sens_fam, index = "30q30")
OrphanhoodSensitivity ObjectsDisplays estimated mortality indices across reference years for each mean-age-of-childbearing offset, coloured from light (low offset) to dark (high offset).
## S3 method for class 'OrphanhoodSensitivity' plot(x, index = "30q30", ...)## S3 method for class 'OrphanhoodSensitivity' plot(x, index = "30q30", ...)
x |
An object of class |
index |
Character. Mortality index to plot. One of |
... |
Further arguments (currently unused). |
A ggplot object.
OrphanhoodSensitivityFamily ObjectsDisplays estimated mortality indices across reference years for each model life table family, distinguished by line type.
## S3 method for class 'OrphanhoodSensitivityFamily' plot(x, index = "30q30", ...)## S3 method for class 'OrphanhoodSensitivityFamily' plot(x, index = "30q30", ...)
x |
An object of class |
index |
Character. Mortality index to plot. One of |
... |
Further arguments (currently unused). |
A ggplot object.
OrphanhoodEstimate objectsPrint method for OrphanhoodEstimate objects
## S3 method for class 'OrphanhoodEstimate' print(x, ...)## S3 method for class 'OrphanhoodEstimate' print(x, ...)
x |
An object of class |
... |
Further arguments passed to |
Invisibly returns x.
OrphanhoodSensitivity ObjectsPrints a concise summary of a mean-age-of-childbearing sensitivity analysis.
## S3 method for class 'OrphanhoodSensitivity' print(x, ...)## S3 method for class 'OrphanhoodSensitivity' print(x, ...)
x |
An object of class |
... |
Further arguments (currently unused). |
Invisibly returns x.
OrphanhoodSensitivityFamily ObjectsPrints a concise summary of a model life table family sensitivity analysis.
## S3 method for class 'OrphanhoodSensitivityFamily' print(x, ...)## S3 method for class 'OrphanhoodSensitivityFamily' print(x, ...)
x |
An object of class |
... |
Further arguments (currently unused). |
Invisibly returns x.
OrphanhoodEstimate objectsSummary method for OrphanhoodEstimate objects
## S3 method for class 'OrphanhoodEstimate' summary(object, ...)## S3 method for class 'OrphanhoodEstimate' summary(object, ...)
object |
An object of class |
... |
Further arguments (currently unused). |
Invisibly returns object.
OrphanhoodSensitivity ObjectsSummarises the range of estimated mortality indices across all mean-age-of-childbearing offsets.
## S3 method for class 'OrphanhoodSensitivity' summary(object, index = "30q30", ...)## S3 method for class 'OrphanhoodSensitivity' summary(object, index = "30q30", ...)
object |
An object of class |
index |
Character. Mortality index to summarise. One of
|
... |
Further arguments (currently unused). |
Invisibly returns object.
OrphanhoodSensitivityFamily ObjectsSummarises the range of estimated mortality indices across all model life table families tested.
## S3 method for class 'OrphanhoodSensitivityFamily' summary(object, index = "30q30", ...)## S3 method for class 'OrphanhoodSensitivityFamily' summary(object, index = "30q30", ...)
object |
An object of class |
index |
Character. Mortality index to summarise. One of
|
... |
Further arguments (currently unused). |
Invisibly returns object.