| simPregProp | R Documentation |
Calculates proportions of pregnancies experiencing spontaneous live birth, non-spontaneous live birth, or late miscarriage/stillbirth by gestational age and timing of exposure, given daily hazard rates and hazard ratios.
simPregProp(
haz.spont.livebirth = haz.spont.livebirth.default,
haz.nonspont.livebirth = haz.nonspont.livebirth.default,
haz.late.miscarriage.stillbirth = haz.late.miscarriage.stillbirth.default,
haz.exposure = haz.exposure.default,
hr.spont.livebirth = NULL,
hr.nonspont.livebirth = NULL,
hr.late.miscarriage.stillbirth = NULL
)
haz.spont.livebirth |
Numeric vector of daily hazards of spontaneous
live birth. Defaults to the package-provided
|
haz.nonspont.livebirth |
Numeric vector of daily hazards of
non-spontaneous live birth. Defaults to the package-provided
|
haz.late.miscarriage.stillbirth |
Numeric vector of daily hazards of
late miscarriage/stillbirth. Defaults to the package-provided
|
haz.exposure |
Numeric vector of daily hazards of exposure. Defaults
to the package-provided |
hr.spont.livebirth |
Numeric vector of hazard ratios for spontaneous
live birth following exposure. Must have the same length as the hazard
vectors. Defaults to |
hr.nonspont.livebirth |
Numeric vector of hazard ratios for
non-spontaneous live birth following exposure. Must have the same length
as the hazard vectors. Defaults to |
hr.late.miscarriage.stillbirth |
Numeric vector of hazard ratios for
late miscarriage/stillbirth following exposure. Must have the same length
as the hazard vectors. Defaults to |
A data frame with class preg.prop containing the following
columns:
Gestational age in days.
Gestational age at exposure. NA indicates no exposure.
Pregnancy outcome: spontaneous_live_birth,
nonspontaneous_live_birth, or late_miscarriage_stillbirth.
Proportion of pregnancies corresponding to the gestational age, exposure timing, and outcome combination.
# Use the package-provided default hazard vectors
data.prop <- simPregProp()
head(data.prop)
# Illustrate an exposure associated with increased risk of preterm live birth
hr <- rep(1, 301)
hr[1:258] <- 2
data.prop <- simPregProp(
hr.spont.livebirth = hr,
hr.nonspont.livebirth = hr
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.