.- help for ^lifetabl^ (STB-59: ssa14) .- . Life table generator -------------------- Syntax ------ ^lifetabl^ varlist [^if^ exp] [^in^ range] ^,^ ^s^trata^(^age_level_var^)^ [ ^r^ates^(^ratesvar^)^ ^d^eaths^(^deathsvar^)^ ^p^op^(^popvar^)^ ^by(^byvar^)^ ^ny^ears^(^age_interval_length_var^)^ ^radix(^#^)^ ^sc^list^(^varlist^)^ ^allrx^ ^w^eights^(^#1 #2 #3 #4^)^ ^pyll(^#^)^ ^k^eep ^l^abel^(^labelvar^)^ ^m^ultiplier^(^#^)^ ^not^ ^noo^ ^allsct^ ^sco^nly ^noyll^ ^sav^ing^(^filename^)^ ^replace^ ^grphs^ ^ge^ ^gp^ ^gs^ ^gh^ ^gsc^ ^log^rate ] Description ----------- Life table construction and analysis provides an alternative to standardization as an appropriate method to describe the pattern(s) of the survival experience of a large population or of one of its subgroups, given only that we possess a set of age-specific rates (Armitage & Berry, 1994; Chiang, 1984). Some developments of this approach are also useful to evaluate the impact of competing risks as they act upon a group, as well as to obtain data to draw survival curves, survival probabilities, and hazard functions (cf. Selvin, 1996). The ^lifetabl^ command, hereby presented, allows the development of complete, as well as abridged, life tables, following the general method provided by Selvin (1991). According to this approach, a population life table, as well as several derived statistics, such as the at birth (e_0) and the age specific (e_i) expectation of life estimates, the corresponding survival probabilities, or hazard rates (and functions), can be generated if we dispose of a set of observed age specific mortality rates (or data allowing their computation, such as the number of recorded deads and the number of persons at risk at each age interval). With this ^lifetabl^ command, it is also possible make a simultaneous analysis of the impact of multiple causes-of-death to retain several variables produced during processing and, also, to request the making of several different graphics. Options ------- ^strata(^age_level_var^)^ allows the specification of a numeric or string variable coding the different age strata. This option must always be specified. If the variable used is numeric, the values representing the successive age strata must be monotonically ascending numbers because, during processing, this variable will be subject to an ascending sort, and the concrete values recorded will be used as labels for the strata (ex. 0, 1, 2, ..., 90 for, respectively, the intervals [0-1[, [1-2[, [2-3[, ... [90+[). If the alternative possibility of specifying a string variable is utilized, the same also applies. Therefore, care must be taken in order to use strings which, after being sorted, keep in the correct order the corresponding age strata. A, perhaps, safer alternative is the use of a numeric variable with ascending integers to designate the successive age levels in this option, together with a string variable to provide labels for the different age strata in the output through option label(labelvar) (see below). In every circumstance the (within if, in or by( ) subgroups) variable describing the age strata cannot have repeated, neither missing nor null, values. ^rates(^ratesvar^)^ designates a variable for stratum-specific observed mortality rates. Use of this option is mandatory, unless the following two options are used instead, as an alternative. The age-specific rates can be expressed in terms of several population multipliers (1, 10, 100, 1 000, 10 000, 100 000, 1000 000). However, if the specific power of 10 for which the rates are referred is not 100 000 (the default), its concrete value must be specified through the option ^multiplier(^#^)^ (see below). ^deaths(^deathsvar^)^ specifies a numeric variable containing the number of observed deaths in each of the age strata. ^pop(^popvar^)^ designates a numeric variable with the number of persons at risk at each of the age strata (for example, the mid-year population estimate). This option must always be used in conjunction with the previous one whenever option ^rates()^ is not available nor specified simultaneously. ^by(^byvar^)^ requests that all computations and outputs, graphics included, are produced for every subgroup defined by the nonmissing categories of one (and only one) numeric variable, byvar. ^nyears(^age_interval_length_var^)^ allows the user to declare a numeric variable specifying the length, in years, of the successive age strata. When this option is not used, it is assumed that all age intervals are equal to one year (in other words, it is assumed by the program that the life table being calculated is a complete life table). The (within subgroup) value for the last interval (an open one) is always (re)set to one. ^radix(^#^)^ allows the user to modify the life table number of persons at risk at exactly age 0, i.e., the size of the life table conventional cohort (radix or l_0). The default value, assumed whenever this option is not used is, again, 100 000. ^sclist(^varlist^)^ specifies a list of 1 to 20 numeric variables registering the cause-specific number of observed deaths in each of the age strata (and, eventually, for each of the ^by()^ subgroups). Use of this option will always be followed by a "multiple causes-of-death" analysis, consisting in the output of a number of additional tables. These will include estimates for the 1) at birth, and lifetime (beyond age x) conditional probabilities of death for each specific cause (Pr(death by cause i | age x)), 2) absolute risk of dying by each cause, given a certain age, during the following interval (qxi), 3) cumulative distributions of deaths by cause and age (Fxi), and 4) probabilities of death after a certain age x, given that the death is caused by each of the specific categories considered (Pr(death after age x | death by cause i)). Whenever this option is utilized, it is safer, and wiser, to also use option ^deaths(^deathsvar^)^ to explicitly declare the total number of deaths observed to occur in each age strata. However, this requirement is not absolute because, in the absence of an explicit declaration of the total number of deaths in each age level (by all causes), the program automatically assumes that the (row)sum of the variables included in option ^sclist(^varlist^)^ equals the just-mentioned total. Of course, if that is not the case, the results may be compromised. So, when ^deaths(^deathsvar^)^ option is not being used, care must be taken to assure that this assumption holds, for instance by including in the ^sclist(^varlist^)^ option, one variable for a residual specific cause of death category corresponding to the remaining, not otherwise explicitly considered, causes-of-death. Finally, as an alternative to the specification of the absolute number of observed deaths by specific causes just described, the variables for specific causes-of-death may also contain previously calculated age (and/or group) specific rates of death. It is only necessary that these rates are all referred to the same number of persons (power of ten) as the ones eventually included in the previously described option ^rates(^ratesvar^)^, and that another option, ^allrx^ (signifying "all specific causes are in rates"), is also used to inform the program of this particular circumstance. ^allrx^ declares that the variables included in option ^sclist(^varlist^)^ contain specific rates instead of absolute number of deaths by each of the specific cause, which is the default for this program (please see above). If this option is used together with option ^rates(^ratesvar^)^, the user is advised to also specify options ^pop(^popvar^)^, and/or ^deaths(^deathsvar^)^, provided the data is available, in order to allow for the deduction of all the parameters necessary to produce the standard output. If neither of these is available (that is, if strictly only rates are declared), the program will not be able to calculate the potential years of life lost indicators. ^weights(^#1 #2 #3 #4^)^ allows specification of the contribution made for the total time lived on each of the first four life table periods by the cases registered as deaths and occurring in these same time intervals. The quantities referred must be expressed in terms of the proportion of the total interval presumably lived by any person ultimately deceased anytime during the same interval. The ^weights(^#1 #2 #3 #4^)^ option allows the modification of the default values for one, or for all, of the first four periods of living. By default, the weights used by the ^lifetabl^ command are those used by Selvin (1991) which, apparently, took them from Chiang (1984). In fact, they are equivalent to an explicit specification of this option as ^w(0.113 0.430 0.450 0.470)^. The variable number of parameters passed to the program is interpreted according to their order, as pertaining respectively to the first, second, third, and fourth, age intervals. If less than 4 of these parameters are specified, the program assumes that the omitted parameters are the ones at the tail of the list and attributes to them the default value of 0.50 (for instance, ^w(0.30)^ will be interpreted as ^weights(0.30 0.50 0.50 0.50)^). Concerning all the time periods following the fourth, it is also always assumed that each death contributes to the total time lived in each age level by the cohort of people alive at its beginning with a time equal to one half of the respective interval length. ^pyll(^#^)^ provides the possibility of modification of the upper age limit utilized in the calculation of the indicator "potential years of life lost" until age #. The default value used by ^lifetabl^ is ^pyll(65)^, following the convention adopted by the U.S. Centers for Disease Control and by a number of other national and international agencies. ^keep^ instructs the program to retain several of the variables generated during the life table construction procedure. As a default, the ^lifetabl^ program restores the original dataset after processing. However, when option ^keep^ is included in the command line, the user data is left behind, unchanged, and a new data file, with an added set of variables, but truncated according to any ^if^ or ^in^ expressions also utilized in the command, is kept in memory. By default this new working file is saved under the name ^_SaVeD_.dta^, thus replacing any equally named pre-existent file. The variables added to the original set are ^_Rx^ - Life table mortality rates, per 10^^5 persons ^_qx^ - Probability of dying in interval ^_dx^ - Expected number of deaths in interval ^_px^ - Probability of surviving the interval ^_lx^ - Number of people alive at the beginning of the interval ^_Lx^ - Cumulative years lived through x ^_Tx^ - Total time lived beyond x ^_ExpYL^ - Expected years of life at age x ^_Surv^ - Survival probability ^_SurvVar^ - Greenwood variance for ^_Surv^ ^_HRate^ - Hazard rate If specific causes-of-death are also included in an analysis, three other sets of variables will also be retained: ^_qxi^ - risks of dying of cause i in the age interval x; ^_Wxi^ - expected total number of deaths by cause i after the beginning of the age interval x; ^_Fxi^ - cumulative distribution of deaths by cause i through age. ^label(^labelvar^)^ specifies a string variable to be used in the outputs in the substitution of conventional ordered values in the naming of the successive age levels. In contrast with the truly optional use of this ^label(^labelvar^)^ option, the user is always obliged to (also) specify one variable (which may be the same) through option ^strata(^age_level_var^)^, in order to clearly indicate the correct ordering of the age levels. Due to the output space available, the strings stored in labelvar will appear truncated in the output if they are longer than 7 characters. ^multiplier(^#^)^ specifies the number of persons for which the mortality rates declared by the ratesvar in option ^rates(^ratesvar^)^ are referred. Allowed values are 1, 10, 100, 1 000, 10 000, 100 000, and 1000 000. The default value for the rates multiplier, assumed whenever this option is not used, is 100000. ^not^ suppresses the display of tables, which may be useful if the user is mainly interested in the production of graphics or in comparing subgroup life expectancies. ^noo^ completely suppresses the written outputs. Following this option, only graphics will be outputted if requested in the same command line. ^allsct^ is to be used in combination with ^sclist(^varlist^)^ to instruct the program to display three additional tables related with the multiple cause-of-death analysis. These supplementary tables exhibit the observed number of deaths by each cause and age level (Dxi), the life table expected number of deaths, by each cause at each age level x (dxi), and the life table expected total number of deaths by each cause occurring after each age x (Wxi). ^sconly^ instructs ^lifetabl^ to restrict the output only to results related with the multiple causes-of-death analysis. ^noyll^ allows the user to request that all output related with the potential years of life lost indicators will not be displayed. ^saving(^filename^)^ allows the user to specify the name of a new filename to save the results. The name of the file must be less than 8 characters, according to the general naming rules. This option may be combined with ^replace^ to allow the program to substitute any existing file with the same name. ^replace^ instructs ^lifetabl^ to overwrite any existing file similarly named when the ^saving(^filename^)^ option is specified. ^grphs^ specifies the production of all five available groups of graphics. The same graphs may instead be produced individually by using the next five options. ^ge^ requests the display of a graphed expectation of life function (expectation for the mean years of remaining life to be lived, at each age), for one or more of the subgroups considered. ^gp^ requests the graph the cumulative (proportional) distribution(s) of expected deaths. ^gs^ requests the production of a graph with the survival function, or functions, if subgroups are being considered. ^gh^ requests a graph of the hazard rate function, or functions, if subgroups are being considered. ^gsc^ requests a set of graphics related with the specific causes of death included in option ^sclist(^varlist^)^. ^lograte^ requests a graph of the log hazard rate(s) when the ^gh^ or ^grphs^ options are specified. Examples -------- . ^lifetabl if sex==1 , s(strata) r(Rx100000)^ . ^lifetabl if sex==1 , s(strata) d(deaths) p(pop)^ . ^lifetabl if sex==1 , s(agelab) d(deaths) p(pop)^ . ^lifetabl if sex==1 , s(agelab) r(Rx100000)^ . ^lifetabl if sex==1 , s(agelab) r(Rx1000) multip(1000)^ . ^lifetabl , s(agelab) d(deaths) p(pop) label(agelab) by(sex)^ . ^lifetabl , s(agelab) r(Rx100000) grphs by(sex)^ . ^lifetabl if year==1995 , s(strata) d(deaths) p(pop) ny(nyears) by(sex) l(agelab)^ . ^lifetabl if year==1995 & sex==1 , s(strata) d(deaths) p(pop) ny(nyears)^ (...) ^l(agelab) sc(sc_infec sc_tumor sc_circ sc_acid AllOthrC)^ . ^lifetabl if year==1995 & sex==1 , s(strata) d(deaths) p(pop) ny(nyears)^ (...) ^l(agelab) sc(sc_infec sc_tumor sc_circ sc_acid AllOthrC) gsc noo^ . ^lifetabl , s(strata) l(agelab) r(Rx100000) ny(nyears)^ . ^lifetabl , s(strata) l(agelab) p(pop) d(deaths) ny(nyears)^ . ^lifetabl , s(strata) l(agelab) p(pop) d(deaths) ny(nyears) noo grphs log^ . ^lifetabl , s(strata) r(Rx100000) ny(nyears) sc(lungcan ihd motor allother) sco^ . ^lifetabl , s(strata) r(Rx100000) ny(nyears) sc(lungcan ihd motor allother) noo gsc^ . ^lifetabl , s(strata) r(Rx100000) ny(nyears) sc(Rlung Rihd Rmotor Rallothr) allrx^ . ^lifetabl , s(strata) r(Rx100000) ny(nyears) sc(Rlung Rihd Rmotor Rallothr) allrx p(pop)^ . ^lifetabl , s(strata) r(Rx100000) ny(nyears) sc(Rlung Rihd Rmotor Rallothr) allrx d(death)^ . ^lifetabl , s(strata) d(deaths) p(pop) ny(nyears) sc(Rlung Rihd Rmotor Rallothr) allrx^ . ^lifetabl , s(strata) d(deaths) p(pop) ny(nyears) sc(Rlung Rihd Rmotor) allrx^ . ^generate Rx1000 = (deaths / pop) * 1000^ . ^label variable Rx1000 "Global death rate, per 1000"^ Remark ------ In order for ^lifetabl^ to work properly, it necessary that two ado-files are kept together: ^lifetabl.ado^ and ^lifetabs.ado^. The first computes life tables and all related graphics. The second is no more that a sub-routine, called by ^lifetabl.ado^, which stores all the code related with multiple causes-of-death analysis. Author ------ Carlos Ramalheira cramal@@ci.uc.pt MD, Psychiatrist, Epidemiology Assistant Coimbra Faculty of Medicine & University Hospital Clinica Psiquiatrica dos HUC 3000 Coimbra Portugal Also see -------- Manual: ^[R] ltable^, ^[R] st^ On-line: help for @ltable@, @st@