insp.dd: Miscellaneous utility functions for 'demogdata' type...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function can extract any subset of the source data, such as the mortality (hazard) rates and population (exposure), by a given vector of ages and calendar years. Similarly, the function can output the observed number of deaths by age and calendar years, based on the source data sets included in the demogdata object.

Usage

1
2
insp.dd(data, what = c("rate", "pop", "deaths"), ages = data$age, 
		years = data$year, series = names(data$rate)[1])

Arguments

data

demogdata mortality data object

what

specifies the required type of data matrix to be extracted

ages

vector of ages to inspect in the data

years

vector of years to inspect in the data

series

target series name (e.g. 'males') or index number (e.g. 1) of the data object to be extracted

Details

A subset of mortality rates and population (exposures) can be directly inspected (i.e. extracted) from the corresponding component data matrices in the source demogdata object by using this function. To inspect the observed number of deaths by age and calendar years the function calls extract.deaths without data corrections.

Value

Returns a subset data matrix of the source data.

Author(s)

Zoltan Butt, Steven Haberman and Han Lin Shang

See Also

extract.deaths, extract.ages, extract.years

Examples

1
2
3
4
5
6
# inspect mortality (hazard) rates:
insp.dd(dd.cmi.pens, 'rate', age=50:80, year=1985:1990)
# inspect exposure (population) values:
insp.dd(dd.cmi.pens, 'pop', age=50:80, year=1985:1990)
# inspect 'estimated' number of deaths
insp.dd(dd.cmi.pens, 'deaths', age=50:80, year=1985:1990)

Example output

Loading required package: demography
Loading required package: forecast
Registered S3 method overwritten by 'quantmod':
  method            from
  as.zoo.data.frame zoo 
Registered S3 methods overwritten by 'demography':
  method      from 
  print.lca   e1071
  summary.lca e1071
This is demography 1.22 

Loading required package: rainbow
Loading required package: MASS
Loading required package: pcaPP
Loading required package: date
         1985        1986        1987        1988        1989        1990
50        NaN         NaN         NaN         NaN         NaN         NaN
51        NaN         NaN 0.037313433         NaN 0.024630542 0.043956044
52        NaN         NaN         NaN         NaN 0.018018018         NaN
53        NaN 0.019455253         NaN         NaN 0.015128593         NaN
54        NaN         NaN 0.014044944 0.014947683 0.014064698 0.010752688
55        NaN 0.027322404 0.026619343 0.009267841 0.010593220         NaN
56        NaN 0.021246459 0.011273957 0.005861665 0.015302219         NaN
57 0.03238342 0.006253909 0.020607934 0.017115961 0.015641293 0.005636979
58 0.01170960 0.004899559 0.004068348 0.025820730 0.007730963 0.008357710
59 0.01017812 0.004436557 0.020304569 0.017931859 0.013591573 0.010600707
60 0.02630425 0.020391517 0.017818959 0.006454736 0.010889292 0.001967729
61 0.01578820 0.009899901 0.015042118 0.016770707 0.008005604 0.013109023
62 0.01847224 0.016868426 0.015426808 0.019614253 0.015241169 0.015280298
63 0.01362769 0.014755664 0.020825299 0.018333098 0.015500271 0.009726766
64 0.03295669 0.019255950 0.025077022 0.020648771 0.028939571 0.016524829
65 0.02417922 0.021236964 0.022885012 0.019490835 0.018973684 0.020544337
66 0.02152807 0.021491406 0.023221106 0.022139730 0.019657268 0.019864329
67 0.02502554 0.023645237 0.025865184 0.024103031 0.021612927 0.020330368
68 0.03087096 0.029564356 0.025335418 0.026949289 0.025724524 0.027598325
69 0.03265683 0.027887833 0.031064176 0.026676599 0.029374597 0.027092949
70 0.03479520 0.036328810 0.035679675 0.035884223 0.030199199 0.030681826
71 0.03926452 0.039516298 0.040338632 0.041320166 0.039599704 0.033632286
72 0.04713156 0.043690831 0.045057957 0.045321767 0.039293283 0.038120885
73 0.04969113 0.046168135 0.051520788 0.049325440 0.044597078 0.044284188
74 0.05288131 0.053048373 0.054109309 0.054128562 0.053792625 0.046663413
75 0.06186168 0.053901518 0.059369020 0.057947263 0.055024175 0.053634255
76 0.06805440 0.067562637 0.063904922 0.064410968 0.064248585 0.059467625
77 0.07987826 0.072233621 0.073406386 0.069291560 0.070586312 0.073139539
78 0.08030614 0.076636847 0.080057890 0.081217558 0.071512922 0.069943891
79 0.09206045 0.086745845 0.083536425 0.083140618 0.081777879 0.082322094
80 0.09588480 0.098342013 0.098188308 0.091237913 0.088527425 0.088901305
      1985    1986    1987    1988    1989    1990
