public class LifeTables extends Object implements Serializable, Cloneable
The probability of dying prior to the middle of the interval, given that death occurs somewhere in the interval, may also be specified. Often, however, this probability is taken to be 0.5. For a discussion of the probability models underlying the life table here, see the references.
Let ti, for i = 0, 1, ..., tn denote the time grid defining the n age intervals, and note that the length of the age intervals may vary. Following Gross and Clark (1975, page 24), let di denote the number of individuals dying in age interval i, where age interval i ends at time ti. For population table, the death rate at the middle of the interval is given by ri=di/(Mihi), where Mi is the number of individuals alive at the middle of the interval, and hi=ti−ti−1, t0=0. The number of individuals alive at the beginning of the interval may be estimated by Pi=Mi+(1−ai)di where ai is the probability that an individual dying in the interval dies prior to the interval midpoint. For cohort table, Pi is input directly while the death rate in the interval, ri, is not needed.
The probability that an individual dies during the age interval from ti−1 to ti is given by qi=di/Pi. It is assumed that all individuals alive at the beginning of the last interval die during the last interval. Thus, qn = 1.0. The asymptotic variance of qi can be estimated by
σ2i=qi(1−qi)/PiFor a population table, the number of individuals alive in the middle of
the time interval (input in nCohort[i]
) must be adjusted to
correspond to the number of deaths observed in the interval. The algorithm
assumes that the number of deaths observed in interval hi occur over a time period equal to hi. If
di is measured over a period ui,
where ui≠di, then nCohort[i]
must be
adjusted to correspond to di by multiplication by
ui/hi, i.e., the value Mi input
as nCohort[i]
is computed as
Let Si denote the number of survivors at time
ti from a hypothetical (for population table) or
observed (for cohort table) population. Then, S0
=initialPopulation
for population table, and S0
= nCohort[0]
for cohort table, and Si is
given by Si=Si−1−δi−1 where δi=Siqi is the number of individuals who die in the i
th interval. The proportion of survivors in the interval is given by
Vi=Si/S0 while the asymptotic variance of Vi can be estimated as follows:
The expected lifetime at the beginning of the interval is calculated as the total lifetime remaining for all survivors alive at the beginning of the interval divided by the number of survivors at the beginning of the interval. If ei denotes this average expected lifetime, then the variance of ei can be estimated as (see Chiang 1968)
var(ei)=∑n−1j=iP2jσ2j[ej+1+hj+1(1−aj)]2P2jwhere var(en) = 0.0.
Finally, the total number of time units lived by all survivors in the time interval can be estimated as:
Ui=hi[Si−δi(1−ai)]Constructor and Description |
---|
LifeTables(int[] nCohort,
double[] age,
double[] a)
Constructs a new
LifeTables instance. |
Modifier and Type | Method and Description |
---|---|
double[][] |
getLifeTable()
Compute a cohort table.
|
double[][] |
getPopulationTable(int[] nDeaths)
Compute a population table.
|
void |
setPopulationSize(int initialPopulation)
Sets the population size at the beginning of the first age interval in
requesting a population table.
|
public LifeTables(int[] nCohort, double[] age, double[] a)
LifeTables
instance. The number of classes,
nClasses is equal to the length of the input array nCohort
.nCohort
- an int
array of length nClasses
containing the cohort sizes during each interval. If the
Population Table option is used, then nCohort[i]
contains the size of the population at the
midpoint of interval i
. Otherwise,
nCohort[i]
contains the size of the cohort at the
beginning of interval i
. When requesting a
population table, the population sizes in nCohort
may need to be adjusted to correspond to the
number of deaths in nDeaths
. See the class
description section for more information.age
- a double
array of length nClasses + 1
containing the lowest age in each age interval, and in
age[nClasses]
, the endpoint of the last age interval.
Negative age[0]
indicates that the age intervals
are all of length |age[0]|
and that the initial
age interval is from 0.0 to |age[0]|
. In this
case, all other elements of age need not be specified.
age[nClasses]
need not be specified when getting a
cohort table.a
- a double
array of length nClasses containing
the fraction of those dying within each interval who die before
the interval midpoint. A common choice for all a[i]
is 0.5. This choice may also be specified by setting a[0]
to any negative value. In this case, the remaining
values of a
need not be specified.public double[][] getLifeTable()
double
matrix of dimensions nClasses by 12
containing the population table. Entries in the ith row
are for the age interval defined by age[i]
. Column
definitions are described in the following table.
Column | Description |
0 | Lowest age in the age interval. |
1 | Fraction of those dying within the interval who die before the interval midpoint. |
2 | Number surviving to the beginning of the interval. |
3 | Number of deaths in the interval. |
4 | Death rate in the interval. For cohort table, this column is set to NaN (not a number). |
5 | Proportion dying in the interval. |
6 | Standard error of the proportion dying in the interval. |
7 | Proportion of survivors at the beginning of the interval. |
8 | Standard error of the proportion of survivors at the beginning of the interval. |
9 | Expected lifetime at the beginning of the interval. |
10 | Standard error of the expected life at the beginning of the interval. |
11 | Total number of time units lived by all of the population in the interval. |
public double[][] getPopulationTable(int[] nDeaths)
nDeaths
- an int
array of nClasses containing
the number of deaths in each age interval.double
matrix of dimensions nClasses by 12
containing the population table. Entries in the ith row
are for the age interval defined by age[i]
. Column
definitions are the same as in
getLifeTable
.public void setPopulationSize(int initialPopulation)
nCohorts
and nDeaths
when numbers
are available as percentages.initialPopulation
- an int
scalar specifying the
initial population. Default:
initialPopulation = 10000
.Copyright © 2020 Rogue Wave Software. All rights reserved.