--- imach096d/doc/imach.htm 2001/03/14 08:24:41 1.2 +++ imach096d/doc/imach.htm 2002/03/11 14:18:06 1.8 @@ -1,3 +1,4 @@ + @@ -6,6 +7,13 @@ content="text/html; charset=iso-8859-1"> Computing Health Expectancies using IMaCh + + + + + + @@ -28,8 +36,8 @@ src="euroreves2.gif" width="151" height= color="#00006A">INED and EUROREVES -

March -2000

+

Version +0.71a, March 2002


@@ -58,8 +66,6 @@ color="#00006A">) -
  • ncov=2 Number of covariates in the datafile. The - intercept and the age parameter are counting for 2 - covariates.
  • +
  • ncov=2 Number of covariates in the datafile.
  • nlstate=2 Number of non-absorbing (alive) states. Here we have two alive states: disability-free is coded 1 and disability is coded 2.
  • @@ -349,7 +353,7 @@ line

    Covariates

    Intercept and age are systematically included in the model. -Additional covariates can be included with the command

    +Additional covariates can be included with the command:

    model=list of covariates
    @@ -365,8 +369,23 @@ Additional covariates can be included wi
  • if model=V1*V2 the model includes the product of the first and the second covariate (fields 2 and 3)
  • +
  • if model=V1+V1*age the model includes + the product covariate*age
  • +

    In this example, we have two covariates in the data file +(fields 2 and 3). The number of covariates is defined with +statement ncov=2. If now you have 3 covariates in the datafile +(fields 2, 3 and 4), you have to set ncov=3. Then you can run the +programme with a new parametrisation taking into account the +third covariate. For example, model=V1+V3 estimates +a model with the first and third covariates. More complicated +models can be used, but it will takes more time to converge. With +a simple model (no covariates), the programme estimates 8 +parameters. Adding covariates increases the number of parameters +: 12 for model=V1, 16 for model=V1+V1*age +and 20 for model=V1+V2+V3.

    +

    Guess values for optimization

    @@ -385,9 +404,8 @@ initials values, a12, b12, a13, b13, a21 start with zeros as in this example, but if you have a more precise set (for example from an earlier run) you can enter it and it will speed up them
    -Each of the four lines starts with indices "ij":
    -
    -ij aij bij

    +Each of the four lines starts with indices "ij": ij +aij bij

    # Guess values of aij and bij in log (pij/pii) = aij + bij * age
    @@ -397,7 +415,8 @@ Each of the four lines starts with indic
     23  -6.234642  0.022315 
    -

    or, to simplify:

    +

    or, to simplify (in most of cases it converges but there is no +warranty!):

    12 0.0 0.0
    @@ -409,7 +428,7 @@ Each of the four lines starts with indic
     

    Guess values for computing variances

    This is an output if mle=1. But it can be -used as an input to get the vairous output data files (Health +used as an input to get the various output data files (Health expectancies, stationary prevalence etc.) and figures without rerunning the rather long maximisation phase (mle=0).

    @@ -440,7 +459,7 @@ consists in indices "ij" follo

    Covariance matrix of parameters

    This is an output if mle=1. But it can be -used as an input to get the vairous output data files (Health +used as an input to get the various output data files (Health expectancies, stationary prevalence etc.) and figures without rerunning the rather long maximisation phase (mle=0).

    @@ -475,23 +494,24 @@ covariances between aij and bij:

    -

    last -uncommented line

    +

    Age range for calculation of stationary +prevalences and health expectancies

    agemin=70 agemax=100 bage=50 fage=100

    Once we obtained the estimated parameters, the program is able to calculated stationary prevalence, transitions probabilities -and life expectancies at any age. Choice of age ranges is useful +and life expectancies at any age. Choice of age range is useful for extrapolation. In our data file, ages varies from age 70 to -102. Setting bage=50 and fage=100, makes the program computing -life expectancy from age bage to age fage. As we use a model, we -can compute life expectancy on a wider age range than the age -range from the data. But the model can be rather wrong on big -intervals.

    +102. It is possible to get extrapolated stationary prevalence by +age ranging from agemin to agemax.

    -

    Similarly, it is possible to get extrapolated stationary -prevalence by age raning from agemin to agemax.

    +

    Setting bage=50 (begin age) and fage=100 (final age), makes +the program computing life expectancy from age 'bage' to age +'fage'. As we use a model, we can interessingly compute life +expectancy on a wider age range than the age range from the data. +But the model can be rather wrong on much larger intervals. +Program is limited to around 120 for upper age!

    +

    Computing the observed prevalence

    + +
    begin-prev-date=1/1/1984 end-prev-date=1/6/1988 
    + +

    Statements 'begin-prev-date' and 'end-prev-date' allow to +select the period in which we calculate the observed prevalences +in each state. In this example, the prevalences are calculated on +data survey collected between 1 january 1984 and 1 june 1988.

    + + + +

    Population- or status-based health +expectancies

    + +
    pop_based=0
    + +

    The program computes status-based health expectancies, i.e +health expectancies which depends on your initial health state. +If you are healthy your healthy life expectancy (e11) is higher +than if you were disabled (e21, with e11 > e21).
    +To compute a healthy life expectancy independant of the initial +status we have to weight e11 and e21 according to the probability +to be in each state at initial age or, with other word, according +to the proportion of people in each state.
    +We prefer computing a 'pure' period healthy life expectancy based +only on the transtion forces. Then the weights are simply the +stationnary prevalences or 'implied' prevalences at the initial +age.
    +Some other people would like to use the cross-sectional +prevalences (the "Sullivan prevalences") observed at +the initial age during a period of time defined +just above.

    + + + +

    Prevalence forecasting ( Experimental)

    + +
    starting-proj-date=1/1/1989 final-proj-date=1/1/1992 mov_average=0 
    + +

    Prevalence and population projections are only available if +the interpolation unit is a month, i.e. stepm=1 and if there are +no covariate. The programme estimates the prevalence in each +state at a precise date expressed in day/month/year. The +programme computes one forecasted prevalence a year from a +starting date (1 january of 1989 in this example) to a final date +(1 january 1992). The statement mov_average allows to compute +smoothed forecasted prevalences with a five-age moving average +centered at the mid-age of the five-age period.

    + + + +

    Last uncommented line : Population +forecasting

    + +
    popforecast=0 popfile=pyram.txt popfiledate=1/1/1989 last-popfiledate=1/1/1992
    + +

    This command is available if the interpolation unit is a +month, i.e. stepm=1 and if popforecast=1. From a data file +including age and number of persons alive at the precise date +‘popfiledate’, you can forecast the number of persons +in each state until date ‘last-popfiledate’. In this +example, the popfile pyram.txt +includes real data which are the Japanese population in 1989.

    + + +

    Running Imach with this example

    -

    We assume that you entered your 1st_example +

    We assume that you entered your 1st_example parameter file as explained above. To run the program you should click on the imach.exe icon and enter the name of the parameter file which is for example

    Once the optimization is finished, some graphics can be made with a grapher. We use Gnuplot which is an interactive plotting -program copyrighted but freely distributed. Imach outputs the -source of a gnuplot file, named 'graph.gp', which can be directly -input into gnuplot.
    +program copyrighted but freely distributed. A gnuplot reference +manual is available here.
    When the running is finished, the user should enter a caracter for plotting and output editing.

    @@ -543,16 +666,8 @@ for plotting and output editing.

    @@ -578,9 +693,6 @@ The header of the file is

    71 0.99681 625 627 71 0.00319 2 627 72 0.97125 1115 1148 72 0.02875 33 1148
    -
    # Age Prev(1) N(1) N Age Prev(2) N(2) N
    -    70 0.95721 604 631 70 0.04279 27 631
    -

    It means that at age 70, the prevalence in state 1 is 1.000 and in state 2 is 0.00 . At age 71 the number of individuals in state 1 is 625 and in state 2 is 2, hence the total number of @@ -592,22 +704,26 @@ covariance matrix: This file contains all the maximisation results:

    -
     Number of iterations=47
    - -2 log likelihood=46553.005854373667  
    - Estimated parameters: a12 = -12.691743 b12 = 0.095819 
    -                       a13 = -7.815392   b13 = 0.031851 
    -                       a21 = -1.809895 b21 = -0.030470 
    -                       a23 = -7.838248  b23 = 0.039490  
    - Covariance matrix: Var(a12) = 1.03611e-001
    -                    Var(b12) = 1.51173e-005
    -                    Var(a13) = 1.08952e-001
    -                    Var(b13) = 1.68520e-005  
    -                    Var(a21) = 4.82801e-001
    -                    Var(b21) = 6.86392e-005
    -                    Var(a23) = 2.27587e-001
    -                    Var(b23) = 3.04465e-005 
    +
     -2 log likelihood= 21660.918613445392
    + Estimated parameters: a12 = -12.290174 b12 = 0.092161 
    +                       a13 = -9.155590  b13 = 0.046627 
    +                       a21 = -2.629849  b21 = -0.022030 
    +                       a23 = -7.958519  b23 = 0.042614  
    + Covariance matrix: Var(a12) = 1.47453e-001
    +                    Var(b12) = 2.18676e-005
    +                    Var(a13) = 2.09715e-001
    +                    Var(b13) = 3.28937e-005  
    +                    Var(a21) = 9.19832e-001
    +                    Var(b21) = 1.29229e-004
    +                    Var(a23) = 4.48405e-001
    +                    Var(b23) = 5.85631e-005 
      
    +

    By substitution of these parameters in the regression model, +we obtain the elementary transition probabilities:

    + +

    +
    - Transition probabilities: pijrbiaspar.txt
    @@ -617,30 +733,33 @@ is a multiple of 2 years. The first colu the transition probabilities p11, p12, p13, p21, p22, p23. For example, line 5 of the file is:

    -
     100 106 0.03286 0.23512 0.73202 0.02330 0.19210 0.78460 
    +
     100 106 0.02655 0.17622 0.79722 0.01809 0.13678 0.84513 

    and this means:

    -
    p11(100,106)=0.03286
    -p12(100,106)=0.23512
    -p13(100,106)=0.73202
    -p21(100,106)=0.02330
    -p22(100,106)=0.19210 
    -p22(100,106)=0.78460 
    +
    p11(100,106)=0.02655
    +p12(100,106)=0.17622
    +p13(100,106)=0.79722
    +p21(100,106)=0.01809
    +p22(100,106)=0.13678
    +p22(100,106)=0.84513 
    - Stationary prevalence in each state: plrbiaspar.txt
    -
    #Age 1-1 2-2 
    -70 0.92274 0.07726 
    -71 0.91420 0.08580 
    -72 0.90481 0.09519 
    -73 0.89453 0.10547
    +
    #Prevalence
    +#Age 1-1 2-2
     
    -

    At age 70 the stationary prevalence is 0.92274 in state 1 and -0.07726 in state 2. This stationary prevalence differs from +#************ +70 0.90134 0.09866 +71 0.89177 0.10823 +72 0.88139 0.11861 +73 0.87015 0.12985

    + +

    At age 70 the stationary prevalence is 0.90134 in state 1 and +0.09866 in state 2. This stationary prevalence differs from observed prevalence. Here is the point. The observed prevalence at age 70 results from the incidence of disability, incidence of recovery and mortality which occurred in the past of the cohort. @@ -664,24 +783,24 @@ design of the survey, and, for the stati model used and fitted. It is possible to compute the standard deviation of the stationary prevalence at each age.

    -
    Observed and stationary +
    -Observed and stationary prevalence in state (2=disable) with the confident interval: -vbiaspar2.gif
    +vbiaspar21.gif
    -


    -This graph exhibits the stationary prevalence in state (2) with -the confidence interval in red. The green curve is the observed -prevalence (or proportion of individuals in state (2)). Without -discussing the results (it is not the purpose here), we observe -that the green curve is rather below the stationary prevalence. -It suggests an increase of the disability prevalence in the -future.

    - -

    - -
    Convergence to the -stationary prevalence of disability: pbiaspar1.gif
    -
    +

    This graph exhibits the stationary prevalence in state (2) +with the confidence interval in red. The green curve is the +observed prevalence (or proportion of individuals in state (2)). +Without discussing the results (it is not the purpose here), we +observe that the green curve is rather below the stationary +prevalence. It suggests an increase of the disability prevalence +in the future.

    + +

    + +
    -Convergence to the +stationary prevalence of disability: pbiaspar11.gif
    +

    This graph plots the conditional transition probabilities from an initial state (1=healthy in red at the bottom, or 2=disable in @@ -703,23 +822,23 @@ href="erbiaspar.txt">erbiaspar.txt# Health expectancies # Age 1-1 1-2 2-1 2-2 -70 10.7297 2.7809 6.3440 5.9813 -71 10.3078 2.8233 5.9295 5.9959 -72 9.8927 2.8643 5.5305 6.0033 -73 9.4848 2.9036 5.1474 6.0035

    +70 10.9226 3.0401 5.6488 6.2122 +71 10.4384 3.0461 5.2477 6.1599 +72 9.9667 3.0502 4.8663 6.1025 +73 9.5077 3.0524 4.5044 6.0401 -
    For example 70 10.7297 2.7809 6.3440 5.9813 means:
    -e11=10.7297 e12=2.7809 e21=6.3440 e22=5.9813
    +
    For example 70 10.4227 3.0402 5.6488 5.7123 means:
    +e11=10.4227 e12=3.0402 e21=5.6488 e22=5.7123
    -
    +

    For example, life expectancy of a healthy individual at age 70 -is 10.73 in the healthy state and 2.78 in the disability state -(=13.51 years). If he was disable at age 70, his life expectancy -will be shorter, 6.34 in the healthy state and 5.98 in the -disability state (=12.32 years). The total life expectancy is a -weighted mean of both, 13.51 and 12.32; weight is the proportion +is 10.42 in the healthy state and 3.04 in the disability state +(=13.46 years). If he was disable at age 70, his life expectancy +will be shorter, 5.64 in the healthy state and 5.71 in the +disability state (=11.35 years). The total life expectancy is a +weighted mean of both, 13.46 and 11.35; weight is the proportion of people disabled at age 70. In order to get a pure period index (i.e. based only on incidences) we use the computed or @@ -736,7 +855,7 @@ href="vrbiaspar.txt">vrbiaspar.txtFor example, the covariances of life expectancies Cov(ei,ej) at age 50 are (line 3)

    -
       Cov(e1,e1)=0.4667  Cov(e1,e2)=0.0605=Cov(e2,e1)  Cov(e2,e2)=0.0183
    +
       Cov(e1,e1)=0.4776  Cov(e1,e2)=0.0488=Cov(e2,e1)  Cov(e2,e2)=0.0424
    - Health @@ -746,24 +865,24 @@ href="trbiaspar.txt">Total life expectancy by +
    -Total life expectancy by age and health expectancies in states (1=healthy) and (2=disable): -ebiaspar.gif
    +
    ebiaspar1.gif

    This figure represents the health expectancies and the total life expectancy with the confident interval in dashed curve.

    -
            
    +
            

    Standard deviations (obtained from the information matrix of the model) of these quantities are very useful. @@ -826,9 +945,7 @@ estimated by month on 8,000 people may t Also, the program is not yet a statistical package, which permits a simple writing of the variables and the model to take into account in the maximisation. The actual program allows only to -add simple variables without covariations, like age+sex but -without age+sex+ age*sex . This can be done from the source code -(you have to change three lines in the source code) but will +add simple variables like age+sex or age+sex+ age*sex but will never be general enough. But what is to remember, is that incidences or probability of change from one state to another is affected by the variables specified into the model.

    @@ -853,27 +970,73 @@ file
    : - Prevalence forecasting
    : +frbiaspar.txt + +

    First, +we have estimated the observed prevalence between 1/1/1984 and +1/6/1988. The mean date of interview (weighed average of the +interviews performed between1/1/1984 and 1/6/1988) is estimated +to be 13/9/1985, as written on the top on the file. Then we +forecast the probability to be in each state.

    + +

    Example, +at date 1/1/1989 :

    + +
    # StartingAge FinalAge P.1 P.2 P.3
    +# Forecasting at date 1/1/1989
    +  73 0.807 0.078 0.115
    + +

    Since +the minimum age is 70 on the 13/9/1985, the youngest forecasted +age is 73. This means that at age a person aged 70 at 13/9/1989 +has a probability to enter state1 of 0.807 at age 73 on 1/1/1989. +Similarly, the probability to be in state 2 is 0.078 and the +probability to die is 0.115. Then, on the 1/1/1989, the +prevalence of disability at age 73 is estimated to be 0.088.

    + +
    - Population forecasting: +poprbiaspar.txt
    + +
    # Age P.1 P.2 P.3 [Population]
    +# Forecasting at date 1/1/1989 
    +75 572685.22 83798.08 
    +74 621296.51 79767.99 
    +73 645857.70 69320.60 
    + +
    # Forecasting at date 1/1/19909 
    +76 442986.68 92721.14 120775.48
    +75 487781.02 91367.97 121915.51
    +74 512892.07 85003.47 117282.76 
    + +

    From the population file, we estimate the number of people in +each state. At age 73, 645857 persons are in state 1 and 69320 +are in state 2. One year latter, 512892 are still in state 1, +85003 are in state 2 and 117282 died before 1/1/1990.

    +
    -

    Trying an example

    +

    Trying an example

    Since you know how to run the program, it is time to test it on your own computer. Try for example on a parameter file named imachpar.txt which is a -copy of mypar.txt -included in the subdirectory of imach, mytry. Edit it to change the name of -the data file to ..\data\mydata.txt -if you don't want to copy it on the same directory. The file mydata.txt is a smaller file of 3,000 -people but still with 4 waves.

    +href="..\mytry\imachpar.txt">imachpar.txt which is a copy of mypar.txt included in the +subdirectory of imach, mytry. +Edit it to change the name of the data file to ..\data\mydata.txt if you don't want to +copy it on the same directory. The file mydata.txt +is a smaller file of 3,000 people but still with 4 waves.

    Click on the imach.exe icon to open a window. Answer to the question:'Enter the parameter file name:'

    - @@ -983,23 +1146,19 @@ requires a caracter:

    IMACH, Version 0.63

    Enter +

    IMACH, Version 0.71

    Enter the parameter file name: ..\mytry\imachpar.txt

    - +
    Type g for plotting (available - if mle=1), e to edit output files, c to start again,

    and - q for exiting:

    -
    Type e to edit output files, c + to start again, and q for exiting:
    -

    First you should enter g to -make the figures and then you can edit all the results by typing e. -

    +

    First you should enter e to +edit the master file mypar.htm.

    @@ -1043,8 +1209,8 @@ simple justification (name, email, insti href="mailto:brouard@ined.fr">mailto:brouard@ined.fr and mailto:lievre@ined.fr .

    -

    Latest version (0.63 of 16 march 2000) can be accessed at http://euroreves.ined.fr/imach
    +

    Latest version (0.71a of March 2002) can be accessed at http://euroreves.ined.fr/imach