Description Usage Arguments Details Value Examples
View source: R/Hazard_Methods.R
Create a hazard object, required input for sim_RVped
, sim_ped
, and sim_life
functions.
1 |
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 |
subtype_ID |
List. If specifying a disease with multiple subtypes, a list of character subtype IDs. By default, |
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:
age-specific hazard rates of disease for the population of interest
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.
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:
age-specific hazard rates of disease for the first subtype of interest
age-specific hazard rates of disease for the second subtype of interest
age-specific hazard rates of disease for the n^{th} subtype of interest
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.
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
.
An object of class hazard.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.