kin | R Documentation |
Implementation of Goodman-Keyfitz-Pullum equations in a matrix framework. This produce a matrilineal (or patrilineal) kin count distribution by kin and age.
kin(
p = NULL,
f = NULL,
time_invariant = TRUE,
pi = NULL,
n = NULL,
output_cohort = NULL,
output_period = NULL,
output_kin = NULL,
output_age_focal = NULL,
birth_female = 1/2.04,
summary_kin = TRUE
)
p |
numeric. A vector (atomic) or matrix with 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). |
f |
numeric. Same as |
time_invariant |
logical. Constant assumption for a given |
pi |
numeric. Same as |
n |
numeric. Only for |
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). |
birth_female |
numeric. Female portion at birth. This multiplies |
summary_kin |
logical. Whether or not include |
See Caswell (2019) and Caswell (2021) for details on formulas. One sex only (female by default).
A list with:
kin_full a data frame with year, cohort, Focal´s age, related ages and type of kin (for example d
is daughter,
oa
is older aunts, etc.), including living and dead kin at that age.
kin_summary a data frame with Focal´s age, related ages 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 matrilineal count for a Swedish female based on 2015 rates.
swe_surv_2015 <- swe_px[,"2015"]
swe_asfr_2015 <- swe_asfr[,"2015"]
# Run kinship models
swe_2015 <- kin(p = swe_surv_2015, f = swe_asfr_2015)
head(swe_2015$kin_summary)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.