Skip to contents

Imputes missing ages in family-based data using a combination of Weibull distributions for affected individuals and empirical distributions for unaffected individuals. The function can perform both sex-specific and non-sex-specific imputations.

Usage

imputeAges(
  data,
  na_indices,
  baseline_male = NULL,
  baseline_female = NULL,
  alpha_male = NULL,
  beta_male = NULL,
  delta_male = NULL,
  alpha_female = NULL,
  beta_female = NULL,
  delta_female = NULL,
  baseline = NULL,
  alpha = NULL,
  beta = NULL,
  delta = NULL,
  max_age,
  sex_specific = TRUE,
  max_attempts = 100,
  geno_freq,
  trans,
  lik
)

Arguments

data

A data frame containing family-based data with columns: family, individual, father, mother, sex, aff, age, geno, and isProband

na_indices

Vector of indices where ages need to be imputed

baseline_male, baseline_female

Data frames containing baseline age distributions for males/females

alpha_male, alpha_female

Shape parameters for male/female Weibull distributions

beta_male, beta_female

Scale parameters for male/female Weibull distributions

delta_male, delta_female

Location parameters for male/female Weibull distributions

baseline

Data frame containing overall baseline age distribution (non-sex-specific)

alpha, beta, delta

Overall Weibull parameters (non-sex-specific)

max_age

Maximum allowable age

sex_specific

Logical; whether to use sex-specific parameters

max_attempts

Maximum number of attempts for generating valid ages

geno_freq

Vector of genotype frequencies

trans

Transmission probabilities

lik

Likelihood matrix

Value

A data frame with imputed ages