--- imach096d/doc/imach.htm 2001/05/09 14:09:37 1.3 +++ imach096d/doc/imach.htm 2002/03/13 17:27:44 1.12 @@ -1,3 +1,4 @@ + @@ -6,6 +7,13 @@ content="text/html; charset=iso-8859-1"> Computing Health Expectancies using IMaCh + + + + + + @@ -29,7 +37,7 @@ color="#00006A">INEDEUROREVES

Version -64b, May 2001

+0.8, March 2002


@@ -58,8 +66,6 @@ color="#00006A">) +

In this example, we have two covariates in the data file +(fields 2 and 3). The number of covariates included in the data file +between the id and the date of birth is ncovcol=2 (it was named ncov +in version prior to 0.8). If you have 3 covariates in the datafile +(fields 2, 3 and 4), you will set ncovcol=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

@@ -377,7 +399,7 @@ optimization. The number of parameters, number of absorbing states and non-absorbing states and on the number of covariates.
N is given by the formula N=(nlstate + -ndeath-1)*nlstate*ncov .
+ndeath-1)*nlstate*ncovmodel .

Thus in the simple case with 2 covariates (the model is log (pij/pii) = aij + bij * age where intercept and age are the two @@ -387,9 +409,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
@@ -399,7 +420,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
@@ -408,10 +430,49 @@ Each of the four lines starts with indic
 23 0.0 0.0
+

In order to speed up the convergence you can make a first run with +a large stepm i.e stepm=12 or 24 and then decrease the stepm until +stepm=1 month. If newstepm is the new shorter stepm and stepm can be +expressed as a multiple of newstepm, like newstepm=n stepm, then the +following approximation holds: +

aij(stepm) = aij(n . stepm) - ln(n)
+
and +
bij(stepm) = bij(n . stepm) .
+ +

For example if you already ran for a 6 months interval and +got:
+

# Parameters
+12 -13.390179  0.126133 
+13  -7.493460  0.048069 
+21   0.575975 -0.041322 
+23  -4.748678  0.030626 
+
+If you now want to get the monthly estimates, you can guess the aij by +substracting ln(6)= 1,7917
and running
+
12 -15.18193847  0.126133 
+13 -9.285219469  0.048069
+21 -1.215784469 -0.041322
+23 -6.540437469  0.030626
+
+and get
+
12 -15.029768 0.124347 
+13 -8.472981 0.036599 
+21 -1.472527 -0.038394 
+23 -6.553602 0.029856 
+
+which is closer to the results. The approximation is probably useful +only for very small intervals and we don't have enough experience to +know if you will speed up the convergence or not. +
         -ln(12)= -2.484
+ -ln(6/1)=-ln(6)= -1.791
+ -ln(3/1)=-ln(3)= -1.0986
+-ln(12/6)=-ln(2)= -0.693
+
+

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).

@@ -421,20 +482,13 @@ matrix of the parameters, that is the in matrix, and the variances of health expectancies. Each line consists in indices "ij" followed by the initial scales (zero to simplify) associated with aij and bij.