50     0.0     0.0     0.0     0.0     0.0     0.0
51     0.0     0.0    26.8     0.0    40.6    45.5
52     0.0     0.0     0.0     0.0    55.5     0.0
53     0.0    51.4     0.0     0.0    66.1     0.0
54     0.0     0.0    71.2    66.9    71.1    93.0
55     0.0   109.8   112.7   107.9    94.4     0.0
56     0.0   141.2   177.4   170.6   130.7     0.0
57   154.4   159.9   194.1   233.7   191.8   177.4
58   170.8   204.1   245.8   271.1   258.7   239.3
59   196.5   225.4   295.5   334.6   294.3   283.0
60   456.2   490.4   561.2   619.7   551.0   508.2
61   823.4   909.1   997.2  1073.3   999.3   915.4
62   920.3  1007.8  1166.8  1223.6  1115.4  1047.1
63  1100.7  1152.1  1296.5  1418.2  1290.3  1130.9
64  1274.4  1298.3  1395.7  1501.3  1451.3  1210.3
65  8726.5  8428.7  7996.5  7490.7  6904.3  5695.0
66 16768.8 18472.5 17957.8 16486.2 14956.3 12132.3
67 14585.1 16536.1 19640.3 18130.5 15916.4 12592.0
68 16423.2 13935.7 17090.7 19295.5 17104.3 12863.1
69 19689.6 15598.2 14260.8 16643.8 18042.8 13693.6
70 22646.8 18690.4 15891.4 13933.7 15497.1 14503.7
71 24093.0 21459.5 18840.5 15392.0 13030.4 12577.2
72 24293.7 22499.0 21283.7 17938.4 14200.9 10545.4
73 22760.6 22504.7 22146.4 20131.6 16480.9 11426.2
74 20612.2 20962.0 22011.0 20820.8 18422.6 13115.2
75 19543.6 18923.4 20381.0 20622.2 19028.0 14524.3
76 18015.0 17805.7 18292.8 19018.5 18833.1 14831.6
77 16099.5 16183.6 16974.0 16942.9 17156.3 14465.5
78 14581.7 14431.7 15338.9 15624.7 15158.1 13153.4
79 13154.4 13084.2 13622.8 14096.6 13940.2 11479.3
80 11722.4 11785.4 12099.2 12330.4 12504.6 10382.3
   1985 1986 1987 1988 1989 1990
50    0    0    0    0    0    0
51    0    0    1    0    1    2
52    0    0    0    0    1    0
53    0    1    0    0    1    0
54    0    0    1    1    1    1
55    0    3    3    1    1    0
56    0    3    2    1    2    0
57    5    1    4    4    3    1
58    2    1    1    7    2    2
59    2    1    6    6    4    3
60   12   10   10    4    6    1
61   13    9   15   18    8   12
62   17   17   18   24   17   16
63   15   17   27   26   20   11
64   42   25   35   31   42   20
65  211  179  183  146  131  117
66  361  397  417  365  294  241
67  365  391  508  437  344  256
68  507  412  433  520  440  355
69  643  435  443  444  530  371
70  788  679  567  500  468  445
71  946  848  760  636  516  423
72 1145  983  959  813  558  402
73 1131 1039 1141  993  735  506
74 1090 1112 1191 1127  991  612
75 1209 1020 1210 1195 1047  779
76 1226 1203 1169 1225 1210  882
77 1286 1169 1246 1174 1211 1058
78 1171 1106 1228 1269 1084  920
79 1211 1135 1138 1172 1140  945
80 1124 1159 1188 1125 1107  923

ilc documentation built on May 2, 2019, 5:07 a.m.