A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/IvanWilli/DemoKin below:

IvanWilli/DemoKin: DemoKin estimates kinship distribution by type and age

This is an R package for the demographic analysis of kinship networks using matrix-based models.
It implements methods developed initially by Caswell (2019), and continued in successive papers (like Caswell (2020) or Caswell (2024)) for estimating the number and age distribution of relatives under various demographic assumptions.

You can install the development version of DemoKin from GitHub:

# install.packages("remotes")
remotes::install_github("IvanWilli/DemoKin")
library(DemoKin)

Here’s a basic example of how to use DemoKin:

# Run a one-sex time-invariant kinship model using Swedish data from 2015
kin_results <- kin(
  p = swe_px[,"2015"],        # Survival probabilities
  f = swe_asfr[,"2015"],      # Fertility rates
  time_invariant = TRUE       # Use time-invariant model
)

# Visualize the expected number of living relatives by age
kin_results$kin_summary %>%
  rename_kin() %>%
  ggplot2::ggplot(ggplot2::aes(age_focal, count_living)) +
  ggplot2::geom_line() +
  ggplot2::facet_wrap(~kin_label, scales = "free_y") +
  ggplot2::labs(
    title = "Expected number of living relatives by age",
    x = "Age of focal individual",
    y = "Number of relatives"
  )

For detailed documentation, please visit the DemoKin website.

The site includes several vignettes demonstrating different types of kinship models:

Models stratified by age and stage

DemoKin has benefited from the work of many people over the years, including:

Williams, Iván; Alburez-Gutierrez, Diego; and the DemoKin team. (2021) DemoKin: An R package to implement demographic matrix kinship models. URL: https://github.com/IvanWilli/DemoKin.

We thank Silvia Leek from the Max Planck Institute for Demographic Research for designing the DemoKin logo. The logo includes elements that have been taken or adapted from this file, originally by Ansunando, CC BY-SA 4.0 via Wikimedia Commons. Sha Jiang provided useful comments for improving the package.

DemoKin is under constant development. If you’re interested in contributing, please get in touch, create an issue, or submit a pull request. We look forward to hearing from you!

This project is licensed under the MIT License - see the LICENSE file for details.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4