Main Content

lifetableconv

Convert life table series into life tables with forced termination

Description

example

[qx,lx,dx] = lifetableconv(x0,lx0)converts life table with agesx0and survival countslx0into life tables with termination.

example

[qx,lx,dx] = lifetableconv(x0,y0,y0type)converts life table with agesx0and seriesy0, specified by the optional argumenty0type, into life tables with termination.

Examples

collapse all

Load the life table data file.

loadus_lifetable_2009

Convert life table series into life tables with forced termination.

[qx,lx,dx] = lifetableconv(x,lx); display(qx(1:20,:))
0.0064 0.0070 0.0057 0.0004 0.0004 0.0004 0.0003 0.0003 0.0002 0.0002 0.0002 0.0002 0.0002 0.0002 0.0001 0.0001 0.0002 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0002 0.0002 0.0002 0.0003 0.0004 0.0002 0.0004 0.0005 0.0002 0.0005 0.0006 0.0003 0.0005 0.0007 0.0003 0.0006 0.0009 0.0004 0.0007 0.0010 0.0004
display(lx(1:20,:))
1.0e+05 * 1.0000 1.0000 1.0000 0.9936 0.9930 0.9943 0.9932 0.9926 0.9939 0.9930 0.9923 0.9937 0.9927 0.9920 0.9935 0.9926 0.9919 0.9933 0.9924 0.9917 0.9932 0.9923 0.9916 0.9931 0.9922 0.9914 0.9930 0.9921 0.9913 0.9929 0.9920 0.9912 0.9928 0.9919 0.9911 0.9927 0.9918 0.9910 0.9926 0.9917 0.9909 0.9925 0.9915 0.9907 0.9923 0.9912 0.9903 0.9921 0.9908 0.9898 0.9919 0.9904 0.9892 0.9916 0.9899 0.9885 0.9913 0.9892 0.9876 0.9909
display(dx(1:20,:))
637.2266 698.8750 572.6328 40.4062 43.9297 36.718827.1875 30.0938 24.1406 20.7656 23.0781 18.3359 15.9141 17.2109 14.5625 14.8672 16.3125 13.3516 13.3672 14.7891 11.8750 12.1328 13.3828 10.8203 10.8125 11.6094 9.9844 9.4609 9.5781 9.3438 8.6172 8.1328 9.1172 9.2656 8.8359 9.7188 12.5938 13.5078 11.6328 19.1016 22.9844 15.0234 27.6719 35.5938 19.3516 36.6328 48.5703 24.0547 45.0156 60.7109 28.4844 53.1406 72.8906 32.2812 60.8984 85.1172 35.2578 68.3438 97.2266 37.6875

Plot theqxseries and display the legend. The seriesqxis the conditional probability that a person at agexwill die between agexand the next age in the series.

plot(x,log(qx)) legend(series)

Figure contains an axes object. The axes object contains 3 objects of type line. These objects represent All, Male, Female.

Load the life table data file.

loadus_lifetable_2009

Calibrate life table from survival data with the default Heligman-Pollard parametric model.

a = lifetablefit(x,lx)
a =8×30.0005 0.0006 0.0004 0.0592 0.0819 0.0192 0.1452 0.1626 0.1048 0.0007 0.0011 0.0007 6.2852 6.7639 1.1038 24.1386 24.2896 53.1786 0.0000 0.0000 0.0000 1.0971 1.0987 1.1100

Generate life table series from the calibrated mortality model.

qx = lifetablegen((0:120),a); display(qx(1:20,:))
0.0063 0.0069 0.0057 0.0005 0.0006 0.0004 0.0002 0.0003 0.0002 0.0002 0.0002 0.0002 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001 0.0002 0.0002 0.0001 0.0002 0.0002 0.0002 0.0002 0.0003 0.0002 0.0003 0.0004 0.0002 0.0004 0.0005 0.0002 0.0005 0.0006 0.0003 0.0006 0.0008 0.0003 0.0007 0.0009 0.0003

Convert life table series into life tables with forced termination.

[~,~,dx] = lifetableconv((0:120),qx,'qx'); display(dx(1:20,:))
630.9928 686.9409 571.6095 48.7922 55.1031 40.9870 24.8017 26.3780 23.6167 17.0833 17.5879 17.0317 13.6183 13.8189 13.6143 11.8664 12.0077 11.6314 10.9784 11.1574 10.4905 10.5999 10.8605 9.9488 10.5760 10.9396 9.8952 10.8792 11.3613 10.2718 11.6084 12.2508 11.0418 12.9918 13.9270 12.1763 15.3471 16.8832 13.6482 18.9924 21.6787 15.4300 24.1373 28.7656 17.4943 30.7984 38.3203 19.8134 38.7694 50.1476 22.3604 47.6517 63.6895 25.1099 56.9291 78.1258 28.0386 66.0576 92.5249 31.1259