- - - -
-
# Scales (for hessian or gradient estimation)
+
  • If mle=1 you can enter zeros:
  • +
    # Scales (for hessian or gradient estimation)
     12 0. 0. 
     13 0. 0. 
     21 0. 0. 
     23 0. 0. 
    - -
    • If mle=0 you must enter a covariance matrix (usually obtained from an earlier run).
    @@ -442,24 +496,18 @@ 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).

    - -

    Each line starts with indices "ijk" followed by the -covariances between aij and bij:

    - +rerunning the rather long maximisation phase (mle=0).
    +Each line starts with indices "ijk" followed by the +covariances between aij and bij:
        121 Var(a12) 
        122 Cov(b12,a12)  Var(b12) 
               ...
        232 Cov(b23,a12)  Cov(b23,b12) ... Var (b23) 
    -
    • If mle=1 you can enter zeros.
    • -
    - -
    # Covariance matrix
     121 0.
     122 0. 0.
    @@ -469,32 +517,28 @@ covariances between aij and bij: 

    212 0. 0. 0. 0. 0. 0. 231 0. 0. 0. 0. 0. 0. 0. 232 0. 0. 0. 0. 0. 0. 0. 0.
    -
    - -
    • If mle=0 you must enter a covariance matrix (usually - obtained from an earlier run).
      -
    • + obtained from an earlier run).
    -

    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 +
    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.

    - -

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

    +102. It is possible to get extrapolated stationary prevalence by +age ranging 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!
    • agemin= Minimum age for calculation of the stationary prevalence
    • @@ -502,31 +546,139 @@ prevalence by age raning from agemin to stationary prevalence
    • bage= Minimum age for calculation of the health expectancies
    • -
    • fage= Maximum ages for calculation of the health +
    • fage= Maximum age for calculation of the health expectancies
    +

    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. +
      +
    • begin-prev-date= Starting date + (day/month/year)
    • +
    • end-prev-date= Final date + (day/month/year)
    • +
    + +

    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.
    + +

      +
    • popbased= 0 Health expectancies are + computed at each age from stationary prevalences + 'expected' at this initial age.
    • +
    • popbased= 1 Health expectancies are + computed at each age from cross-sectional 'observed' + prevalence at this initial age. As all the population is + not observed at the same exact date we define a short + period were the observed prevalence is computed.
    • +
    + +

    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.
    + +

      +
    • starting-proj-date= starting date + (day/month/year) of forecasting
    • +
    • final-proj-date= final date + (day/month/year) of forecasting
    • +
    • mov_average= smoothing with a five-age + moving average centered at the mid-age of the five-age + period. The command mov_average takes + value 1 if the prevalences are smoothed and 0 otherwise.
    • +
    + +

    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.
    + +

      +
    • popforecast= + 0 Option for population forecasting. If + popforecast=1, the programme does the forecasting.
    • +
    • popfile= + name of the population file
    • +
    • popfiledate= + date of the population population
    • +
    • last-popfiledate= + date of the last population projection 
    • +
    +

    Running Imach with this 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 +We assume that you typed in your 1st_example +parameter file as explained above. +
    To run the program you should either: +

    • click on the imach.exe icon and enter the name of the parameter file which is for example C:\usr\imach\mle\biaspar.txt -(you also can click on the biaspar.txt icon located in
      -C:\usr\imach\mle and put it with -the mouse on the imach window).
      -

      +href="C:\usr\imach\mle\biaspar.imach">C:\usr\imach\mle\biaspar.imach +
    • You also can locate the biaspar.imach icon in +C:\usr\imach\mle with your mouse and drag it with +the mouse on the imach window). +
    • With latest version (0.7 and higher) if you setup windows in order to +understand ".imach" extension you can right click the +biaspar.imach icon and either edit with notepad the parameter file or +execute it with imach or whatever. +
    -

    The time to converge depends on the step unit that you used (1 +The time to converge depends on the step unit that you used (1 month is cpu consuming), on the number of cases, and on the -number of variables.

    +number of variables. -

    The program outputs many files. Most of them are files which -will be plotted for better understanding.

    +
    The program outputs many files. Most of them are files which +will be plotted for better understanding.
    @@ -536,11 +688,11 @@ and graphs

    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. A gnuplot reference -manual is available here.
    +manual is available here.
    When the running is finished, the user should enter a caracter -for plotting and output editing.

    +for plotting and output editing. -

    These caracters are:

    +
    These caracters are:
    • 'c' to start again the program from the beginning.
    • @@ -578,7 +730,7 @@ people aged 71 is 625+2=627.

      - Estimated parameters and -covariance matrix: rbiaspar.txt
      +covariance matrix: rbiaspar.imach

      This file contains all the maximisation results:

      @@ -705,18 +857,18 @@ href="erbiaspar.txt">erbiaspar.txt -
      For example 70 10.9226 3.0401 5.6488 6.2122 means:
      -e11=10.9226 e12=3.0401 e21=5.6488 e22=6.2122
      +
      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.92 in the healthy state and 3.04 in the disability state -(=13.96 years). If he was disable at age 70, his life expectancy -will be shorter, 5.64 in the healthy state and 6.21 in the -disability state (=11.85 years). The total life expectancy is a -weighted mean of both, 13.96 and 11.85; 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 @@ -743,14 +895,14 @@ href="trbiaspar.txt">-Total life expectancy by @@ -848,14 +1000,61 @@ 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 +href="..\mytry\imachpar.imach">imachpar.imach which is a copy of mypar.imach 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 @@ -867,8 +1066,8 @@ question:'Enter the parameter fi -
      IMACH, Version 0.64b

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

      +
      IMACH, Version 0.8

      Enter + the parameter file name: ..\mytry\imachpar.imach

      @@ -886,7 +1085,7 @@ href="imachrun.LOG">this Log file # title=MLE datafile=..\data\mydata.txt lastobs=3000 firstpass=1 lastpass=3 -ftol=1.000000e-008 stepm=24 ncov=2 nlstate=2 ndeath=1 maxwav=4 mle=1 weight=0

+ftol=1.000000e-008 stepm=24 ncovcol=2 nlstate=2 ndeath=1 maxwav=4 mle=1 weight=0
  • Total number of individuals= 2965, Agemin = 70.00, Agemax= 100.92
     
    @@ -991,7 +1190,7 @@ edit the master file mypar.htm. <
             - Observed prevalence in each state: pmypar.txt 
    - Estimated parameters and the covariance matrix: rmypar.txt
    + href="..\mytry\rmypar.txt">rmypar.imach
    - Stationary prevalence in each state: plrmypar.txt
    - Transition probabilities: < - Health expectancies with their variances: trmypar.txt
    - Standard deviation of stationary prevalence: vplrmypar.txt
    + href="..\mytry\vplrmypar.txt">vplrmypar.txt
    + - Prevalences forecasting: frmypar.txt
    + - Population forecasting (if popforecast=1): poprmypar.txt
  • Graphs

    - -One-step transition - probabilities
    - -Convergence to the - stationary prevalence
    - -Observed and stationary - prevalence in state (1) with the confident interval
    - -Observed and stationary - prevalence in state (2) with the confident interval
    - -Health life - expectancies by age and initial health state (1)
    - -Health life - expectancies by age and initial health state (2)
    - -Total life expectancy by - age and health expectancies in states (1) and (2).
  • + -One-step transition probabilities
    + -Convergence to the stationary prevalence
    + -Observed and stationary prevalence in state (1) with the confident interval
    + -Observed and stationary prevalence in state (2) with the confident interval
    + -Health life expectancies by age and initial health state (1)
    + -Health life expectancies by age and initial health state (2)
    + -Total life expectancy by age and health expectancies in states (1) and (2).

    This software have been partly granted by mailto:brouard@ined.fr and mailto:lievre@ined.fr .

    -

    Latest version (0.64b of may 2001) can be accessed at http://euroreves.ined.fr/imach
    +

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