kin2sex | R Documentation |
Implementation of two-sex matrix kinship model. This produces kin counts grouped by kin, age and sex of
each relatives at each Focal´s age. For example, male cousins from aunts and uncles from different sibling's parents
are grouped in one male count of cousins. Note that the output labels relative following female notation: the label m
refers to either mothers or fathers, and column sex_kin
determine the sex of the relative.
kin2sex(
pf = NULL,
pm = NULL,
ff = NULL,
fm = NULL,
time_invariant = TRUE,
sex_focal = "f",
birth_female = 1/2.04,
pif = NULL,
pim = NULL,
nf = NULL,
nm = NULL,
Hf = NULL,
Hm = NULL,
output_cohort = NULL,
output_period = NULL,
output_kin = NULL,
output_age_focal = NULL,
summary_kin = TRUE
)
pf |
numeric. A vector (atomic) or matrix with female probabilities (or survival ratios, or transition between age class in a more general perspective) with rows as ages (and columns as years in case of matrix, being the name of each col the year). |
pm |
numeric. A vector (atomic) or matrix with male probabilities (or survival ratios, or transition between age class in a more general perspective) with rows as ages (and columns as years in case of matrix, being the name of each col the year). |
ff |
numeric. Same as |
fm |
numeric. Same as |
time_invariant |
logical. Constant assumption for a given |
sex_focal |
character. "f" for female or "m" for male. |
birth_female |
numeric. Female portion at birth. This multiplies |
pif |
numeric. For using some specific age distribution of childbearing for mothers (same length as ages). Default |
pim |
numeric. For using some specific age distribution of childbearing for fathers (same length as ages). Default |
nf |
numeric. Only for |
nm |
numeric. Only for |
Hf |
numeric. A list where each list element (being the name of each list element the year) contains a matrix with cause-specific hazards for females with rows as causes and columns as ages, being the name of each col the age. |
Hm |
numeric. A list where each list element (being the name of each list element the year) contains a matrix with cause-specific hazards for males with rows as causes and columns as ages, being the name of each col the age. |
output_cohort |
integer. Vector of year cohorts for returning results. Should be within input data years range. |
output_period |
integer. Vector of period years for returning results. Should be within input data years range. |
output_kin |
character. kin types to return: "m" for mother, "d" for daughter,... |
output_age_focal |
integer. Vector of ages to select (and make faster the run). |
summary_kin |
logical. Whether or not include |
See Caswell (2022) for details on formulas.
A list with:
kin_full a data frame with year, cohort, Focal´s age, related ages and type of kin (for example d
could be daughter or son depending sex_kin
,
oa
is older aunts or uncles also depending sex_kin
value, etc.), including living and dead kin at that age.
kin_summary a data frame with Focal´s age, related ages, sex and type of kin, with indicators obtained processing kin_full
, grouping by cohort or period (depending on the given arguments):
count_living
: count of living kin at actual age of Focal
mean_age
: mean age of each type of living kin.
sd_age
: standard deviation of age of each type of living kin.
count_death
: count of dead kin at specific age of Focal.
count_cum_death
: cumulated count of dead kin until specific age of Focal.
mean_age_lost
: mean age where Focal lost her relative.
# Kin expected count by relative sex for a French female based on 2012 rates.
fra_fert_f <- fra_asfr_sex[,"ff"]
fra_fert_m <- fra_asfr_sex[,"fm"]
fra_surv_f <- fra_surv_sex[,"pf"]
fra_surv_m <- fra_surv_sex[,"pm"]
fra_2012 <- kin2sex(fra_surv_f, fra_surv_m, fra_fert_f, fra_fert_m)
head(fra_2012$kin_summary)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.