Skip to content
Snippets Groups Projects
Commit 09ab7e53 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files
# Conflicts:
#	R/mortalityComparisonTable.R
#	man/mortalityComparisonTable.Rd
parents 3a34c4ca 921eb677
Branches
Tags
No related merge requests found
......@@ -39,3 +39,4 @@ exportMethods(undampenTrend)
import(ggplot2)
import(methods)
import(scales)
import(stats)
#' @import stats
NULL
ageRanges = function(ages, binsize = 5) {
rangestart = floor(ages / binsize) * binsize
......@@ -10,14 +12,22 @@ ageRanges = function(ages, binsize = 5) {
#' @param years Vector of birth years to include in the comparisons.
#' @param ages Vector of ages to include in the comparisons
#' @param binsize How many ages to combine into one age band
#' @param ... Other parameters (currently unused)
#'
#' @examples
#' mortalityTables.load("Austria_Annuities")
#' # Compare mortality of Austrian male and female annuitants born 1930 to 2030
#' mortalityComparisonTable(AVOe2005R.male, AVOe2005R.female, years = seq(1930, 2030, by = 10), ages = 0:119)
#' mortalityComparisonTable(
#' AVOe2005R.male, AVOe2005R.female,
#' years = seq(1930, 2030, by = 10),
#' ages = 0:119)
#'
#' # Compare the two Austrian male annuity tables AVÖ 2005-R and AVÖ 1996-R, combine ages 10-19, 20-29, etc.
#' mortalityComparisonTable(AVOe2005R.male, AVOe1996R.male, years = seq(1930, 2030, by = 10), ages = 0:109, binsize=10)
#' # Compare the two Austrian male annuity tables AVOe 2005-R and AVOe 1996-R,
#' # combining ages 10-19, 20-29, etc.
#' mortalityComparisonTable(
#' AVOe2005R.male, AVOe1996R.male,
#' years = seq(1930, 2030, by = 10),
#' ages = 0:109, binsize=10)
#'
#'
#' @export
......
......@@ -14,6 +14,8 @@ mortalityComparisonTable(table1, table2, years, ages, binsize = 5, ...)
\item{ages}{Vector of ages to include in the comparisons}
\item{binsize}{How many ages to combine into one age band}
\item{...}{Other parameters (currently unused)}
}
\description{
Calculate relative mortalities for age bands and birth years
......@@ -21,10 +23,17 @@ Calculate relative mortalities for age bands and birth years
\examples{
mortalityTables.load("Austria_Annuities")
# Compare mortality of Austrian male and female annuitants born 1930 to 2030
mortalityComparisonTable(AVOe2005R.male, AVOe2005R.female, years = seq(1930, 2030, by = 10), ages = 0:119)
mortalityComparisonTable(
AVOe2005R.male, AVOe2005R.female,
years = seq(1930, 2030, by = 10),
ages = 0:119)
# Compare the two Austrian male annuity tables AVÖ 2005-R and AVÖ 1996-R, combine ages 10-19, 20-29, etc.
mortalityComparisonTable(AVOe2005R.male, AVOe1996R.male, years = seq(1930, 2030, by = 10), ages = 0:109, binsize=10)
# Compare the two Austrian male annuity tables AVOe 2005-R and AVOe 1996-R,
# combining ages 10-19, 20-29, etc.
mortalityComparisonTable(
AVOe2005R.male, AVOe1996R.male,
years = seq(1930, 2030, by = 10),
ages = 0:109, binsize=10)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment