Package: DemoKin 1.0.3

Iván Williams

DemoKin: Estimate Population Kin Distribution

Estimate population kin counts and its distribution by type, age and sex. The package implements one-sex and two-sex framework for studying living-death availability, with time varying rates or not, and multi-stage model.

Authors:Iván Williams [aut, cre], Diego Alburez-Gutierrez [aut], Xi Song [ctb], Hal Caswell [ctb], Benjamin Schlüter [ctb], Joe Butterick [ctb], Sha Jiang [ctb]

DemoKin_1.0.3.tar.gz
DemoKin_1.0.3.zip(r-4.7)DemoKin_1.0.3.zip(r-4.6)DemoKin_1.0.3.zip(r-4.5)
DemoKin_1.0.3.tgz(r-4.6-any)DemoKin_1.0.3.tgz(r-4.5-any)
DemoKin_1.0.3.tar.gz(r-4.7-any)DemoKin_1.0.3.tar.gz(r-4.6-any)
DemoKin_1.0.3.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
DemoKin/json (API)
NEWS

# Install 'DemoKin' in R:
install.packages('DemoKin', repos = c('https://ivanwilli.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ivanwilli/demokin/issues

Pkgdown/docs site:https://ivanwilli.github.io

Datasets:
  • demokin_codes - DemoKin codes, Caswell (2020) codes, and useful labels.
  • f_caswell_2021 - Historic and projected fertility ratios from Sweden used in Caswell
  • F_mat_fem_edu - Singapore: Lists of matrices containing fertility rates by age and education. Females
  • F_mat_male_edu - Singapore: Lists of matrices containing fertility rates by age and education. Males
  • Female_parity_fert_list_UK - UK female fertility from 1965 to 2022
  • Female_parity_mortality_list_UK - UK female parity mortality from 1965 to 2022
  • fra_asfr_sex - Fertility for France (2012) by sex in Caswell (2022).
  • fra_surv_sex - Survival probability for France (2012) by sex in Caswell (2022).
  • H_mat_edu - Singapore: List of matrices that redistribute newborns to age-class 1 and "no education" category
  • kin_svk1990_caswell2020 - Output for Slovakia 1990 in Caswell (2020).
  • Male_parity_mortality_list_UK - UK male parity mortality from 1965 to 2022
  • Parity_transfers_by_age_list_UK - UK female parity transitions from 1965 to 2022
  • pi_caswell_2021 - Historic and projected mother´s age distribution of childbearing from Sweden used in Caswell
  • Redistribution_by_parity_list_UK - UK parity assign parity at birth
  • svk_fxs - Female Slovakian fertility rates by parity stage in 1990
  • svk_Hxs - Age where assign offspring of individuals in each partity stage (Caswell, 2021). All to zero age in this case.
  • svk_pxs - Female Slovakian survival probabilities by parity stage in 1990
  • svk_Uxs - Probability of transition among parity stage for Slovakia in 1990, for each age, conditional on survival (Caswell, 2021).
  • swe_asfr - Swedish age-specific fertility rates from 1900 to 2015
  • swe_pop - Female swedish population from 1900 to 2015
  • swe_px - Female swedish survival probabilities from 1900 to 2015
  • swe_Sx - Female swedish survival ratios from 1900 to 2015
  • T_mat_fem_edu - Singapore: Lists of transition matrices showing probabilities of moving between education states. Females
  • T_mat_male_edu - Singapore: Lists of transition matrices showing probabilities of moving between education states. Males
  • U_caswell_2021 - Historic and projected survival ratios from Sweden used in Caswell
  • U_mat_fem_edu - Singapore: Lists of matrices containing survival probabilities by age (rows) and education (columns) from 2020-2090. Females
  • U_mat_male_edu - Singapore: Lists of matrices containing survival probabilities by age (rows) and education (columns) from 2020-2090. Males

On CRAN:

Conda:

demographykinship

7.24 score 25 stars 29 scripts 173 downloads 17 exports 29 dependencies

Last updated from:66e0c84b0f. Checks:7 WARNING, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64WARNING196
source / vignettesOK393
linux-release-x86_64WARNING199
macos-release-arm64WARNING162
macos-oldrel-arm64WARNING157
windows-develWARNING172
windows-releaseWARNING143
windows-oldrelWARNING159
wasm-releaseOK114

Exports:%>%kinkin_multi_stagekin_multi_stage_time_variant_2sexkin_time_invariantkin_time_invariant_2sexkin_time_invariant_2sex_codkin_time_variantkin_time_variant_2sexkin_time_variant_2sex_codkin2sexoutput_period_cohort_combinationplot_diagramrename_kintimevarying_kintimevarying_kin_2sextimevarying_kin_2sex_cod

Dependencies:clicpp11data.tabledplyrgenericsglueigraphlatticelifecyclemagrittrMASSMatrixmatrixcalcpillarpkgconfigplyrpurrrR6Rcppreshape2rlangstringistringrtibbletidyrtidyselectutf8vctrswithr

One-sex time-invariant kinship model specified by age

Rendered from1_1_OneSex_TimeInvariant_Age.Rmdusingknitr::rmarkdownon May 25 2026.

Last update: 2025-04-25
Started: 2025-04-24

One-sex time-invariant kinship model specified by age and stage

Rendered from2_1_OneSex_TimeInvariant_AgeStage.Rmdusingknitr::rmarkdownon May 25 2026.

Last update: 2025-04-25
Started: 2025-04-24

One-sex time-varying kinship model specified by age

Rendered from1_2_OneSex_TimeVarying_Age.Rmdusingknitr::rmarkdownon May 25 2026.

Last update: 2025-04-25
Started: 2025-04-24

Two-sex time-invariant kinship model specified by age

Rendered from1_3_TwoSex_TimeInvariant_Age.Rmdusingknitr::rmarkdownon May 25 2026.

Last update: 2025-04-25
Started: 2025-04-24

Two-sex time-varying kinship model specified by age

Rendered from1_4_TwoSex_TimeVarying_Age.Rmdusingknitr::rmarkdownon May 25 2026.

Last update: 2025-04-25
Started: 2025-04-24

Two-sex time-varying kinship model specified by age and stage

Rendered from2_2_TwoSex_TimeVarying_AgeStage.Rmdusingknitr::rmarkdownon May 25 2026.

Last update: 2026-05-21
Started: 2025-04-24

Readme and manuals

Help Manual

Help pageTopics
Title time invariant two-sex multi-state kin projectionsall_kin_dy
Title time-variant two-sex multi-state kin projectionsall_kin_dy_TV
Title Accumulated kin by each age of Focal, for each time period, and cohort of birthcreate_cumsum_df
Title joint age*stage distributions of kin by each age of Focal, for each time period, and cohort of birthcreate_full_dists_df
DemoKin codes, Caswell (2020) codes, and useful labels.demokin_codes
Historic and projected fertility ratios from Sweden used in Caswell (2021)f_caswell_2021
Singapore: Lists of matrices containing fertility rates by age and education. FemalesF_mat_fem_edu
Singapore: Lists of matrices containing fertility rates by age and education. MalesF_mat_male_edu
UK female fertility from 1965 to 2022Female_parity_fert_list_UK
UK female parity mortality from 1965 to 2022Female_parity_mortality_list_UK
Fertility for France (2012) by sex in Caswell (2022).fra_asfr_sex
Survival probability for France (2012) by sex in Caswell (2022).fra_surv_sex
Singapore: List of matrices that redistribute newborns to age-class 1 and "no education" categoryH_mat_edu
Estimate kin counts in a one-sex framework.kin
Estimate kin counts by age and stage in a time invariant frameworkkin_multi_stage
Estimate kin counts by age, stage, and sex, in a time variant frameworkkin_multi_stage_time_variant_2sex
Output for Slovakia 1990 in Caswell (2020).kin_svk1990_caswell2020
Estimate kin counts in a time invariant framework for one-sex model (matrilineal/patrilineal)kin_time_invariant
Estimate kin counts in a time invariant framework for two-sex model.kin_time_invariant_2sex
Estimate kin counts in a time invariant framework for two-sex model.kin_time_invariant_2sex_cod
Estimate kin counts in a time variant framework (dynamic rates) for one-sex model (matrilineal/patrilineal)kin_time_variant
Estimate kin counts in a time variant framework (dynamic rates) in a two-sex framework (Caswell, 2022)kin_time_variant_2sex
Estimate kin counts in a time variant framework (dynamic rates) in a two-sex framework (Caswell, 2022)kin_time_variant_2sex_cod
Estimate kin counts in a two-sex frameworkkin2sex
UK male parity mortality from 1965 to 2022Male_parity_mortality_list_UK
APC combination to returnoutput_period_cohort_combination
UK female parity transitions from 1965 to 2022Parity_transfers_by_age_list_UK
Historic and projected mother´s age distribution of childbearing from Sweden used in Caswell (2021)pi_caswell_2021
Mixing distributions for the time-invariant multi-state 2-sex model: Non-parity casepi_mix
Mixing distributions for the time-invariant multi-state 2-sex model: Parity-specific casepi_mix_parity
Mixing distributions for the time-variant multi-state 2-sex model: Non-parity casepi_mix_TV
Mixing distributions for the time-variant multi-state 2-sex model: Parity-specific casepi_mix_TV_parity
plot a Kin diagram (network)plot_diagram
UK parity assign parity at birthRedistribution_by_parity_list_UK
rename kinrename_kin
Female Slovakian fertility rates by parity stage in 1990 (Caswell, 2021)svk_fxs
Age where assign offspring of individuals in each partity stage (Caswell, 2021). All to zero age in this case.svk_Hxs
Female Slovakian survival probabilities by parity stage in 1990 (Caswell, 2021)svk_pxs
Probability of transition among parity stage for Slovakia in 1990, for each age, conditional on survival (Caswell, 2021).svk_Uxs
Swedish age-specific fertility rates from 1900 to 2015swe_asfr
Female swedish population from 1900 to 2015swe_pop
Female swedish survival probabilities from 1900 to 2015swe_px
Female swedish survival ratios from 1900 to 2015swe_Sx
Singapore: Lists of transition matrices showing probabilities of moving between education states. FemalesT_mat_fem_edu
Singapore: Lists of transition matrices showing probabilities of moving between education states. MalesT_mat_male_edu
one time projection kintimevarying_kin
one time projection kintimevarying_kin_2sex
one time projection kintimevarying_kin_2sex_cod
Historic and projected survival ratios from Sweden used in Caswell (2021)U_caswell_2021
Singapore: Lists of matrices containing survival probabilities by age (rows) and education (columns) from 2020-2090. FemalesU_mat_fem_edu
Singapore: Lists of matrices containing survival probabilities by age (rows) and education (columns) from 2020-2090. MalesU_mat_male_edu