kin {DemoKin}R Documentation

Estimate kin counts in a one-sex framework.

Description

Implementation of Goodman-Keyfitz-Pullum equations in a matrix framework. This produce a matrilineal (or patrilineal) kin count distribution by kin and age.

Usage

kin(
  p = NULL,
  f = NULL,
  time_invariant = TRUE,
  pi = NULL,
  n = NULL,
  output_cohort = NULL,
  output_period = NULL,
  output_kin = NULL,
  birth_female = 1/2.04,
  stable = lifecycle::deprecated(),
  U = lifecycle::deprecated()
)

Arguments

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 p but for fertility rates.

time_invariant

logical. Constant assumption for a given year rates. Default TRUE.

pi

numeric. Same as U but for childbearing distribution (sum to 1). Optional.

n

numeric. Only for time_invariant = FALSE. Same as p but for population distribution (counts or ⁠%⁠). Optional.

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,...

birth_female

numeric. Female portion at birth. This multiplies f argument. If f is already for female offspring, this needs to be set as 1.

stable

logic. Deprecated. Use time_invariant.

U

logic. Deprecated. Use p.

Details

See Caswell (2019) and Caswell (2021) for details on formulas. One sex only (female by default).

Value

A list with:

Examples

# 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)

[Package DemoKin version 1.0.3 Index]