lik.fn: Penetrance Function

View source: R/mhLoglikehood.r

lik.fnR Documentation

Penetrance Function

Description

Calculates the penetrance for an individual based on Weibull distribution parameters. This function estimates the probability of developing cancer given the individual's genetic and demographic information.

Usage

lik.fn(
  i,
  data,
  alpha_male,
  alpha_female,
  beta_male,
  beta_female,
  delta_male,
  delta_female,
  gamma_male,
  gamma_female,
  max_age,
  baselineRisk,
  BaselineNC,
  prev
)

Arguments

i

Integer, index of the individual in the data set.

data

Data frame, containing individual demographic and genetic information. Must include columns for 'sex', 'age', 'aff' (affection status), and 'geno' (genotype).

alpha_male

Numeric, Weibull distribution shape parameter for males.

alpha_female

Numeric, Weibull distribution shape parameter for females.

beta_male

Numeric, Weibull distribution scale parameter for males.

beta_female

Numeric, Weibull distribution scale parameter for females.

delta_male

Numeric, shift parameter for the Weibull function for males.

delta_female

Numeric, shift parameter for the Weibull function for females.

gamma_male

Numeric, asymptote parameter for males (only scales the entire distribution).

gamma_female

Numeric, asymptote parameter for females (only scales the entire distribution).

max_age

Integer, maximum age considered in the analysis.

baselineRisk

Numeric matrix, baseline risk for each age by sex. Columns correspond to sex (1 for male, 2 for female) and rows to age.

BaselineNC

Logical, indicates if non-carrier penetrance should be based on SEER data.

prev

Numeric, the carrier prevalence (heterozygote frequency) in the population. This should be approximately 2p where p is the allele frequency when the allele is rare.

Value

Numeric vector, containing penetrance values for unaffected and affected individuals.


penetrance documentation built on Sept. 9, 2026, 1:07 a.m.