Plot thedxseries and display the legend. The seriesdxis the number of people who die out of 100,000 alive at birth between agexand the next age in the series.

plot((0:119),dx(1:end-1,:)); legend(series,'location','northwest'); title('\bfLife Table Yearly Decrements'); xlabel('Age'); ylabel('Number Dying within a Given Year');

Figure contains an axes object. The axes object with title L i f e blank T a b l e blank Y e a r l y blank D e c r e m e n t s contains 3 objects of type line. These objects represent All, Male, Female.

Input Arguments

collapse all

Increasing ages for raw data, specified as nonnegative integer values in anN0vector.

The vector of agesxmust contain nonnegative integer values. If the input series is the discrete survival functionlx, then the starting age need only be nonnegative. Otherwise, the starting age must be0.

Data Types:double

Collection ofnumstandardized survivor series, specified as anN0-by-nummatrix. The inputlx0series is the number of people alive at agex, given 100,000 alive at birth. Values of0orNaN在put tablelx0are ignored.

Data Types:double

Collection ofnumlife table series to be converted, specified as anN0-by-nummatrix. The defaulty0series islx0.

Data Types:double

(Optional) Type of mortality series for inputy0, specified as a character vector with one of the following values:

  • 'qx'— Input is a table of discrete hazards (qx).

  • 'lx'— Input is a table of discrete survival counts (lx).

  • 'dx'— Input is a table of discrete decrements (dx).

Whereas the output series have forced termination, the input series (y0) can have one of several types of termination:

  • Natural termination runs out to the last person so thatlxgoes to0,qxgoes to1, anddxgoes to0. For more information, seeNatural Termination.

  • Truncated termination stops at a terminal age so thatlxis positive,qxis less than1, anddxis positive. Any ages after the terminal age areNaNvalues. For more information, seeTruncated Termination.

Data Types:char

Output Arguments

collapse all

离散风险函数,作为一个返回N0-by-nummatrix with forced termination. For more information, seeForced Termination.

The seriesqxis the conditional probability that a person at age x will die between agexand the next age in the series.

Discrete survival function, returned as anN0-by-nummatrix with forced termination. For more information, seeForced Termination.

The serieslxis the number of people alive at agex, given 100,000 alive at birth.

Discrete decrements function, returned as anN0-by-nummatrix with forced termination. For more information, seeForced Termination.

The seriesdxis the number of people who die out of 100,000 alive at birth, between agexand the next age in the series.

More About

collapse all

Forced Termination

Most modern life tables have “forced” termination. Forced termination means that the last row of the life table applies for all persons with ages on or after the last age in the life table.

This sample illustrates forced termination.

In this case, the last row of the life table applies for all persons aged 100 or older. Specifically,qxprobabilities are1qxfor ages less than 100 and, technically,qxfor age 100.

Forced termination has terminal age values that apply to all ages after the terminal age so thatlxis positive,qxis1, anddxis positive. Ages after the terminal age areNaNvalues, althoughlxanddxcan be0andqxcan be1for input series. Forced termination is triggered by a naturally terminating series, the last age in a truncated series, or the firstNaNvalue in a series.

Natural Termination

Before 1970, life tables were often published with data that included all ages for which persons associated with a given series were still alive. Tables in this form have "natural" termination. In natural termination, the last row of the life table for each series counts the deaths or probabilities of deaths of the last remaining person at the corresponding age. Tables in this form can be problematic due to the granularity of the data and the fact that groups of series can terminate at distinct ages. Natural termination is illustrated in the following sample of the last few years of a life table.

This form for life tables poses a number of issues that go beyond the obvious statistical issues. First, thelxtable on the left terminates at ages 108, 109, 109, and 113 for the four series in the table. Technically, the numbers after these ages are0, but can also beNaNvalues because no person is alive after these terminating ages. Second, the probabilitiesqxon the right terminate with fluctuating probabilities that go from0to1in some cases. In this case, however, all probabilities are1qxprobabilities (unlike the forced termination probabilities). You can argue that the probabilities after the ages of termination can be1(anyone alive at this age is expected to die in the next year),0(the age lies outside the support of the probability distribution), orNaNvalues.

Truncated Termination

Truncated termination occurs with truncation of life tables at an arbitrary age. For example, from 1970–1990, United States life tables truncated at age 85. This format is problematic because life table probabilities must either terminate with probability1(forced termination) or discard data that exceeds the terminating age. This sample of the last few years of a life table illustrates truncated termination. The raw data for this table is thelxseries. Theqxseries is derived from this series.

This life table format poses problems for termination because, for example, over 27% of the population for the fourthlxseries is still alive at age 85. To claim that the probability of dying for all ages after age 85 is 100% might be true but is uninformative. Notwithstanding the statistical issues, however, tables in this form are completed by forced termination.

References

[1] Arias, E. “United States Life Tables.”National Vital Statistics Reports, U.S. Department of Health and Human Services.Vol. 62, No. 7, 2009.

Version History

Introduced in R2015a