Skip to content
Snippets Groups Projects
Commit 1ae9ae42 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

mortalityTable.joined and mortalityTable.observed are not fully implemented,...

mortalityTable.joined and mortalityTable.observed are not fully implemented, so comment out all occurrences
parent ad064fac
No related branches found
No related tags found
No related merge requests found
...@@ -11,10 +11,8 @@ export(mortalityTable.Weibull) ...@@ -11,10 +11,8 @@ export(mortalityTable.Weibull)
export(mortalityTable.ageShift) export(mortalityTable.ageShift)
export(mortalityTable.deMoivre) export(mortalityTable.deMoivre)
export(mortalityTable.improvementFactors) export(mortalityTable.improvementFactors)
export(mortalityTable.joined)
export(mortalityTable.jointLives) export(mortalityTable.jointLives)
export(mortalityTable.mixed) export(mortalityTable.mixed)
export(mortalityTable.observed)
export(mortalityTable.once) export(mortalityTable.once)
export(mortalityTable.onceAndFuture) export(mortalityTable.onceAndFuture)
export(mortalityTable.period) export(mortalityTable.period)
...@@ -34,10 +32,8 @@ exportClasses(mortalityTable.Weibull) ...@@ -34,10 +32,8 @@ exportClasses(mortalityTable.Weibull)
exportClasses(mortalityTable.ageShift) exportClasses(mortalityTable.ageShift)
exportClasses(mortalityTable.deMoivre) exportClasses(mortalityTable.deMoivre)
exportClasses(mortalityTable.improvementFactors) exportClasses(mortalityTable.improvementFactors)
exportClasses(mortalityTable.joined)
exportClasses(mortalityTable.jointLives) exportClasses(mortalityTable.jointLives)
exportClasses(mortalityTable.mixed) exportClasses(mortalityTable.mixed)
exportClasses(mortalityTable.observed)
exportClasses(mortalityTable.period) exportClasses(mortalityTable.period)
exportClasses(mortalityTable.trendProjection) exportClasses(mortalityTable.trendProjection)
exportClasses(pensionTable) exportClasses(pensionTable)
......
...@@ -18,25 +18,25 @@ setGeneric("ages", function(object, ...) standardGeneric("ages")); ...@@ -18,25 +18,25 @@ setGeneric("ages", function(object, ...) standardGeneric("ages"));
#' @describeIn ages Return the defined ages of the period life table #' @describeIn ages Return the defined ages of the period life table
setMethod("ages", "mortalityTable.period", setMethod("ages", "mortalityTable.period",
function (object, ...) { function(object, ...) {
object@ages; object@ages;
}) })
#' @describeIn ages Return the defined ages of the mixed life table #' @describeIn ages Return the defined ages of the mixed life table
setMethod("ages", "mortalityTable.mixed", setMethod("ages", "mortalityTable.mixed",
function (object, ...) { function(object, ...) {
ages(object@table1); ages(object@table1);
}) })
#' @describeIn ages Return the defined ages of the joined life table # #' @describeIn ages Return the defined ages of the joined life table
setMethod("ages", "mortalityTable.joined", # setMethod("ages", "mortalityTable.joined",
function (object, ...) { # function (object, ...) {
ages(object@table1); # ages(object@table1);
}) # })
#' @describeIn ages Return the defined ages of the observed life table # #' @describeIn ages Return the defined ages of the observed life table
setMethod("ages", "mortalityTable.observed", # setMethod("ages", "mortalityTable.observed",
function (object, ...) { # function(object, ...) {
object@ages; # object@ages;
}) # })
...@@ -5,29 +5,34 @@ NULL ...@@ -5,29 +5,34 @@ NULL
#' #'
#' @param object A life table object (instance of a \code{mortalityTable} class) #' @param object A life table object (instance of a \code{mortalityTable} class)
#' #'
#' @examples
#' mortalityTables.load("Austria_Annuities")
#' getOmega(AVOe2005R.male)
#' getOmega(mortalityTable.deMoivre(omega = 100))
#'
#' @exportMethod getOmega #' @exportMethod getOmega
setGeneric("getOmega", function(object) standardGeneric("getOmega")); setGeneric("getOmega", function(object) standardGeneric("getOmega"));
#' @describeIn getOmega Return the maximum age of the period life table #' @describeIn getOmega Return the maximum age of the period life table
setMethod("getOmega", "mortalityTable.period", setMethod("getOmega", "mortalityTable.period",
function (object) { function(object) {
max(object@ages, na.rm = TRUE); max(object@ages, na.rm = TRUE);
}) })
#' @describeIn getOmega Return the maximum age of the mixed life table #' @describeIn getOmega Return the maximum age of the mixed life table
setMethod("getOmega", "mortalityTable.mixed", setMethod("getOmega", "mortalityTable.mixed",
function (object) { function(object) {
getOmega(object@table1); getOmega(object@table1);
}) })
#' @describeIn getOmega Return the maximum age of the joined life table # #' @describeIn getOmega Return the maximum age of the joined life table
setMethod("getOmega", "mortalityTable.joined", # setMethod("getOmega", "mortalityTable.joined",
function (object) { # function(object) {
getOmega(object@table1); # getOmega(object@table1);
}) # })
#' @describeIn getOmega Return the maximum age of the joined life table # #' @describeIn getOmega Return the maximum age of the joined life table
setMethod("getOmega", "mortalityTable.observed", # setMethod("getOmega", "mortalityTable.observed",
function (object) { # function(object) {
max(object@ages, na.rm = TRUE); # max(object@ages, na.rm = TRUE);
}) # })
#' @include mortalityTable.R #' @include mortalityTable.R
NULL NULL
#' Class mortalityTable.joined - Life table created by joining two life tables
#' # #' Class mortalityTable.joined - Life table created by joining two life tables
#' A cohort life table obtained by joining two cohort life tables, each of which # #'
#' applies only to certain observation years (e.g. for the past use the observed # #' A cohort life table obtained by joining two cohort life tables, each of which
#' PoDs, and project them to the future with the trend projection) # #' applies only to certain observation years (e.g. for the past use the observed
#' # #' PoDs, and project them to the future with the trend projection)
#' @slot table1 The first \code{mortalityTable}, valid for years given in \code{yearRange1} # #'
#' @slot yearRange1 The years, for which \code{table1} describes the death probabilities # #' @slot table1 The first \code{mortalityTable}, valid for years given in \code{yearRange1}
#' @slot table2 The second \code{mortalityTable}, valid for years given in \code{yearRange2} # #' @slot yearRange1 The years, for which \code{table1} describes the death probabilities
#' @slot yearRange2 The years, for which \code{table2} describes the death probabilities # #' @slot table2 The second \code{mortalityTable}, valid for years given in \code{yearRange2}
#' # #' @slot yearRange2 The years, for which \code{table2} describes the death probabilities
#' @export mortalityTable.joined # #'
#' @exportClass mortalityTable.joined # #' @examples
mortalityTable.joined = setClass( # #' mortalityTables.load("Austria_Annuities")
"mortalityTable.joined", # #' # An annuity table with different underlying tables for years <2005 and >=2005
slots=list( # #' lt = mortalityTable.joined(table1 = AVOe1996R.male, yearRange1 = 1900:2004,
table1 = "mortalityTable", # #' table2 = AVOe2005R.male, yearRange2 = 2005:2090,
yearRange1 = "numeric", # #' name = "Austrian annuities, joined from '96 and '05 tables")
table2 = "mortalityTable", # #' plot(lt, AVOe1996R.male, AVOe2005R.male, YOB = 1982)
yearRange2 = "numeric" # #'
), # #' @export mortalityTable.joined
contains = "mortalityTable" # #' @exportClass mortalityTable.joined
) # mortalityTable.joined = setClass(
# "mortalityTable.joined",
# slots = list(
# table1 = "mortalityTable",
# yearRange1 = "numeric",
# table2 = "mortalityTable",
# yearRange2 = "numeric"
# ),
# contains = "mortalityTable"
# )
#' @include mortalityTable.R #' @include mortalityTable.R
NULL NULL
#' Class mortalityTable.observed - Life table from actual observations # #' Class mortalityTable.observed - Life table from actual observations
#' # #'
#' A cohort life table described by actual observations (data frame of PODs # #' A cohort life table described by actual observations (data frame of PODs
#' per year and age) # #' per year and age)
#' # #'
#' @slot data The observations # #' @slot data The observations
#' @slot years The observation years # #' @slot years The observation years
#' @slot ages The observation ages # #' @slot ages The observation ages
#' # #'
#' @export mortalityTable.observed # #' @export mortalityTable.observed
#' @exportClass mortalityTable.observed # #' @exportClass mortalityTable.observed
mortalityTable.observed = setClass( # mortalityTable.observed = setClass(
"mortalityTable.observed", # "mortalityTable.observed",
slots = list( # slots = list(
data = "data.frame", # data = "data.frame",
years = "numeric", # years = "numeric",
ages = "numeric" # ages = "numeric"
), # ),
prototype = list( # prototype = list(
data = data.frame(), # data = data.frame(),
years = c(), # years = c(),
ages = c() # ages = c()
), # ),
contains = "mortalityTable" # contains = "mortalityTable"
) # )
# asdf
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
\alias{ages} \alias{ages}
\alias{ages,mortalityTable.period-method} \alias{ages,mortalityTable.period-method}
\alias{ages,mortalityTable.mixed-method} \alias{ages,mortalityTable.mixed-method}
\alias{ages,mortalityTable.joined-method}
\alias{ages,mortalityTable.observed-method}
\alias{ages,mortalityTable.jointLives-method} \alias{ages,mortalityTable.jointLives-method}
\title{Return the defined ages of the life table} \title{Return the defined ages of the life table}
\usage{ \usage{
...@@ -16,10 +14,6 @@ ages(object, ...) ...@@ -16,10 +14,6 @@ ages(object, ...)
\S4method{ages}{mortalityTable.mixed}(object, ...) \S4method{ages}{mortalityTable.mixed}(object, ...)
\S4method{ages}{mortalityTable.joined}(object, ...)
\S4method{ages}{mortalityTable.observed}(object, ...)
\S4method{ages}{mortalityTable.jointLives}(object, ...) \S4method{ages}{mortalityTable.jointLives}(object, ...)
} }
\arguments{ \arguments{
...@@ -36,10 +30,6 @@ Return the defined ages of the life table ...@@ -36,10 +30,6 @@ Return the defined ages of the life table
\item \code{mortalityTable.mixed}: Return the defined ages of the mixed life table \item \code{mortalityTable.mixed}: Return the defined ages of the mixed life table
\item \code{mortalityTable.joined}: Return the defined ages of the joined life table
\item \code{mortalityTable.observed}: Return the defined ages of the observed life table
\item \code{mortalityTable.jointLives}: Return the defined ages of the joint lives mortality table (returns the ages of the first table used for joint lives) \item \code{mortalityTable.jointLives}: Return the defined ages of the joint lives mortality table (returns the ages of the first table used for joint lives)
}} }}
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
\alias{getOmega} \alias{getOmega}
\alias{getOmega,mortalityTable.period-method} \alias{getOmega,mortalityTable.period-method}
\alias{getOmega,mortalityTable.mixed-method} \alias{getOmega,mortalityTable.mixed-method}
\alias{getOmega,mortalityTable.joined-method}
\alias{getOmega,mortalityTable.observed-method}
\alias{getOmega,mortalityTable.jointLives-method} \alias{getOmega,mortalityTable.jointLives-method}
\title{Return the maximum age of the life table} \title{Return the maximum age of the life table}
\usage{ \usage{
...@@ -16,10 +14,6 @@ getOmega(object) ...@@ -16,10 +14,6 @@ getOmega(object)
\S4method{getOmega}{mortalityTable.mixed}(object) \S4method{getOmega}{mortalityTable.mixed}(object)
\S4method{getOmega}{mortalityTable.joined}(object)
\S4method{getOmega}{mortalityTable.observed}(object)
\S4method{getOmega}{mortalityTable.jointLives}(object) \S4method{getOmega}{mortalityTable.jointLives}(object)
} }
\arguments{ \arguments{
...@@ -34,10 +28,12 @@ Return the maximum age of the life table ...@@ -34,10 +28,12 @@ Return the maximum age of the life table
\item \code{mortalityTable.mixed}: Return the maximum age of the mixed life table \item \code{mortalityTable.mixed}: Return the maximum age of the mixed life table
\item \code{mortalityTable.joined}: Return the maximum age of the joined life table
\item \code{mortalityTable.observed}: Return the maximum age of the joined 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) \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)
}} }}
\examples{
mortalityTables.load("Austria_Annuities")
getOmega(AVOe2005R.male)
getOmega(mortalityTable.deMoivre(omega = 100))
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mortalityTable.joined.R
\docType{class}
\name{mortalityTable.joined-class}
\alias{mortalityTable.joined-class}
\alias{mortalityTable.joined}
\title{Class mortalityTable.joined - Life table created by joining two life tables}
\description{
A cohort life table obtained by joining two cohort life tables, each of which
applies only to certain observation years (e.g. for the past use the observed
PoDs, and project them to the future with the trend projection)
}
\section{Slots}{
\describe{
\item{\code{table1}}{The first \code{mortalityTable}, valid for years given in \code{yearRange1}}
\item{\code{yearRange1}}{The years, for which \code{table1} describes the death probabilities}
\item{\code{table2}}{The second \code{mortalityTable}, valid for years given in \code{yearRange2}}
\item{\code{yearRange2}}{The years, for which \code{table2} describes the death probabilities}
}}
% 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}
}}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment