JMSLTM Numerical Library 6.1

com.imsl.stat
Class LifeTables

java.lang.Object
  extended by com.imsl.stat.LifeTables
All Implemented Interfaces:
Serializable, Cloneable

public class LifeTables
extends Object
implements Serializable, Cloneable

Computes population (current) or cohort life tables based upon the observed population sizes at the middle (for population table) or the beginning (for cohort table) of some user specified age intervals. The number of deaths in each of these intervals must also be observed.

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 t_i, for i = 0, 1, ..., t_n 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 d_i denote the number of individuals dying in age interval i, where age interval i ends at time t_i. For population table, the death rate at the middle of the interval is given by r_i=d_i/(M_i h_i), where M_i is the number of individuals alive at the middle of the interval, and h_i=t_i-t_{i-1}, t_0=0. The number of individuals alive at the beginning of the interval may be estimated by P_i=M_i+(1-a_i)d_i where a_i is the probability that an individual dying in the interval dies prior to the interval midpoint. For cohort table, P_i is input directly while the death rate in the interval, r_i, is not needed.

The probability that an individual dies during the age interval from t_{i-1} to t_i is given by q_i=d_i/P_i. It is assumed that all individuals alive at the beginning of the last interval die during the last interval. Thus, q_n = 1.0. The asymptotic variance of q_i can be estimated by

sigma_i^2=q_i(1-q_i)/P_i

For 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 h_i occur over a time period equal to h_i. If d_i is measured over a period u_i, where u_i neq d_i, then nCohort[i] must be adjusted to correspond to d_i by multiplication by u_i/h_i, i.e., the value M_i input as nCohort[i] is computed as

M_i^*=M_iu_i/h_i

Let S_i denote the number of survivors at time t_i from a hypothetical (for population table) or observed (for cohort table) population. Then, S_0 =initialPopulation for population table, and S_0 = nCohort[0] for cohort table, and S_i is given by S_i=S_{i-1}-delta_{i-1} where delta_i=S_iq_i is the number of individuals who die in the i th interval. The proportion of survivors in the interval is given by V_i=S_i/S_0 while the asymptotic variance of V_i can be estimated as follows:

textup{var}(V_i)=V_i^2sum_{j=1}^{i-1}frac{
 sigma_j^2}{left ( 1-q_j right )^2}

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 e_i denotes this average expected lifetime, then the variance of e_i can be estimated as (see Chiang 1968)

textup{var}(e_i)=frac{sum_{j=i}^{n-1}P_j^2
 sigma_j^2left [ e_{j+1}+h_{j+1}(1-a_j) right ]^2}{P_j^2}

where var(e_n) = 0.0.

Finally, the total number of time units lived by all survivors in the time interval can be estimated as:

U_i=h_i[S_i-delta_i(1-a_i)]

See Also:
Example, Serialized Form

Constructor Summary
LifeTables(int[] nCohort, double[] age, double[] a)
          Constructs a new LifeTables instance.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LifeTables

public LifeTables(int[] nCohort,
                  double[] age,
                  double[] a)
Constructs a new LifeTables instance. The number of classes, nClasses is equal to the length of the input array nCohort .

Parameters:
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.
Method Detail

getLifeTable

public double[][] getLifeTable()
Compute a cohort table.

Returns:
a 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.


getPopulationTable

public double[][] getPopulationTable(int[] nDeaths)
Compute a population table.

Parameters:
nDeaths - an int array of nClasses containing the number of deaths in each age interval.
Returns:
a 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.

setPopulationSize

public void setPopulationSize(int initialPopulation)
Sets the population size at the beginning of the first age interval in requesting a population table. A default value of 10,000 is used to allow easy entry of nCohorts and nDeaths when numbers are available as percentages.

Parameters:
initialPopulation - an int scalar specifying the initial population. Default: initialPopulation = 10000.

JMSLTM Numerical Library 6.1

Copyright © 1970-2010 Visual Numerics, Inc.
Built July 30 2010.