Commit a6b1d47b authored by Reinhold Kainhofer's avatar Reinhold Kainhofer

Add factor information to all mortalityTable objects

parent 998b8712
......@@ -20,7 +20,7 @@ Provided types of mortality tables are:
* Base class
: Class `mortalityTable`
* Period life table
: Class `mortalityTable.period (ages, deathProbs, ..., baseYear=2000)`
: Class `mortalityTable.period(ages, deathProbs, ..., baseYear=2000)`
: Death probabilities observed / predicted for one observation year;
No dependency on the bith year is assumed.
* Cohort life table using age-specific trends
......
......@@ -31,8 +31,11 @@ AVOe1996R.male = mortalityTable.trendProjection(
deathProbs = AVOe1996R.exakt.data$qx1991 * AVOe1996R.exakt.data$factorM,
trend = AVOe1996R.exakt.data$trendM.long,
trend2 = AVOe1996R.exakt.data$trendM.short,
dampingFunction = AVOe1996R.trend.switching
);
dampingFunction = AVOe1996R.trend.switching,
data = list(
dim = list(sex = "m", collar = "Rententafel", type = "Rententafel Österreich", data = "official", year = "AVÖ 1996-R")
)
)
AVOe1996R.female = mortalityTable.trendProjection(
name = "AVÖ 1996R female",
......@@ -40,8 +43,11 @@ AVOe1996R.female = mortalityTable.trendProjection(
deathProbs = AVOe1996R.exakt.data$qy1991 * AVOe1996R.exakt.data$factorF,
trend = AVOe1996R.exakt.data$trendF.long,
trend2 = AVOe1996R.exakt.data$trendF.short,
dampingFunction = AVOe1996R.trend.switching
);
dampingFunction = AVOe1996R.trend.switching,
data = list(
dim = list(sex = "w", collar = "Rententafel", type = "Rententafel Österreich", data = "official", year = "AVÖ 1996-R")
)
)
AVOe1996R.male.group = mortalityTable.trendProjection(
name = "AVÖ 1996R male, group",
......@@ -49,7 +55,10 @@ AVOe1996R.male.group = mortalityTable.trendProjection(
deathProbs = AVOe1996R.exakt.data$qx1991 * AVOe1996R.exakt.data$factorMG,
trend = AVOe1996R.exakt.data$trendM.long,
trend2 = AVOe1996R.exakt.data$trendM.short,
dampingFunction = AVOe1996R.trend.switching
dampingFunction = AVOe1996R.trend.switching,
data = list(
dim = list(sex = "m", collar = "Gruppenrententafel", type = "Rententafel Österreich", data = "official", year = "AVÖ 1996-R")
)
);
AVOe1996R.female.group = mortalityTable.trendProjection(
......@@ -58,20 +67,29 @@ AVOe1996R.female.group = mortalityTable.trendProjection(
deathProbs = AVOe1996R.exakt.data$qy1991 * AVOe1996R.exakt.data$factorFG,
trend = AVOe1996R.exakt.data$trendF.long,
trend2 = AVOe1996R.exakt.data$trendF.short,
dampingFunction = AVOe1996R.trend.switching
dampingFunction = AVOe1996R.trend.switching,
data = list(
dim = list(sex = "w", collar = "Gruppenrententafel", type = "Rententafel Österreich", data = "official", year = "AVÖ 1996-R")
)
);
AVOe1996R.male.av325 = mortalityTable.ageShift(
name = "AVÖ 1996R M mit Altersverschiebung (3,25%)",
ages = ages(AVOe1996R.male),
deathProbs = deathProbabilities(AVOe1996R.male, YOB = 1950),
ageShifts = generateAgeShift(initial = 1, YOBs = c(1922, 1944, 1958, 1973, 1989, 2006, 2023, 2041, 2056))
ageShifts = generateAgeShift(initial = 1, YOBs = c(1922, 1944, 1958, 1973, 1989, 2006, 2023, 2041, 2056)),
data = list(
dim = list(sex = "m", collar = "Rententafel", type = "Rententafel Österreich", data = "Altersverschiebung", year = "AVÖ 1996-R")
)
)
AVOe1996R.female.av325 = mortalityTable.ageShift(
name = "AVÖ 1996R F mit Altersverschiebung (3,25%)",
ages = ages(AVOe1996R.female),
deathProbs = deathProbabilities(AVOe1996R.female, YOB = 1950),
ageShifts = generateAgeShift(initial = 2, YOBs = c(1922, 1932, 1945, 1956, 1968, 1980, 1993, 2007, 2021, 2036, 2051, 2056))
ageShifts = generateAgeShift(initial = 2, YOBs = c(1922, 1932, 1945, 1956, 1968, 1980, 1993, 2007, 2021, 2036, 2051, 2056)),
data = list(
dim = list(sex = "w", collar = "Rententafel", type = "Rententafel Österreich", data = "Altersverschiebung", year = "AVÖ 1996-R")
)
)
rm(AVOe1996R.exakt.data)
......
......@@ -10,13 +10,13 @@ AVOe2005R.exakt.data = utils::read.csv(
system.file(
"extdata",
"Austria_Annuities_AVOe2005R.csv",
package="MortalityTables"),
package = "MortalityTables"),
skip = 2);
AVOe2005R.trend.damping = function(t) {
100*atan(t/100)
}
AVOe2005R_gen = function(nm, probs, trend) {
AVOe2005R_gen = function(nm, probs, trend, sex = "m", data = "loaded") {
with(
AVOe2005R.exakt.data,
mortalityTable.trendProjection(
......@@ -25,28 +25,31 @@ AVOe2005R_gen = function(nm, probs, trend) {
baseYear = 2001,
deathProbs = AVOe2005R.exakt.data[[probs]],
trend = AVOe2005R.exakt.data[[trend]],
dampingFunction = AVOe2005R.trend.damping
dampingFunction = AVOe2005R.trend.damping,
data = list(
dim = list(sex = sex, collar = "Rententafel", type = "Rententafel Österreich", data = data, year = "AVÖ 2005-R")
)
)
)
}
AVOe2005R.male = AVOe2005R_gen("AVÖ 2005R male (exact), loaded", "qx2001", "trendM");
AVOe2005R.female = AVOe2005R_gen("AVÖ 2005R female (exact), loaded", "qy2001", "trendF");
AVOe2005R.unisex = AVOe2005R_gen("AVÖ 2005R unisex (exact), loaded", "qu2001", "trendU");
AVOe2005R.male.unloaded = AVOe2005R_gen("AVÖ 2005R male (exact), unloaded", "qx2001.2Ord", "trendM.2Ord");
AVOe2005R.female.unloaded = AVOe2005R_gen("AVÖ 2005R female (exact), unloaded", "qy2001.2Ord", "trendF.2Ord");
AVOe2005R.male.group = AVOe2005R_gen("AVÖ 2005R male group (exact), loaded", "qx2001G", "trendM");
AVOe2005R.female.group = AVOe2005R_gen("AVÖ 2005R female group (exact), loaded", "qy2001G", "trendF");
AVOe2005R.unisex.group = AVOe2005R_gen("AVÖ 2005R unisex group (exact), loaded", "qu2001G", "trendU");
AVOe2005R.male.nodamping = undampenTrend(AVOe2005R.male);
AVOe2005R.female.nodamping = undampenTrend(AVOe2005R.female);
AVOe2005R.unisex.nodamping = undampenTrend(AVOe2005R.unisex);
AVOe2005R.male.nodamping.unloaded = undampenTrend(AVOe2005R.male.unloaded);
AVOe2005R.female.nodamping.unloaded = undampenTrend(AVOe2005R.female.unloaded);
AVOe2005R.male.nodamping.group = undampenTrend(AVOe2005R.male.group);
AVOe2005R.female.nodamping.group = undampenTrend(AVOe2005R.female.group);
AVOe2005R.unisex.nodamping.group = undampenTrend(AVOe2005R.unisex.group);
AVOe2005R.male = AVOe2005R_gen("AVÖ 2005R male (exact), loaded", "qx2001", "trendM", sex = "m", data = "loaded");
AVOe2005R.female = AVOe2005R_gen("AVÖ 2005R female (exact), loaded", "qy2001", "trendF", sex = "w", data = "loaded");
AVOe2005R.unisex = AVOe2005R_gen("AVÖ 2005R unisex (exact), loaded", "qu2001", "trendU", sex = "u", data = "loaded");
AVOe2005R.male.unloaded = AVOe2005R_gen("AVÖ 2005R male (exact), unloaded", "qx2001.2Ord", "trendM.2Ord", sex = "m", data = "unloaded");
AVOe2005R.female.unloaded = AVOe2005R_gen("AVÖ 2005R female (exact), unloaded", "qy2001.2Ord", "trendF.2Ord", sex = "w", data = "unloaded");
AVOe2005R.male.group = AVOe2005R_gen("AVÖ 2005R male group (exact), loaded", "qx2001G", "trendM", sex = "m", data = "loaded, group");
AVOe2005R.female.group = AVOe2005R_gen("AVÖ 2005R female group (exact), loaded", "qy2001G", "trendF", sex = "w", data = "loaded, group");
AVOe2005R.unisex.group = AVOe2005R_gen("AVÖ 2005R unisex group (exact), loaded", "qu2001G", "trendU", sex = "u", data = "loaded, group");
AVOe2005R.male.nodamping = mT.setDimInfo(undampenTrend(AVOe2005R.male), data = "loaded, no trend damping")
AVOe2005R.female.nodamping = mT.setDimInfo(undampenTrend(AVOe2005R.female), data = "loaded, no trend damping");
AVOe2005R.unisex.nodamping = mT.setDimInfo(undampenTrend(AVOe2005R.unisex), data = "loaded, no trend damping");
AVOe2005R.male.nodamping.unloaded = mT.setDimInfo(undampenTrend(AVOe2005R.male.unloaded), data = "unloaded, no trend damping");
AVOe2005R.female.nodamping.unloaded = mT.setDimInfo(undampenTrend(AVOe2005R.female.unloaded), data = "unloaded, no trend damping");
AVOe2005R.male.nodamping.group = mT.setDimInfo(undampenTrend(AVOe2005R.male.group), data = "loaded, group, no trend damping");
AVOe2005R.female.nodamping.group = mT.setDimInfo(undampenTrend(AVOe2005R.female.group), data = "loaded, group, no trend damping");
AVOe2005R.unisex.nodamping.group = mT.setDimInfo(undampenTrend(AVOe2005R.unisex.group), data = "loaded, group, no trend damping");
###############################################################################
......@@ -58,43 +61,46 @@ AVOe2005R.av.base = utils::read.csv(
system.file(
"extdata",
"Austria_Annuities_AVOe2005R_AVBasis.csv",
package="MortalityTables"),
skip=2);
package = "MortalityTables"),
skip = 2);
AVOe2005R.av.verschiebung = utils::read.csv(
system.file(
"extdata",
"Austria_Annuities_AVOe2005R_AVShifts.csv",
package="MortalityTables"),
row.names=1,
skip=2);
package = "MortalityTables"),
row.names = 1,
skip = 2);
AVOe2005R_gen.av = function(nm, probs, shft) {
AVOe2005R_gen.av = function(nm, probs, shft, sex = "m", data = "age-shift, loaded") {
mortalityTable.ageShift(
name = nm,
ages = AVOe2005R.av.base$age,
deathProbs = AVOe2005R.av.base[[probs]],
ageShifts = na.omit(AVOe2005R.av.verschiebung[shft])
ageShifts = na.omit(AVOe2005R.av.verschiebung[shft]),
data = list(
dim = list(sex = sex, collar = "Rententafel", type = "Rententafel Österreich", data = data, year = "AVÖ 2005-R")
)
)
}
AVOe2005R.male.av = AVOe2005R_gen.av(
"AVÖ 2005R male (age-shifted), loaded",
"qx1965", "shiftM");
"qx1965", "shiftM", sex = "m", data = "age-shift, loaded");
AVOe2005R.female.av = AVOe2005R_gen.av(
"AVÖ 2005R female (age-shifted), loaded",
"qy1965", "shiftF");
"qy1965", "shiftF", sex = "w", data = "age-shift, loaded");
AVOe2005R.unisex.av = AVOe2005R_gen.av(
"AVÖ 2005R unisex (age-shifted), loaded",
"qu1972", "shiftU");
"qu1972", "shiftU", sex = "u", data = "age-shift, loaded");
AVOe2005R.male.group.av = AVOe2005R_gen.av(
"AVÖ 2005R male group (age-shifted), loaded",
"qx1965G", "shiftMG");
"qx1965G", "shiftMG", sex = "m", data = "age-shift, loaded, group");
AVOe2005R.female.group.av = AVOe2005R_gen.av(
"AVÖ 2005R female group (age-shifted), loaded",
"qy1965G", "shiftFG");
"qy1965G", "shiftFG", sex = "w", data = "age-shift, loaded, group");
AVOe2005R.unisex.group.av = AVOe2005R_gen.av(
"AVÖ 2005R unisex group (age-shifted), loaded",
"qu1972G", "shiftUG")
"qu1972G", "shiftUG", sex = "u", data = "age-shift, loaded, group")
......
......@@ -9,41 +9,53 @@ eromf.data = utils::read.csv(
system.file(
"extdata",
"Austria_Annuities_EROMF.csv",
package="MortalityTables"),
skip=2)
package = "MortalityTables"),
skip = 2)
eromf.data.av = utils::read.csv(
system.file(
"extdata",
"Austria_Annuities_EROMF_AV.csv",
package="MortalityTables"),
skip=2)
package = "MortalityTables"),
skip = 2)
EROM85.male = mortalityTable.period(
name = "EROM 85, male",
ages = eromf.data$Alter,
deathProbs = eromf.data$EROM.85
deathProbs = eromf.data$EROM.85,
data = list(
dim = list(sex = "m", collar = "Rententafel", type = "Rententafel Österreich", data = "unloaded", year = "EROM 85")
)
);
EROF85.female = mortalityTable.period(
name = "EROF 85, female",
ages = eromf.data$Alter,
deathProbs = eromf.data$EROF.85
deathProbs = eromf.data$EROF.85,
data = list(
dim = list(sex = "w", collar = "Rententafel", type = "Rententafel Österreich", data = "unloaded", year = "EROF 85")
)
);
EROM.G1950.male = mortalityTable.period(
name = "EROM G 1950 Basistafel, male",
ages = eromf.data$Alter,
deathProbs = eromf.data$EROM.G1950,
baseYear = 1950
baseYear = 1950,
data = list(
dim = list(sex = "m", collar = "Rententafel", type = "Rententafel Österreich", data = "unloaded", year = "EROM G1950")
)
);
EROF.G1950.female = mortalityTable.period(
name = "EROF G 1950 Basistafel, female",
ages = eromf.data$Alter,
deathProbs = eromf.data$EROF.G1950,
baseYear = 1950
baseYear = 1950,
data = list(
dim = list(sex = "w", collar = "Rententafel", type = "Rententafel Österreich", data = "unloaded", year = "EROF G1950")
)
);
......@@ -52,14 +64,20 @@ EROM.G1950.male.av = mortalityTable.ageShift(
ages = eromf.data$Alter,
deathProbs = eromf.data$EROM.G1950,
ageShifts = eromf.data.av["Shift.M"],
baseYear = 1950
baseYear = 1950,
data = list(
dim = list(sex = "m", collar = "Rententafel", type = "Rententafel Österreich", data = "age-shifted", year = "EROM G1950 AV")
)
);
EROF.G1950.female.av = mortalityTable.ageShift(
name = "EROF G 1950 mit Altersverschiebung, female",
ages = eromf.data$Alter,
deathProbs = eromf.data$EROF.G1950,
ageShifts = eromf.data.av["Shift.F"],
baseYear = 1950
baseYear = 1950,
data = list(
dim = list(sex = "w", collar = "Rententafel", type = "Rententafel Österreich", data = "age-shifted", year = "EROF G1950 AV")
)
);
rm(eromf.data, eromf.data.av)
......
......@@ -5,12 +5,15 @@ stopifnot(require(methods), require(utils), require(MortalityTables)) # Mortalit
### RR67 Rententafel für Männer, 3%
###############################################################################
rr67.data = utils::read.csv(system.file("extdata", "Austria_Annuities_RR67.csv", package="MortalityTables"), skip=2)
rr67.data = utils::read.csv(system.file("extdata", "Austria_Annuities_RR67.csv", package = "MortalityTables"), skip = 2)
RR67 = mortalityTable.period(
name = "ÖVM 59/61 RR67",
ages = rr67.data$Alter,
deathProbs = rr67.data$qx
);
deathProbs = rr67.data$qx,
data = list(
dim = list(sex = "m", collar = "Rententafel", type = "Rententafel Österreich", data = "official", year = "RR67")
)
)
rm(rr67.data)
......@@ -6,44 +6,52 @@ stopifnot(require(methods), require(utils), require(MortalityTables)) # Mortalit
###############################################################################
a.vz.dataM = utils::read.csv(system.file("extdata", "Austria_Census_Male.csv", package="MortalityTables"), skip=3);
a.vz.dataF = utils::read.csv(system.file("extdata", "Austria_Census_Female.csv", package="MortalityTables"), skip=3);
a.vz.dataM = utils::read.csv(system.file("extdata", "Austria_Census_Male.csv", package = "MortalityTables"), skip = 3);
a.vz.dataF = utils::read.csv(system.file("extdata", "Austria_Census_Female.csv", package="MortalityTables"), skip = 3);
censtable = function(data, name, qslot, baseYear=1900) {
qx=data[names(data)==qslot];
ix=complete.cases(qx);
mortalityTable.period(name=name, ages=data$x[ix], deathProbs=qx[ix,], baseYear=baseYear)
censtable = function(data, name, qslot, baseYear=1900, sex = "m") {
qx = data[names(data) == qslot];
ix = complete.cases(qx);
mortalityTable.period(name = name, ages = data$x[ix], deathProbs = qx[ix,], baseYear = baseYear,
data = list(
dim = list(sex = s, collar = "Gesamtbevölkerung", type = "Volkssterbetafel Österreich", data = "official", year = baseYear)
)
)
}
mort.AT.census.1869.male = censtable(a.vz.dataM, name="ÖVSt 1868/71 M", baseYear=1869, qslot="X1868.71");
mort.AT.census.1880.male = censtable(a.vz.dataM, name="ÖVSt 1879/82 M", baseYear=1880, qslot="X1879.82");
mort.AT.census.1890.male = censtable(a.vz.dataM, name="ÖVSt 1889/92 M", baseYear=1890, qslot="X1889.92");
mort.AT.census.1900.male = censtable(a.vz.dataM, name="ÖVSt 1899/1902 M", baseYear=1900, qslot="X1899.1902");
mort.AT.census.1910.male = censtable(a.vz.dataM, name="ÖVSt 1909/12 M", baseYear=1910, qslot="X1909.12");
mort.AT.census.1931.male = censtable(a.vz.dataM, name="ÖVSt 1930/33 M", baseYear=1931, qslot="X1930.33");
mort.AT.census.1951.male = censtable(a.vz.dataM, name="ÖVSt 1949/51 M", baseYear=1951, qslot="X1949.51");
mort.AT.census.1961.male = censtable(a.vz.dataM, name="ÖVSt 1959/61 M", baseYear=1961, qslot="X1959.61");
mort.AT.census.1971.male = censtable(a.vz.dataM, name="ÖVSt 1970/72 M", baseYear=1971, qslot="X1970.72");
mort.AT.census.1981.male = censtable(a.vz.dataM, name="ÖVSt 1980/82 M", baseYear=1981, qslot="X1980.82");
mort.AT.census.1991.male = censtable(a.vz.dataM, name="ÖVSt 1990/92 M", baseYear=1991, qslot="X1990.92");
mort.AT.census.2001.male = censtable(a.vz.dataM, name="ÖVSt 2000/02 M", baseYear=2001, qslot="X2000.02");
mort.AT.census.2011.male = censtable(a.vz.dataM, name="ÖVSt 2010/2012 M", baseYear=2011, qslot="X2010.12");
mort.AT.census.1869.male = censtable(a.vz.dataM, name="ÖVSt 1868/71 M", baseYear=1869, qslot="X1868.71", sex = "m")
mort.AT.census.1880.male = censtable(a.vz.dataM, name="ÖVSt 1879/82 M", baseYear=1880, qslot="X1879.82", sex = "m")
mort.AT.census.1890.male = censtable(a.vz.dataM, name="ÖVSt 1889/92 M", baseYear=1890, qslot="X1889.92", sex = "m")
mort.AT.census.1900.male = censtable(a.vz.dataM, name="ÖVSt 1899/1902 M", baseYear=1900, qslot="X1899.1902", sex = "m")
mort.AT.census.1910.male = censtable(a.vz.dataM, name="ÖVSt 1909/12 M", baseYear=1910, qslot="X1909.12", sex = "m")
mort.AT.census.1931.male = censtable(a.vz.dataM, name="ÖVSt 1930/33 M", baseYear=1931, qslot="X1930.33", sex = "m")
mort.AT.census.1951.male = censtable(a.vz.dataM, name="ÖVSt 1949/51 M", baseYear=1951, qslot="X1949.51", sex = "m")
mort.AT.census.1961.male = censtable(a.vz.dataM, name="ÖVSt 1959/61 M", baseYear=1961, qslot="X1959.61", sex = "m")
mort.AT.census.1971.male = censtable(a.vz.dataM, name="ÖVSt 1970/72 M", baseYear=1971, qslot="X1970.72", sex = "m")
mort.AT.census.1981.male = censtable(a.vz.dataM, name="ÖVSt 1980/82 M", baseYear=1981, qslot="X1980.82", sex = "m")
mort.AT.census.1991.male = censtable(a.vz.dataM, name="ÖVSt 1990/92 M", baseYear=1991, qslot="X1990.92", sex = "m")
mort.AT.census.2001.male = censtable(a.vz.dataM, name="ÖVSt 2000/02 M", baseYear=2001, qslot="X2000.02", sex = "m")
mort.AT.census.2011.male = censtable(a.vz.dataM, name="ÖVSt 2010/2012 M", baseYear=2011, qslot="X2010.12", sex = "m")
mort.AT.census.1869.female = censtable(a.vz.dataF, name="ÖVSt 1868/71 F", baseYear=1869, qslot="X1868.71");
mort.AT.census.1880.female = censtable(a.vz.dataF, name="ÖVSt 1879/82 F", baseYear=1880, qslot="X1879.82");
mort.AT.census.1890.female = censtable(a.vz.dataF, name="ÖVSt 1889/92 F", baseYear=1890, qslot="X1889.92");
mort.AT.census.1900.female = censtable(a.vz.dataF, name="ÖVSt 1899/1902 F", baseYear=1900, qslot="X1899.1902");
mort.AT.census.1910.female = censtable(a.vz.dataF, name="ÖVSt 1909/12 F", baseYear=1910, qslot="X1909.12");
mort.AT.census.1931.female = censtable(a.vz.dataF, name="ÖVSt 1930/33 F", baseYear=1931, qslot="X1930.33");
mort.AT.census.1951.female = censtable(a.vz.dataF, name="ÖVSt 1949/51 F", baseYear=1951, qslot="X1949.51");
mort.AT.census.1961.female = censtable(a.vz.dataF, name="ÖVSt 1959/61 F", baseYear=1961, qslot="X1959.61");
mort.AT.census.1971.female = censtable(a.vz.dataF, name="ÖVSt 1970/72 F", baseYear=1971, qslot="X1970.72");
mort.AT.census.1981.female = censtable(a.vz.dataF, name="ÖVSt 1980/82 F", baseYear=1981, qslot="X1980.82");
mort.AT.census.1991.female = censtable(a.vz.dataF, name="ÖVSt 1990/92 F", baseYear=1991, qslot="X1990.92");
mort.AT.census.2001.female = censtable(a.vz.dataF, name="ÖVSt 2000/02 F", baseYear=2001, qslot="X2000.02");
mort.AT.census.2011.female = censtable(a.vz.dataF, name="ÖVSt 2010/2012 F", baseYear=2011, qslot="X2010.12");
mort.AT.census.1869.female = censtable(a.vz.dataF, name="ÖVSt 1868/71 F", baseYear=1869, qslot="X1868.71", sex = "w")
mort.AT.census.1880.female = censtable(a.vz.dataF, name="ÖVSt 1879/82 F", baseYear=1880, qslot="X1879.82", sex = "w")
mort.AT.census.1890.female = censtable(a.vz.dataF, name="ÖVSt 1889/92 F", baseYear=1890, qslot="X1889.92", sex = "w")
mort.AT.census.1900.female = censtable(a.vz.dataF, name="ÖVSt 1899/1902 F", baseYear=1900, qslot="X1899.1902", sex = "w")
mort.AT.census.1910.female = censtable(a.vz.dataF, name="ÖVSt 1909/12 F", baseYear=1910, qslot="X1909.12", sex = "w")
mort.AT.census.1931.female = censtable(a.vz.dataF, name="ÖVSt 1930/33 F", baseYear=1931, qslot="X1930.33", sex = "w")
mort.AT.census.1951.female = censtable(a.vz.dataF, name="ÖVSt 1949/51 F", baseYear=1951, qslot="X1949.51", sex = "w")
mort.AT.census.1961.female = censtable(a.vz.dataF, name="ÖVSt 1959/61 F", baseYear=1961, qslot="X1959.61", sex = "w")
mort.AT.census.1971.female = censtable(a.vz.dataF, name="ÖVSt 1970/72 F", baseYear=1971, qslot="X1970.72", sex = "w")
mort.AT.census.1981.female = censtable(a.vz.dataF, name="ÖVSt 1980/82 F", baseYear=1981, qslot="X1980.82", sex = "w")
mort.AT.census.1991.female = censtable(a.vz.dataF, name="ÖVSt 1990/92 F", baseYear=1991, qslot="X1990.92", sex = "w")
mort.AT.census.2001.female = censtable(a.vz.dataF, name="ÖVSt 2000/02 F", baseYear=2001, qslot="X2000.02", sex = "w")
mort.AT.census.2011.female = censtable(a.vz.dataF, name="ÖVSt 2010/2012 F", baseYear=2011, qslot="X2010.12", sex = "w")
mort.AT.census.2001.unisex = mortalityTable.mixed(table1=mort.AT.census.2001.male, table2=mort.AT.census.2001.female)
mort.AT.census.2001.unisex = mortalityTable.mixed(table1=mort.AT.census.2001.male, table2=mort.AT.census.2001.female,
data = list(
dim = list(sex = "u", collar = "Gesamtbevölkerung", type = "Volkssterbetafel Österreich", data = "official", year = 2001)
)
)
mort.AT.census.ALL.male = MortalityTables::makeQxDataFrame(
mort.AT.census.1869.male,
......
......@@ -15,7 +15,11 @@ ADSt2426.2Lives.data = utils::read.csv(
ADSt2426.2Lives = mortalityTable.period(
name = "ADSt 1924/26 Männer, 2 Leben",
ages = ADSt2426.2Lives.data$xx,
deathProbs = ADSt2426.2Lives.data$qxx)
deathProbs = ADSt2426.2Lives.data$qxx,
data = list(
dim = list(sex = "m", collar = "2-Leben", type = "Sterbetafel Deutschland", data = "verbundene Leben", year = "1924/26")
)
)
rm(ADSt2426.2Lives.data)
......@@ -14,14 +14,20 @@ mort.AT.forecast.male = mortalityTable.trendProjection(
baseYear = 2014,
deathProbs = AT.pop.fc$q.Männer.2014,
trend = -AT.pop.fc$Männer,
ages = AT.pop.fc$X
ages = AT.pop.fc$X,
data = list(
dim = list(sex = "m", collar = "Gesamtbevölkerung", type = "Bevölkerungsprognose", data = "official", year = "2014-2080")
)
)
mort.AT.forecast.female = mortalityTable.trendProjection(
name = "Österreich Frauen (mittl. Sz.)",
baseYear = 2014,
deathProbs = AT.pop.fc$q.Frauen.2014,
trend = -AT.pop.fc$Frauen,
ages = AT.pop.fc$X
ages = AT.pop.fc$X,
data = list(
dim = list(sex = "w", collar = "Gesamtbevölkerung", type = "Bevölkerungsprognose", data = "official", year = "2014-2080")
)
)
rm(AT.pop.fc)
......
......@@ -30,7 +30,10 @@ DAV1994R.male = mortalityTable.trendProjection(
ages = DAV1994R.exakt.data$age,
baseYear = 2000,
deathProbs = DAV1994R.exakt.data$qx2000,
trend = DAV1994R.exakt.data$trendM
trend = DAV1994R.exakt.data$trendM,
data = list(
dim = list(sex = "m", collar = "Rententafel", type = "Rententafel Deutschland", data = "loaded", year = "DAV 1994R")
)
);
DAV1994R.female = mortalityTable.trendProjection(
......@@ -38,7 +41,10 @@ DAV1994R.female = mortalityTable.trendProjection(
ages = DAV1994R.exakt.data$age,
baseYear = 2000,
deathProbs = DAV1994R.exakt.data$qxAVbase1955,
trend = DAV1994R.exakt.data$trendF
trend = DAV1994R.exakt.data$trendF,
data = list(
dim = list(sex = "w", collar = "Rententafel", type = "Rententafel Deutschland", data = "loaded", year = "DAV 1994R")
)
);
......@@ -47,14 +53,20 @@ DAV1994R.male.av = mortalityTable.ageShift(
name = "DAV 1994R male, age-shifted",
ages = DAV1994R.exakt.data$age,
deathProbs = DAV1994R.exakt.data$qxAVbase1955,
ageShifts = DAV1994R.av.data["AS.Male"]
ageShifts = DAV1994R.av.data["AS.Male"],
data = list(
dim = list(sex = "m", collar = "Rententafel", type = "Rententafel Deutschland", data = "age-shifted", year = "DAV 1994R")
)
);
DAV1994R.female.av = mortalityTable.ageShift(
name = "DAV 1994R female, age-shifted",
ages = DAV1994R.exakt.data$age,
deathProbs = DAV1994R.exakt.data$qyAVbase1955,
ageShifts = DAV1994R.av.data["AS.Female"]
ageShifts = DAV1994R.av.data["AS.Female"],
data = list(
dim = list(sex = "w", collar = "Rententafel", type = "Rententafel Deutschland", data = "age-shifted", year = "DAV 1994R")
)
);
......
......@@ -71,15 +71,21 @@ DAV2004R.male = mortalityTable.trendProjection(
ages = DAV2004R.data.basistafeln$age,
baseYear = 1999,
deathProbs = DAV2004R.data.basistafeln$qxAgg,
trend = DAV2004R.data.trend$trend1Ord.male
);
trend = DAV2004R.data.trend$trend1Ord.male,
data = list(
dim = list(sex = "m", collar = "Aggregat", type = "Rententafel", data = "loaded", year = "DAV 2004R")
)
)
DAV2004R.female = mortalityTable.trendProjection(
name = "DAV 2004R female, aggregate, loaded",
ages = DAV2004R.data.basistafeln$age,
baseYear = 1999,
deathProbs = DAV2004R.data.basistafeln$qyAgg,
trend = DAV2004R.data.trend$trend1Ord.female
trend = DAV2004R.data.trend$trend1Ord.female,
data = list(
dim = list(sex = "w", collar = "Aggregat", type = "Rententafel", data = "loaded", year = "DAV 2004R")
)
)
......@@ -88,15 +94,21 @@ DAV2004R.male.2Ord = mortalityTable.trendProjection(
ages = DAV2004R.data.basistafeln$age,
baseYear = 1999,
deathProbs = DAV2004R.data.basistafeln$qxAgg,
trend = DAV2004R.data.trend$trend2Ord.male.start
);
trend = DAV2004R.data.trend$trend2Ord.male.start,
data = list(
dim = list(sex = "m", collar = "Aggregat", type = "Rententafel", data = "unloaded", year = "DAV 2004R")
)
)
DAV2004R.female.2Ord = mortalityTable.trendProjection(
name = "DAV 2004R female, aggregate, unloaded, no trend dampening",
ages = DAV2004R.data.basistafeln$age,
baseYear = 1999,
deathProbs = DAV2004R.data.basistafeln$qyAgg,
trend = DAV2004R.data.trend$trend2Ord.female.start
trend = DAV2004R.data.trend$trend2Ord.female.start,
data = list(
dim = list(sex = "w", collar = "Aggregat", type = "Rententafel", data = "unloaded", year = "DAV 2004R")
)
)
......@@ -105,26 +117,38 @@ DAV2004R.male.av = mortalityTable.ageShift(
name = "DAV 2004R male, age-shifted, aggregate, loaded",
ages = DAV2004R.data.av.grundtafeln$age,
deathProbs = DAV2004R.data.av.grundtafeln$qx1Ord,
ageShifts = DAV2004R.data.av["shiftM1Ord"]
);
ageShifts = DAV2004R.data.av["shiftM1Ord"],
data = list(
dim = list(sex = "m", collar = "Aggregat", type = "Rententafel", data = "age-shifted, loaded", year = "DAV 2004R")
)
)
DAV2004R.female.av = mortalityTable.ageShift(
name = "DAV 2004R female, age-shifted, aggregate, loaded",
ages = DAV2004R.data.av.grundtafeln$age,
deathProbs = DAV2004R.data.av.grundtafeln$qy1Ord,
ageShifts = DAV2004R.data.av["shiftF1Ord"]
ageShifts = DAV2004R.data.av["shiftF1Ord"],
data = list(
dim = list(sex = "w", collar = "Aggregat", type = "Rententafel", data = "age-shifted, loaded", year = "DAV 2004R")
)
)
DAV2004R.male.av.2Ord = mortalityTable.ageShift(
name = "DAV 2004R male, age-shifted, aggregate, unloaded, no trend dampening",
ages = DAV2004R.data.av.grundtafeln$age,
deathProbs = DAV2004R.data.av.grundtafeln$qxBestand,
ageShifts = DAV2004R.data.av["shiftMBestand"]
);
ageShifts = DAV2004R.data.av["shiftMBestand"],
data = list(
dim = list(sex = "m", collar = "Aggregat", type = "Rententafel", data = "age-shifted, unloaded", year = "DAV 2004R")
)
)
DAV2004R.female.av.2Ord = mortalityTable.ageShift(
name = "DAV 2004R female, age-shifted, aggregate, unloaded, no trend dampening",
ages = DAV2004R.data.av.grundtafeln$age,
deathProbs = DAV2004R.data.av.grundtafeln$qyBestand,
ageShifts = DAV2004R.data.av["shiftFBestand"]
ageShifts = DAV2004R.data.av["shiftFBestand"],
data = list(
dim = list(sex = "w", collar = "Aggregat", type = "Rententafel", data = "age-shifted, unloaded", year = "DAV 2004R")
)
)
......
......@@ -6,38 +6,42 @@ stopifnot(require(methods), require(utils), require(MortalityTables))
###############################################################################
de.vz.dataDR = utils::read.csv(system.file("extdata", "Germany_Census_DeutschesReich.csv", package="MortalityTables"), skip=3);
de.vz.dataBRD = utils::read.csv(system.file("extdata", "Germany_Census_BRD.csv", package="MortalityTables"), skip=3);
censtable = function(data, name, qslot, baseYear=1900) {
qx=data[names(data)==qslot];