Contenido principal

lifetableconv

Convert life table series into life tables with forced termination

Description

[qx,lx,dx] = lifetableconv(x0,lx0) converts life table with ages x0 and survival counts lx0 into life tables with termination.

example

[qx,lx,dx] = lifetableconv(x0,y0,y0type) converts life table with ages x0 and series y0, specified by the optional argument y0type, into life tables with termination.

example

Examples

collapse all

Load the life table data file.

load us_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.7188
   27.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 the qx series and display the legend. The series qx is the conditional probability that a person at age x will die between age x and 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.

load us_lifetable_2009

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

a = lifetablefit(x,lx)
a = 8×3

    0.0005    0.0006    0.0004
    0.0592    0.0819    0.0192
    0.1452    0.1626    0.1048
    0.0007    0.0011    0.0007
    6.2846    6.7639    1.1036
   24.1387   24.2894   53.1854
    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.9933  686.9434  571.6093
   48.7925   55.1036   40.9874
   24.8017   26.3779   23.6167
   17.0832   17.5878   17.0316
   13.6182   13.8187   13.6141
   11.8663   12.0075   11.6313
   10.9783   11.1572   10.4904
   10.5997   10.8604    9.9488
   10.5758   10.9396    9.8952
   10.8790   11.3612   10.2718
   11.6084   12.2508   11.0419
   12.9920   13.9271   12.1765
   15.3475   16.8834   13.6483
   18.9931   21.6791   15.4302
   24.1383   28.7663   17.4944
   30.7995   38.3212   19.8134
   38.7704   50.1487   22.3603
   47.6526   63.6908   25.1098
   56.9296   78.1271   28.0385
   66.0576   92.5261   31.1257

Plot the dx series and display the legend. The series dx is the number of people who die out of 100,000 alive at birth between age x and 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 Life Table Yearly Decrements, xlabel Age, ylabel Number Dying within a Given Year 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 an N0 vector.

The vector of ages x must contain nonnegative integer values. If the input series is the discrete survival function lx, then the starting age need only be nonnegative. Otherwise, the starting age must be 0.

Data Types: double

Collection of num standardized survivor series, specified as an N0-by-num matrix. The input lx0 series is the number of people alive at age x, given 100,000 alive at birth. Values of 0 or NaN in the input table lx0 are ignored.

Data Types: double

Collection of num life table series to be converted, specified as an N0-by-num matrix. The default y0 series is lx0.

Data Types: double

(Optional) Type of mortality series for input y0, 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 that lx goes to 0, qx goes to 1, and dx goes to 0. For more information, see Natural Termination.

  • Truncated termination stops at a terminal age so that lx is positive, qx is less than 1, and dx is positive. Any ages after the terminal age are NaN values. For more information, see Truncated Termination.

Data Types: char

Output Arguments

collapse all

Discrete hazard function, returned as an N0-by-num matrix with forced termination. For more information, see Forced Termination.

The series qx is the conditional probability that a person at age x will die between age x and the next age in the series.

Discrete survival function, returned as an N0-by-num matrix with forced termination. For more information, see Forced Termination.

The series lx is the number of people alive at age x, given 100,000 alive at birth.

Discrete decrements function, returned as an N0-by-num matrix with forced termination. For more information, see Forced Termination.

The series dx is the number of people who die out of 100,000 alive at birth, between age x and the next age in the series.

More About

collapse all

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