Skip to contents

This function calculates the empirical density for ages of non-affected individuals in a dataset.

Usage

calculateEmpiricalDensity(
  data,
  aff_column = "aff",
  age_column = "age",
  sex_column = "sex",
  n_points = 10000,
  sex_specific = TRUE
)

Arguments

data

A data frame containing the data.

aff_column

Character, the name of the column indicating affection status. Default is "aff".

age_column

Character, the name of the column indicating ages. Default is "age".

sex_column

Character, the name of the column indicating sex. Default is "sex".

n_points

Integer, the number of points to use in the density estimation. Default is 10000.

sex_specific

Logical, indicating whether to calculate separate densities for males and females. Default is TRUE.

Value

A density object or a list of density objects (if sex-specific) representing the empirical density of ages.