Description Usage Arguments Details Value Author(s) See Also Examples
Compute the historical and forecasted life expectancy of a series of fitted Lee-Carter models and plot them in one comparative figure
1 | matfle.plot(lca.obj, lca.base, at = 65, label = NULL, ...)
|
lca.obj |
a list of fitted model objects of class |
lca.base |
base fitted model object of class |
at |
target age at which to calculate life expectancy |
label |
a data label |
... |
additional arguments to |
It makes use of the life.expectancy
and forecast
functions from the demography
and forecast
packages, respectively, in order to compute life expectancy at the specified target age for each of the model objects in lca.obj
.
Plot
Z. Butt and S. Haberman and H. L. Shang
matflc.plot
, fle.plot
, elca.rh
1 2 3 4 5 6 7 | rfp.cmi <- dd.rfp(dd.cmi.pens, c(0.5, 1.2, -0.7, 2.5))
mod6e <- elca.rh(rfp.cmi, age=50:100, interpolate=TRUE, dec=3)
# plot with original (fitted) base values
matfle.plot(mod6e$lca, label='RFP CMI')
# use a standard LC model fitting as base values
mod6 <- lca.rh(dd.cmi.pens, mod='lc', error='gauss', interpolate=TRUE)
matfle.plot(mod6e$lca, mod6, label='RFP CMI')
|
Loading required package: demography
Loading required package: forecast
This is demography 1.21
Loading required package: rainbow
Loading required package: MASS
Loading required package: pcaPP
Loading required package: date
Original sample: Multidimensional Mortality data for: CMI [male]
Across covariates:
years: 1983 - 2003
ages: 50 - 108
X: base, a, b, c, d
Applied sample: Multidimensional Mortality data for: CMI [male]
Across covariates:
years: 1983 - 2003
ages: 50 - 100
X: base, a, b, c, d
Fitting model: [ LC(g) = a(x)+a(g)+b(x)*k(t) ]
- with poisson error structure and with deaths as weights -
Note: 1129 cells have 0/NA deaths and 141 have 0/NA exposure
out of a total of 5355 data cells.
Starting values are:
age age.c int.c per per.c X4 X4.c
1 1 -1.780 0.02 1983 0 base 0
2 2 -2.509 0.02 1984 0 a 0
3 3 -3.091 0.02 1985 0 b 0
4 4 -3.298 0.02 1986 0 c 0
5 5 -3.121 0.02 1987 0 d 0
6 6 -3.059 0.02 1988 0
7 7 -3.398 0.02 1989 0
8 8 -3.132 0.02 1990 0
9 9 -3.403 0.02 1991 0
10 10 -3.085 0.02 1992 0
11 11 -3.215 0.02 1993 0
12 12 -3.227 0.02 1994 0
13 13 -3.346 0.02 1995 0
14 14 -2.991 0.02 1996 0
15 15 -2.706 0.02 1997 0
16 16 -2.648 0.02 1998 0
17 17 -2.638 0.02 1999 0
18 18 -2.586 0.02 2000 0
19 19 -2.455 0.02 2001 0
20 20 -2.378 0.02 2002 0
21 21 -2.188 0.02 2003 0
22 22 -2.044 0.02
23 23 -1.933 0.02
24 24 -1.811 0.02
25 25 -1.773 0.02
26 26 -1.550 0.02
27 27 -1.448 0.02
28 28 -1.444 0.02
29 29 -1.361 0.02
30 30 -1.178 0.02
31 31 -1.137 0.02
32 32 -1.035 0.02
33 33 -0.898 0.02
34 34 -0.848 0.02
35 35 -0.762 0.02
36 36 -0.660 0.02
37 37 -0.526 0.02
38 38 -0.548 0.02
39 39 -0.358 0.02
40 40 -0.336 0.02
41 41 -0.337 0.02
42 42 -0.221 0.02
43 43 -0.043 0.02
44 44 -0.009 0.02
45 45 0.085 0.02
46 46 0.136 0.02
47 47 0.123 0.02
48 48 0.150 0.02
49 49 0.057 0.02
50 50 0.277 0.02
51 51 0.072 0.02
Iterative fit:
#iter Dev non-conv
1 6540573 0
2 29705491 1
3 4480827 0
4 957943 0
5 900543.2 0
6 889201.9 0
7 889379.3 1
8 889429.8 2
9 889446 3
10 889451.2 0
11 889453.1 0
12 889453.9 0
13 889454.2 0
14 889454.4 0
15 889454.4 0
16 889454.4 0
17 889454.5 0
18 889454.5 0
19 889454.5 0
Iterations finished in: 19 steps
Updated values are:
age age.c int.c per per.c X4 X4.c
1 1 -3.73341 0.10970 1983 19.41845 base 0
2 2 -4.27580 0.05414 1984 13.73926 a 0.49542
3 3 -4.70903 0.04957 1985 11.04247 b 1.19809
4 4 -4.78915 0.02653 1986 5.49009 c -0.58839
5 5 -4.77862 0.00864 1987 6.6309 d 2.50299
6 6 -4.65176 0.03355 1988 8.33482
7 7 -4.88288 0.00632 1989 9.63656
8 8 -4.46920 0.01394 1990 5.50789
9 9 -4.62737 0.03609 1991 7.01078
10 10 -4.47193 0.00137 1992 6.08726
11 11 -4.44346 0.01560 1993 2.09278
12 12 -4.56236 -0.00245 1994 -0.45969
13 13 -4.55547 0.02573 1995 -0.7341
14 14 -4.35132 0.02191 1996 -7.15618
15 15 -4.00160 0.02373 1997 -15.7876
16 16 -4.06498 0.01915 1998 -9.64776
17 17 -4.02566 0.02436 1999 -11.7843
18 18 -4.00735 0.02598 2000 -14.08737
19 19 -3.85568 0.01526 2001 -4.97029
20 20 -3.73150 0.01362 2002 -13.90274
21 21 -3.72353 0.01664 2003 -16.46123
22 22 -3.40236 0.02525
23 23 -3.30066 0.01439
24 24 -3.22563 0.02740
25 25 -3.14496 0.02030
26 26 -2.91215 0.02463
27 27 -2.89278 0.01075
28 28 -2.79821 0.01789
29 29 -2.70279 0.01067
30 30 -2.54640 0.01769
31 31 -2.53396 0.01755
32 32 -2.46613 0.00144
33 33 -2.29472 0.00726
34 34 -2.21996 0.01980
35 35 -2.13452 0.01335
36 36 -2.07252 0.01087
37 37 -1.87040 0.02161
38 38 -1.92970 0.00939
39 39 -1.92870 0.01928
40 40 -1.70537 0.00794
41 41 -1.68789 0.01479
42 42 -1.59689 0.01344
43 43 -1.53029 0.01042
44 44 -1.36342 0.00988
45 45 -1.35192 0.01576
46 46 -1.30749 0.02763
47 47 -1.24772 0.01139
48 48 -1.23495 0.01861
49 49 -1.32957 0.00435
50 50 -1.27210 0.02559
51 51 -1.25372 0.01127
total sums are:
bx kt
1 0
Warning messages:
1: A total of 1129 0/NA central mortality rates are re-estimated by the "interpolate" method.
2: In elca.rh(rfp.cmi, age = 50:100, interpolate = TRUE, dec = 3) :
There are 141 cells with 0/NA exposures, which are ignored in the current analysis.
Try reducing the fitted age range.
Alternatively, fit ELC model with error= "gaussian" .
3: In FUN(array(newX[, i], d.call, dn.call), ...) :
Please assign column name for the data matrix.
4: In FUN(array(newX[, i], d.call, dn.call), ...) :
Please assign column name for the data matrix.
5: In FUN(array(newX[, i], d.call, dn.call), ...) :
Please assign column name for the data matrix.
6: In FUN(array(newX[, i], d.call, dn.call), ...) :
Please assign column name for the data matrix.
7: In FUN(array(newX[, i], d.call, dn.call), ...) :
Please assign column name for the data matrix.
Original sample: Mortality data for CMI
Series: male
Years: 1983 - 2003
Ages: 50 - 108
Applied sample: Mortality data for CMI (Corrected: interpolate)
Series: male
Years: 1983 - 2003
Ages: 50 - 100
Fitting model: [ LC = a(x)+b1(x)*k(t) ]
- with gaussian error structure -
Note: 45 cells have 0/NA deaths and 0 have 0/NA exposure
out of a total of 1071 data cells.
Starting values are:
age age.c bx1 bx1.c per per.c
1 50 -3.462 50 0.02 1983 0
2 51 -4.095 51 0.02 1984 0
3 52 -4.404 52 0.02 1985 0
4 53 -4.615 53 0.02 1986 0
5 54 -4.480 54 0.02 1987 0
6 55 -4.504 55 0.02 1988 0
7 56 -4.770 56 0.02 1989 0
8 57 -4.576 57 0.02 1990 0
9 58 -4.814 58 0.02 1991 0
10 59 -4.502 59 0.02 1992 0
11 60 -4.652 60 0.02 1993 0
12 61 -4.627 61 0.02 1994 0
13 62 -4.637 62 0.02 1995 0
14 63 -4.394 63 0.02 1996 0
15 64 -4.117 64 0.02 1997 0
16 65 -4.083 65 0.02 1998 0
17 66 -4.042 66 0.02 1999 0
18 67 -3.952 67 0.02 2000 0
19 68 -3.831 68 0.02 2001 0
20 69 -3.725 69 0.02 2002 0
21 70 -3.599 70 0.02 2003 0
22 71 -3.436 71 0.02
23 72 -3.346 72 0.02
24 73 -3.228 73 0.02
25 74 -3.115 74 0.02
26 75 -3.002 75 0.02
27 76 -2.902 76 0.02
28 77 -2.810 77 0.02
29 78 -2.707 78 0.02
30 79 -2.604 79 0.02
31 80 -2.519 80 0.02
32 81 -2.399 81 0.02
33 82 -2.311 82 0.02
34 83 -2.225 83 0.02
35 84 -2.141 84 0.02
36 85 -2.045 85 0.02
37 86 -1.979 86 0.02
38 87 -1.874 87 0.02
39 88 -1.807 88 0.02
40 89 -1.725 89 0.02
41 90 -1.664 90 0.02
42 91 -1.590 91 0.02
43 92 -1.552 92 0.02
44 93 -1.440 93 0.02
45 94 -1.359 94 0.02
46 95 -1.299 95 0.02
47 96 -1.284 96 0.02
48 97 -1.245 97 0.02
49 98 -1.276 98 0.02
50 99 -1.261 99 0.02
51 100+ -1.271 100 0.02
Iterative fit:
#iter Dev non-conv
1 161.6271 0
2 64.12512 0
3 62.99956 0
4 62.9934 0
5 62.99332 0
6 62.99331 0
Iterations finished in: 6 steps
Updated values are:
age age.c bx1 bx1.c per per.c
1 50 -3.46190 50 0.11876 1983 16.53634
2 51 -4.09482 51 0.05103 1984 16.59973
3 52 -4.40400 52 0.04241 1985 15.79933
4 53 -4.61490 53 0.03614 1986 12.22959
5 54 -4.48012 54 0.02253 1987 12.78404
6 55 -4.50413 55 0.04441 1988 10.33228
7 56 -4.77048 56 0.01591 1989 9.00754
8 57 -4.57601 57 0.03112 1990 7.52879
9 58 -4.81427 58 0.01169 1991 7.7347
10 59 -4.50233 59 -0.00032 1992 2.98478
11 60 -4.65201 60 0.01697 1993 -4.85238
12 61 -4.62690 61 0.00865 1994 -2.40451
13 62 -4.63747 62 0.04395 1995 -3.65101
14 63 -4.39403 63 0.01408 1996 -7.24501
15 64 -4.11729 64 0.02651 1997 -11.15805
16 65 -4.08299 65 0.01989 1998 -7.93342
17 66 -4.04168 66 0.01866 1999 -10.90532
18 67 -3.95211 67 0.02132 2000 -15.38314
19 68 -3.83069 68 0.02126 2001 -15.1003
20 69 -3.72485 69 0.01812 2002 -15.66375
21 70 -3.59892 70 0.02054 2003 -17.24024
22 71 -3.43584 71 0.01837
23 72 -3.34567 72 0.01752
24 73 -3.22840 73 0.01617
25 74 -3.11466 74 0.01538
26 75 -3.00222 75 0.01399
27 76 -2.90200 76 0.01455
28 77 -2.80974 77 0.01589
29 78 -2.70686 78 0.01384
30 79 -2.60402 79 0.01347
31 80 -2.51932 80 0.01365
32 81 -2.39878 81 0.01331
33 82 -2.31114 82 0.01255
34 83 -2.22452 83 0.01234
35 84 -2.14145 84 0.01244
36 85 -2.04520 85 0.01127
37 86 -1.97936 86 0.01153
38 87 -1.87386 87 0.01154
39 88 -1.80746 88 0.01109
40 89 -1.72537 89 0.01085
41 90 -1.66449 90 0.00927
42 91 -1.58971 91 0.00833
43 92 -1.55192 92 0.00879
44 93 -1.43969 93 0.00897
45 94 -1.35939 94 0.01258
46 95 -1.29881 95 0.01266
47 96 -1.28441 96 0.00718
48 97 -1.24456 97 0.01672
49 98 -1.27575 98 0.01128
50 99 -1.26096 99 0.02074
51 100+ -1.27138 100 0.02012
total sums are:
b0 b1 itx kt
0 1 0 0
Warning messages:
1: In lca.set(dat, year, age, series, max.age, interpolate) :
=> data above age 100 are grouped.
2: A total of 62 0/NA central mortality rates are re-estimated by the "interpolate" method.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.