hazard: Create an object of class hazard.

Description Usage Arguments Details Value Examples

View source: R/Hazard_Methods.R

Description

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

Usage

1
hazard(hazardDF, partition = NULL, subtype_ID = NULL)

Arguments

hazardDF

Data.frame. A data.frame contianing the age-specific hazard rate(s) of disease in the population of interest, the age-specific hazard rate for death in the unaffected population, and 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.

subtype_ID

List. If specifying a disease with multiple subtypes, a list of character subtype IDs. By default, subtype_ID = NULL, i.e. no subtypes to simulate.

Details

Users are permitted to specify harzard objects for two scenarios: (1) for a disease without subtypes or (2) for a disease with multiple subtypes.

When simulating a disease without subtypes, 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.

When simulating a disease with n disease subtypes, hazardDF must contain n + 2 columns that meet the following criteria:

column 1:

age-specific hazard rates of disease for the first subtype of interest

column 2:

age-specific hazard rates of disease for the second subtype of interest

...
column n:

age-specific hazard rates of disease for the n^{th} subtype of interest

column n + 1:

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 n + 2:

age-specific hazard rates of death for an individual affectd by any of the n subtypes.

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.

Value

An object of class hazard.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Specifying the hazard rates for a disease
# with only one subtype (or grouped subtypes).
data(AgeSpecific_Hazards)

head(AgeSpecific_Hazards)
nrow(AgeSpecific_Hazards)

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

#NOTE: since partition was not supplied, the partition has been assummed to
# start at 0 and increase in yearly increments.
my_HR[[2]]

my_HR


# Specifying the hazard rates for a with teo disease subtypes
data(SubtypeHazards)

head(SubtypeHazards)
nrow(SubtypeHazards)

my_SHR <- hazard(hazardDF = SubtypeHazards,
                 subtype_ID = c("Hodgkin Lymphoma", "Non-Hodgkin Lymphoma"))
class(my_SHR)
head(my_SHR[[1]])
my_SHR

simrvprojects/SimRVPedigree documentation built on Feb. 12, 2020, 6:12 p.m.