...
 
......@@ -7,6 +7,7 @@ Authors@R: c(person("Reinhold", "Kainhofer", role=c("aut", "cre"), email="reinho
Author: Reinhold Kainhofer [aut, cre]
Maintainer: Reinhold Kainhofer <reinhold@kainhofer.com>
URL: https://gitlab.open-tools.net/R/r-mortality-tables
Encoding: UTF-8
Depends:
ggplot2,
methods,
......@@ -24,24 +25,27 @@ Description: Classes to implement and plot cohort life tables
merged life tables.
License: GPL (>= 2)
RoxygenNote: 6.1.0.9000
Collate: 'mortalityTable.R'
Collate:
'mortalityTable.R'
'mortalityTable.period.R'
'mortalityTable.ageShift.R'
'ageShift.R'
'mortalityTable.observed.R'
'mortalityTable.joined.R'
'fillAges.R'
'mortalityTable.mixed.R'
'mortalityTable.improvementFactors.R'
'mortalityTable.trendProjection.R'
'deathProbabilities.R'
'periodDeathProbabilities.R'
'mortalityTable.joined.R'
'getOmega.R'
'pensionTable.R'
'utilityFunctions.R'
'mortalityTable.observed.R'
'ages.R'
'baseTable.R'
'baseYear.R'
'fillAges.R'
'pensionTable.R'
'commutationNumbers.R'
'mortalityTable.improvementFactors.R'
'mortalityTable.trendProjection.R'
'deathProbabilities.R'
'getCohortTable.R'
'getOmega.R'
'getPeriodTable.R'
'lifeTable.R'
'makeQxDataFrame.R'
......@@ -50,7 +54,6 @@ Collate: 'mortalityTable.R'
'mortalityTable.MakehamGompertz.R'
'mortalityTable.Weibull.R'
'mortalityTable.deMoivre.R'
'periodDeathProbabilities.R'
'mortalityTable.jointLives.R'
'mortalityTables.list.R'
'mortalityTables.load.R'
......@@ -61,6 +64,5 @@ Collate: 'mortalityTable.R'
'setLoading.R'
'setModification.R'
'undampenTrend.R'
'utilityFunctions.R'
'whittaker.mortalityTable.R'
VignetteBuilder: knitr
......@@ -26,6 +26,7 @@ export(mortalityTable.deMoivre)
export(mortalityTable.improvementFactors)
export(mortalityTable.jointLives)
export(mortalityTable.mixed)
export(mortalityTable.observed)
export(mortalityTable.once)
export(mortalityTable.onceAndFuture)
export(mortalityTable.period)
......@@ -33,7 +34,9 @@ export(mortalityTable.trendProjection)
export(mortalityTable.zeroes)
export(mortalityTables.list)
export(mortalityTables.load)
export(pT.calculateTotalMortality)
export(pT.getSubTable)
export(pT.recalculateTotalMortality)
export(pT.setDimInfo)
export(pensionTable)
export(pensionTables.list)
......@@ -51,6 +54,7 @@ exportClasses(mortalityTable.deMoivre)
exportClasses(mortalityTable.improvementFactors)
exportClasses(mortalityTable.jointLives)
exportClasses(mortalityTable.mixed)
exportClasses(mortalityTable.observed)
exportClasses(mortalityTable.period)
exportClasses(mortalityTable.trendProjection)
exportClasses(pensionTable)
......
......@@ -17,6 +17,7 @@ fillAges = function(probs = c(), givenAges = c(), neededAges = NULL, fill = NA_r
result = rep(fill, length(neededAges))
providedAges = intersect(neededAges, givenAges)
result[match(providedAges, neededAges)] = probs[match(providedAges, givenAges)]
setNames(result, neededAges)
result
} else {
probs
......
......@@ -30,9 +30,3 @@ setMethod("getOmega", "mortalityTable.mixed",
# function(object) {
# getOmega(object@table1);
# })
# #' @describeIn getOmega Return the maximum age of the joined life table
# setMethod("getOmega", "mortalityTable.observed",
# function(object) {
# max(object@ages, na.rm = TRUE);
# })
#' @include mortalityTable.R
#' @include mortalityTable.R utilityFunctions.R getOmega.R periodDeathProbabilities.R deathProbabilities.R ages.R
NULL
# #' Class mortalityTable.observed - Life table from actual observations
# #'
# #' A cohort life table described by actual observations (data frame of PODs
# #' per year and age)
# #'
# #' @slot data The observations
# #' @slot years The observation years
# #' @slot ages The observation ages
# #'
# #' @export mortalityTable.observed
# #' @exportClass mortalityTable.observed
# mortalityTable.observed = setClass(
# "mortalityTable.observed",
# slots = list(
# data = "data.frame",
# years = "numeric",
# ages = "numeric"
# ),
# prototype = list(
# data = data.frame(),
# years = c(),
# ages = c()
# ),
# contains = "mortalityTable"
# )
# asdf
#' Class mortalityTable.observed - Life table from actual observations
#'
#' A cohort life table described by actual observations (data frame of PODs
#' per year and age)
#'
#' @slot data The observations
#' @slot years The observation years
#' @slot ages The observation ages
#'
#' @export mortalityTable.observed
#' @exportClass mortalityTable.observed
mortalityTable.observed = setClass(
"mortalityTable.observed",
slots = list(
deathProbs = "data.frame",
years = "numeric",
ages = "numeric"
),
prototype = list(
deathProbs = data.frame(),
years = c(),
ages = c()
),
contains = "mortalityTable"
)
#' @describeIn ages Return the ages of the life table
setMethod("ages", "mortalityTable.observed",
function(object) {
object@ages
})
#' @describeIn getOmega Return the maximum age of the life table
setMethod("getOmega", "mortalityTable.observed",
function(object) {
max(object@ages, na.rm = TRUE);
})
#' @describeIn mT.round Return the life table with the values rounded to the given number of digits
setMethod("mT.round", "mortalityTable.observed",
function(object, digits = 8) {
o = callNextMethod()
o@data = round(o@data, digits = digits)
o
})
# Solution to convert vector of integer values to string, with ranges for subsequent numbers:
# https://stackoverflow.com/questions/16911773/collapse-runs-of-consecutive-numbers-to-ranges
findIntRuns <- function(run) {
rundiff <- c(1, diff(run))
difflist <- split(run, cumsum(rundiff != 1))
runs = unlist(lapply(difflist, function(x) {
if (length(x) %in% 1:2) as.character(x) else paste0(x[1], "-", x[length(x)])
}), use.names = FALSE)
paste0(runs, collapse = ",")
}
#' @describeIn periodDeathProbabilities Return the (period) death probabilities
#' of the life table for a given observation year
#' If the observed mortality table does not provide data
#' for the desired period, the period closest to the
#' `Period` argument will be used and a warning printed.
setMethod("periodDeathProbabilities", "mortalityTable.observed",
function(object, ..., ages = NULL, Period = 1975) {
if (is.null(ages)) {
ages = ages(object)
}
col = which.min(abs(object@years - Period))
if (object@years[col] != Period) {
warning("periodDeathProbabilities: Desired Period ", Period,
" of observed mortalityTable not available, using closest period ",
object@years[[col]], ".\nAvailable periods: ", findIntRuns(object@years))
}
# find the given year that is closest to the desired year:
#
fillAges(
object@modification(object@deathProbs[,col] * (1 + object@loading)),
givenAges = ages(object),
neededAges = ages)
})
#' @describeIn deathProbabilities Return the (cohort) death probabilities of the
#' life table given the birth year (if needed)
setMethod("deathProbabilities","mortalityTable.observed",
function(object, ..., ages = NULL, YOB = 1975) {
if (is.null(ages)) {
ages = ages(object);
}
years = YOB + ages;
yearcols = sapply(years, function(y) which.min(abs(object@years - y)))
agerows = match(ages, object@ages)
## Check if all desired years are available
if (sum(abs(object@years[yearcols] - years)) > 0) {
warning("deathProbabilities: Not all observation years ", findIntRuns(years),
" of observed mortalityTable are available, using closest observations.\nAvailable periods: ", findIntRuns(object@years))
}
qx = object@deathProbs[cbind(agerows, yearcols)] * (1 + object@loading);
fillAges(object@modification(qx), givenAges = ages(object), neededAges = ages)
})
#'@describeIn mT.cleanup Clean up the internal data of the mortality table
setMethod("mT.cleanup", "mortalityTable.observed",
function(object) {
o = callNextMethod()
o@ages = unname(o@ages)
o@deathProbs = unname(o@deathProbs)
o@years = unname(o@years)
o
})
#' @include mortalityTable.R
#' @include mortalityTable.R mortalityTable.trendProjection.R mortalityTable.improvementFactors.R pensionTable.R
NULL
......@@ -48,7 +48,14 @@ fitExtrapolationLaw = function(data, ages, data.ages = ages, Dx = NULL, Ex = NUL
# Fit an exponential function exp(-A*(x-x0)) to the last value (f(100) and f'(100) need to coincide):
#' Fit an exponential function exp(-A*(x-x0)) to the last value (f(100) and f'(100) need to coincide):
#'
#' @param data data.frame to which an exponential function should be fit
#' @param idx Index of the position of the fit
#' @param up Whether the fit is forward- or backward-facing
#' @param verbose Whether to include data about the fit in the output
#'
# exportMethod fitExpExtrapolation
fitExpExtrapolation = function(data, idx, up = TRUE, verbose = FALSE) {
# browser()
# Anchor point of the extrapolation
......@@ -73,6 +80,15 @@ fitExpExtrapolation = function(data, idx, up = TRUE, verbose = FALSE) {
}
#' Sets a new name for the given mortality table or the list/table/array of mortalityTables
#'
#' @param table A life table object (instance of a \code{mortalityTable} class) or a list, table or array of mortalityTable objects
#' @param name New name for the table.
#'
#' @examples
#' mortalityTables.load("Austria_Annuities")
#' mT.setName(AVOe2005R.male, name = "Austrian male Annuity table 2005-R")
#'
#' @export
mT.setName = function(table, name) {
if (is.array(table)) {
......@@ -92,6 +108,17 @@ mT.setName = function(table, name) {
#' Restrict the given \code{mortalityTable} object(s) to given ages, potentially filling with NA values to ensure they cover the full desired age range
#'
#' @param table A life table object (instance of a \code{mortalityTable} class) or a list, table or array of mortalityTable objects
#' @param neededAges The vector of ages the returned objects should cover (even if the values are 0 or NA)
#' @param fill The value to use for all ages for which the original table(s) do not have any information
#'
#' @examples
#' mortalityTables.load("Austria_Annuities")
#' # return a table with only ages 100-130, where ages above 120 (not defined in the original table) are filled with qx=1:
#' mT.fillAges(AVOe2005R.male, neededAges = 100:130, fill = 1)
#'
#' @export
mT.fillAges = function(table, neededAges, fill = 0) {
if (is.array(table)) {
......@@ -125,6 +152,17 @@ mT.fillAges = function(table, neededAges, fill = 0) {
table
}
#' Scale all probabilities of the given \code{mortalityTable} object(s) by the given factor
#'
#' @param table A life table object (instance of a \code{mortalityTable} class) or a list, table or array of mortalityTable objects
#' @param factor Scaling factor for the probabilities (1.0 means unchanged)
#' @param name.postfix String to append to the original name of the table
#' @param name New name, overwriting the existing name of the table (takes precedence over \code{name.postfix})
#'
#' @examples
#' mortalityTables.load("Austria_Annuities")
#' mT.scaleProbs(AVOe2005R.male, 1.5) # Add 50% to all death probabilities of the table
#'
#' @export
mT.scaleProbs = function(table, factor = 1.0, name.postfix = "scaled", name = NULL) {
if (is.array(table)) {
......@@ -151,6 +189,14 @@ mT.scaleProbs = function(table, factor = 1.0, name.postfix = "scaled", name = NU
}
#' Set/Add a trend vector for the probabilities of the given \code{mortalityTable} object(s). Returns a \code{mortalityTable.trendProjection} object
#'
#' @param table A life table object (instance of a \code{mortalityTable} class) or a list, table or array of mortalityTable objects
#' @param trend Trend vector to be applied to the mortality table
#' @param trendages Ages corresponding to the values of the \code{trend} vector
#' @param baseYear Base year for the trend projection (passed on to \code{mortalityTable.trendProjection})
#' @param dampingFunction Trend damping (passed on to \code{mortalityTable.trendProjection})
#'
#' @export
mT.setTrend = function(table, trend, trendages = NULL, baseYear = NULL, dampingFunction = identity) {
if (is.array(table)) {
......
library(tidyverse)
library(openxlsx)
filename = file.path("data-raw", "Austria_Population_Observed_StatistikAustria.xlsx")
wb = openxlsx::loadWorkbook(filename)
loadSheet = function(wb, sheet = "2017") {
if (as.numeric(sheet) >= 2002) {
startRow = 8
cols = c(1,2,8,14)
colNames = c("Alter", "M", "F", "U")
} else {
startRow = 13
cols = c(1,2,8)
colNames = c("Alter", "M", "F")
}
data = readWorkbook(wb, sheet = sheet, startRow = startRow, colNames = FALSE, rowNames = FALSE, cols = cols) %>%
`colnames<-`(colNames) %>%
filter(!is.na(M), !is.na(F)) %>%
mutate(Alter = as.integer(Alter), Jahr = as.integer(sheet)) %>%
gather(key = Geschlecht, value = qx, -Alter, -Jahr) %>%
select(Jahr, Alter, Geschlecht, qx) %>%
as.tibble
data
}
qx.AT_Pop_observed = bind_rows(sapply(sheets(wb), loadSheet, wb = wb, simplify = FALSE))
for (g in c("M", "F", "U")) {
qx.AT_Pop_observed %>%
filter(Geschlecht == g) %>%
acast(Alter ~ Jahr, value.var = "qx") %>%
write.csv(file = file.path("inst", "extdata", paste0("Austria_Population_Observation_", g, ".csv")))
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
stopifnot(require(methods), require(utils), require(MortalityTables)) # MortalityTable classes; new; Excel reader
###############################################################################
### Gesamtbevölkerung Österreich: Bevölkerungsprognose bis 2080 (mittleres Szenario)
### Datenquelle: Statistik Austria
###############################################################################
AT.pop.obs.M = utils::read.csv(system.file("extdata", "Austria_Population_Observation_M.csv", package = "MortalityTables"), check.names = FALSE, row.names = 1);
AT.pop.obs.F = utils::read.csv(system.file("extdata", "Austria_Population_Observation_F.csv", package = "MortalityTables"), check.names = FALSE, row.names = 1);
AT.pop.obs.U = utils::read.csv(system.file("extdata", "Austria_Population_Observation_U.csv", package = "MortalityTables"), check.names = FALSE, row.names = 1);
mort.AT.observed.male = mortalityTable.observed(
name = "Österreich Männer Beobachtung",
deathProbs = AT.pop.obs.M,
ages = as.integer(rownames(AT.pop.obs.M)),
years = as.integer(colnames(AT.pop.obs.M)),
data = list(
dim = list(sex = "m", collar = "Gesamtbevölkerung", type = "Beobachtung", data = "official", year = "1947-2017")
)
)
mort.AT.observed.female = mortalityTable.observed(
name = "Österreich Frauen Beobachtung",
deathProbs = AT.pop.obs.F,
ages = as.integer(rownames(AT.pop.obs.F)),
years = as.integer(colnames(AT.pop.obs.F)),
data = list(
dim = list(sex = "f", collar = "Gesamtbevölkerung", type = "Beobachtung", data = "official", year = "1947-2017")
)
)
mort.AT.observed.unisex = mortalityTable.observed(
name = "Österreich Unisex Beobachtung",
deathProbs = AT.pop.obs.U,
ages = as.integer(rownames(AT.pop.obs.U)),
years = as.integer(colnames(AT.pop.obs.U)),
data = list(
dim = list(sex = "u", collar = "Gesamtbevölkerung", type = "Beobachtung", data = "official", year = "1947-2017")
)
)
rm(AT.pop.obs.M, AT.pop.obs.F, AT.pop.obs.U)
###############################################################################
# mortalityTables.load("Austria*")
# plot(mort.AT.forecast.male, mort.AT.forecast.female, AVOe1996R.male, AVOe2005R.male, AVOe1996R.female, AVOe2005R.female, YOB = 2000)
# plotMortalityTrend(mort.AT.forecast.male, mort.AT.forecast.female, AVOe1996R.male, AVOe2005R.male, AVOe1996R.female, AVOe2005R.female, Period = 2002)
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deathProbabilities.R,
% R/mortalityTable.jointLives.R
% R/mortalityTable.observed.R, R/mortalityTable.jointLives.R
\docType{methods}
\name{deathProbabilities}
\alias{deathProbabilities}
......@@ -9,6 +9,7 @@
\alias{deathProbabilities,mortalityTable.trendProjection-method}
\alias{deathProbabilities,mortalityTable.improvementFactors-method}
\alias{deathProbabilities,mortalityTable.mixed-method}
\alias{deathProbabilities,mortalityTable.observed-method}
\alias{deathProbabilities,mortalityTable.jointLives-method}
\title{Return the (cohort) death probabilities of the life table given the birth year (if needed)}
\usage{
......@@ -29,6 +30,9 @@ deathProbabilities(object, ..., ages = NULL, YOB = 1975)
\S4method{deathProbabilities}{mortalityTable.mixed}(object, ...,
ages = NULL, YOB = 1975)
\S4method{deathProbabilities}{mortalityTable.observed}(object, ...,
ages = NULL, YOB = 1975)
\S4method{deathProbabilities}{mortalityTable.jointLives}(object, ...,
ageDifferences = c(), ages = NULL, YOB = 1975)
}
......@@ -63,6 +67,9 @@ life table given the birth year (if needed)
\item \code{mortalityTable.mixed}: Return the (cohort) death probabilities of the
life table given the birth year (if needed)
\item \code{mortalityTable.observed}: Return the (cohort) death probabilities of the
life table given the birth year (if needed)
\item \code{mortalityTable.jointLives}: Return the (cohort) death probabilities of the
life table given the birth year (if needed)
}}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utilityFunctions.R
\name{fitExpExtrapolation}
\alias{fitExpExtrapolation}
\title{Fit an exponential function exp(-A*(x-x0)) to the last value (f(100) and f'(100) need to coincide):}
\usage{
fitExpExtrapolation(data, idx, up = TRUE, verbose = FALSE)
}
\arguments{
\item{data}{data.frame to which an exponential function should be fit}
\item{idx}{Index of the position of the fit}
\item{up}{Whether the fit is forward- or backward-facing}
\item{verbose}{Whether to include data about the fit in the output}
}
\description{
Fit an exponential function exp(-A*(x-x0)) to the last value (f(100) and f'(100) need to coincide):
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/getOmega.R, R/mortalityTable.jointLives.R
% Please edit documentation in R/getOmega.R, R/mortalityTable.observed.R,
% R/mortalityTable.jointLives.R
\docType{methods}
\name{getOmega}
\alias{getOmega}
\alias{getOmega,mortalityTable.period-method}
\alias{getOmega,mortalityTable.mixed-method}
\alias{getOmega,mortalityTable.observed-method}
\alias{getOmega,mortalityTable.jointLives-method}
\title{Return the maximum age of the life table}
\usage{
......@@ -14,6 +16,8 @@ getOmega(object)
\S4method{getOmega}{mortalityTable.mixed}(object)
\S4method{getOmega}{mortalityTable.observed}(object)
\S4method{getOmega}{mortalityTable.jointLives}(object)
}
\arguments{
......@@ -28,6 +32,8 @@ Return the maximum age of the life table
\item \code{mortalityTable.mixed}: Return the maximum age of the mixed life table
\item \code{mortalityTable.observed}: Return the maximum age of the period life table
\item \code{mortalityTable.jointLives}: Return the maximum age of the joint lives mortality table (returns the maximum age of the first table used for joint lives, as the ages of the joint lives are now known to the function)
}}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utilityFunctions.R
\name{mT.fillAges}
\alias{mT.fillAges}
\title{Restrict the given \code{mortalityTable} object(s) to given ages, potentially filling with NA values to ensure they cover the full desired age range}
\usage{
mT.fillAges(table, neededAges, fill = 0)
}
\arguments{
\item{table}{A life table object (instance of a \code{mortalityTable} class) or a list, table or array of mortalityTable objects}
\item{neededAges}{The vector of ages the returned objects should cover (even if the values are 0 or NA)}
\item{fill}{The value to use for all ages for which the original table(s) do not have any information}
}
\description{
Restrict the given \code{mortalityTable} object(s) to given ages, potentially filling with NA values to ensure they cover the full desired age range
}
\examples{
mortalityTables.load("Austria_Annuities")
# return a table with only ages 100-130, where ages above 120 (not defined in the original table) are filled with qx=1:
mT.fillAges(AVOe2005R.male, neededAges = 100:130, fill = 1)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utilityFunctions.R
\name{mT.scaleProbs}
\alias{mT.scaleProbs}
\title{Scale all probabilities of the given \code{mortalityTable} object(s) by the given factor}
\usage{
mT.scaleProbs(table, factor = 1, name.postfix = "scaled",
name = NULL)
}
\arguments{
\item{table}{A life table object (instance of a \code{mortalityTable} class) or a list, table or array of mortalityTable objects}
\item{factor}{Scaling factor for the probabilities (1.0 means unchanged)}
\item{name.postfix}{String to append to the original name of the table}
\item{name}{New name, overwriting the existing name of the table (takes precedence over \code{name.postfix})}
}
\description{
Scale all probabilities of the given \code{mortalityTable} object(s) by the given factor
}
\examples{
mortalityTables.load("Austria_Annuities")
mT.scaleProbs(AVOe2005R.male, 1.5) # Add 50\% to all death probabilities of the table
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utilityFunctions.R
\name{mT.setName}
\alias{mT.setName}
\title{Sets a new name for the given mortality table or the list/table/array of mortalityTables}
\usage{
mT.setName(table, name)
}
\arguments{
\item{table}{A life table object (instance of a \code{mortalityTable} class) or a list, table or array of mortalityTable objects}
\item{name}{New name for the table.}
}
\description{
Sets a new name for the given mortality table or the list/table/array of mortalityTables
}
\examples{
mortalityTables.load("Austria_Annuities")
mT.setName(AVOe2005R.male, name = "Austrian male Annuity table 2005-R")
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utilityFunctions.R
\name{mT.setTrend}
\alias{mT.setTrend}
\alias{mT.addTrend}
\title{Set/Add a trend vector for the probabilities of the given \code{mortalityTable} object(s). Returns a \code{mortalityTable.trendProjection} object}
\usage{
mT.setTrend(table, trend, trendages = NULL, baseYear = NULL,
dampingFunction = identity)
mT.addTrend(table, trend, trendages = NULL, baseYear = NULL,
dampingFunction = identity)
}
\arguments{
\item{table}{A life table object (instance of a \code{mortalityTable} class) or a list, table or array of mortalityTable objects}
\item{trend}{Trend vector to be applied to the mortality table}
\item{trendages}{Ages corresponding to the values of the \code{trend} vector}
\item{baseYear}{Base year for the trend projection (passed on to \code{mortalityTable.trendProjection})}
\item{dampingFunction}{Trend damping (passed on to \code{mortalityTable.trendProjection})}
}
\description{
Set/Add a trend vector for the probabilities of the given \code{mortalityTable} object(s). Returns a \code{mortalityTable.trendProjection} object
}
\section{Functions}{
\itemize{
\item \code{mT.addTrend}: Add a trend to the mortality table (returns a mortalityTable.trendProjection obect)
}}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mortalityTable.observed.R
\docType{class}
\name{mortalityTable.observed-class}
\alias{mortalityTable.observed-class}
\alias{mortalityTable.observed}
\title{Class mortalityTable.observed - Life table from actual observations}
\description{
A cohort life table described by actual observations (data frame of PODs
per year and age)
}
\section{Slots}{
\describe{
\item{\code{data}}{The observations}
\item{\code{years}}{The observation years}
\item{\code{ages}}{The observation ages}
}}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/periodDeathProbabilities.R,
% R/mortalityTable.jointLives.R
% R/mortalityTable.observed.R, R/mortalityTable.jointLives.R
\docType{methods}
\name{periodDeathProbabilities}
\alias{periodDeathProbabilities}
......@@ -9,6 +9,7 @@
\alias{periodDeathProbabilities,mortalityTable.trendProjection-method}
\alias{periodDeathProbabilities,mortalityTable.improvementFactors-method}
\alias{periodDeathProbabilities,mortalityTable.mixed-method}
\alias{periodDeathProbabilities,mortalityTable.observed-method}
\alias{periodDeathProbabilities,mortalityTable.jointLives-method}
\title{Return the (period) death probabilities of the life table for a given
observation year}
......@@ -32,6 +33,9 @@ periodDeathProbabilities(object, ..., ages = NULL, Period = 1975)
\S4method{periodDeathProbabilities}{mortalityTable.mixed}(object, ...,
ages = NULL, Period = 1975)
\S4method{periodDeathProbabilities}{mortalityTable.observed}(object, ...,
ages = NULL, Period = 1975)
\S4method{periodDeathProbabilities}{mortalityTable.jointLives}(object, ...,
ageDifferences = c(), ages = NULL, Period = 1975)
}
......@@ -67,6 +71,12 @@ of the life table for a given observation year
\item \code{mortalityTable.mixed}: Return the (period) death probabilities
of the life table for a given observation year
\item \code{mortalityTable.observed}: Return the (period) death probabilities
of the life table for a given observation year
If the observed mortality table does not provide data
for the desired period, the period closest to the
`Period` argument will be used and a warning printed.
\item \code{mortalityTable.jointLives}: Return the (period) death probabilities
of the joint lives mortality table for a given observation year
}}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/setModification.R, R/utilityFunctions.R
% Please edit documentation in R/utilityFunctions.R, R/setModification.R
\docType{methods}
\name{setModification}
\name{mT.round,mortalityTable-method}
\alias{mT.round,mortalityTable-method}
\alias{setModification}
\alias{setModification,mortalityTable-method}
\alias{mT.round,mortalityTable-method}
\title{Return a copy of the table with the given modification function added}
\usage{
\S4method{mT.round}{mortalityTable}(object, digits = 8)
setModification(object, modification = 0)
\S4method{setModification}{mortalityTable}(object, modification = 0)
\S4method{mT.round}{mortalityTable}(object, digits = 8)
}
\arguments{
\item{object}{A life table object (instance of a \code{mortalityTable} class)}
......