View source: R/8_mdtFunctions.R
| independentRatesFromMdt | R Documentation |
independentRatesFromMdt returns a matrix of ASDT independent rates
q'^{(j)}_x for every combination of age and decrement in the supplied
multiple-decrement table.
independentRatesFromMdt(object, x, t = 1)
object |
An |
x |
Optional numeric vector of ages to include. Defaults to all ages
tabulated in |
t |
Period (default 1). |
The independent rate for decrement j at age x is obtained under
the Uniform Distribution of Deaths (UDD) assumption as
q'^{(j)}_x = 1 - \bigl(1 - q^{(\tau)}_x\bigr)^{q^{(j)}_x / q^{(\tau)}_x},
which is the same formula used by qxt.prime.fromMdt for a single
age/decrement pair. independentRatesFromMdt is a convenience wrapper
that applies this extraction to all ages and all decrements at once, returning
the result as a tidy matrix.
A numeric matrix with one row per age and one column per decrement. Row names are the ages, column names the decrement identifiers.
qxt.prime.fromMdt for a single age/decrement pair,
buildMdtFromIndependentRates for the inverse operation.
valdezDf <- data.frame(
x = 50:54,
lx = c(4832555, 4821937, 4810206, 4797185, 4782737),
heart = c(5168, 5363, 5618, 5929, 6277),
accidents = c(1157, 1206, 1443, 1679, 2152),
other = c(4293, 5162, 5960, 6840, 7631))
valdezMdt <- new("mdt", name = "ValdezExample", table = valdezDf)
# ASDT matrix on the ages actually supplied
independentRatesFromMdt(valdezMdt, x = 50:54)
# Subset of ages
independentRatesFromMdt(valdezMdt, x = 50:52)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.