Learn R Programming

SimRVPedigree (version 0.3.0)

hazard: Create an object of class hazard.

Description

Create a hazard object, required input for sim_RVped, sim_ped, and sim_life functions.

Usage

hazard(hazardDF, partition = NULL)

Arguments

hazardDF

Data.frame. Column 1 specifies the age-specific hazard rate of disease in the population of interest, column 2 specifies the age-specific hazard rate for death in the unaffected population, and column 3 specifies the age-specific hazard rate for death in the affected population. See details.

partition

Numeric vector. The partition of ages, in years, over which to apply the age-specific hazard rates in hazardDF. If not supplied, defaults to a partition that starts at 0 and increases in yearly increments. See details.

Value

An object of class hazard.

Details

hazardDF must contain 3 columns that meet the following criteria:

column 1:

age-specific hazard rates of disease for the population of interest

column 2:

age-specific hazard rates of death for the unaffected population. If the disease of interest is sufficiently rare, so that death by the disease is rare, the user may choose to use the population, age-specific, hazard rates of death instead.

column 3:

age-specific hazard rates of death for the affected population.

Users must provide partition in years; e.g. a hazard rate for a baby between 6 months and 1 year of age should have lower bound 0.5 years and an upper bound 1 year. Additionally, partition must apply to all of the age-specific hazard rates in hazardDF.

Examples

Run this code
# NOT RUN {
data(AgeSpecific_Hazards)

head(AgeSpecific_Hazards)
nrow(AgeSpecific_Hazards)

my_part = seq(0, 100, by = 1)
my_HR <- hazard(hazardDF = AgeSpecific_Hazards,
                partition = my_part)


my_HR
class(my_HR)
head(my_HR[[1]])
my_HR[[2]]


my_HR <- hazard(hazardDF = AgeSpecific_Hazards)
class(my_HR)
my_HR[[2]]

# }

Run the code above in your browser using DataLab