    * Rep_Age adjusted Univariate Survival supplement.sps.

    * Written by PSKL on 10/03/03.

    * Produce tables of order statistics of survival curves for two additional descriptive variables.

    Get file = 'D:\Longitudinal Data\Rep_Longitudinal Analysis Age group Master 1991 to 2001.sav'.

    weight by weight.

    * Create additional variables.

    Compute chpaygra=chpaygr.
    If (chpaygr=0 and chgepay=0) chpaygra=3.
    If (chpaygr=0 and chgepay=1) chpaygra=4.

    compute Montplac=XDATE.Month((doplacn + YRMODA(1899,12,31))*24*60*60).

    Variable labels chpaygra 'change of charge-paying'
      montplac 'month of restoration placement'.

    Value labels montplac
     1 'January'
     2 'February'
     3 'March'
     4 'April'
     5 'May'
     6 'June'
     7 'July'
     8 'August'
     9 'September'
     10 'October'
     11 'November'
     12 'December'
     /chpaygra
     -1 'not applicable'
      0 'no change'
      1 'non-paying to paying'
      2 'paying to non-paying'
      3 'no change non-payer'
      4 'no change full payer'.

    * First check overall survival.

    KM
      time  /STATUS=reint(1)
        /PRINT MEAN
        /PERCENTILES = (25,35,40,45,50,55,60,65,70,75,80,85,90,95)
        /Save survival (survall).

# Kaplan-Meier

Notes
Output Created | 30-MAY-2003 17:16:00
Comments |
Input | Data | D:\Longitudinal Data\Rep_Longitudinal Analysis Age group Master 1991 to 2001.sav
Filter | <none>
Weight | weighting (for time-dependent censor adjustment)
Split File | <none>
N of Rows in Working Data File | 813324
Syntax | KM time /STATUS=reint(1) /PRINT MEAN /PERCENTILES = (25,35,40,45,50,55,60,65,70,75,80,85,90,95) /Save survival (survall).
Resources | Elapsed Time | 0:02:40.03

     Survival Analysis for TIME     Time to reintervention

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2553.71                 .09     (  2553.53,   2553.88 )
     (Limited to   4017.0 )
     Median:    3063.00                 .47     (  3062.09,   3063.91 )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .        3813.00      3063.00      2488.00      1998.00      1594.00      1255.00
     Standard Error        .            .            .            .            .47          .33          .25          .19          .15

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              967.00       723.00       515.00       332.00       175.00
     Standard Error        .12          .09          .07          .05          .

    >Warning # 3211
    >On at least one case, the value of the weight variable was zero, negative,
    >or missing.  Such cases are invisible to statistical procedures and graphs
    >which need positively weighted cases, but remain on the file and are
    >processed by non-statistical facilities such as LIST and SAVE.

    * Now analyse the new variables.

    KM
      time  /STATUS=reint(1)
        /strata = montplac
        /PRINT MEAN
        /PERCENTILES = (25,35,40,45,50,55,60,65,70,75,80,85,90,95)
        /Save survival (survmpla).

# Kaplan-Meier

Notes
Output Created | 30-MAY-2003 17:18:43
Comments |
Input | Data | D:\Longitudinal Data\Rep_Longitudinal Analysis Age group Master 1991 to 2001.sav
Filter | <none>
Weight | weighting (for time-dependent censor adjustment)
Split File | <none>
N of Rows in Working Data File | 813324
Syntax | KM time /STATUS=reint(1) /strata = montplac /PRINT MEAN /PERCENTILES = (25,35,40,45,50,55,60,65,70,75,80,85,90,95) /Save survival (survmpla).
Resources | Elapsed Time | 0:02:35.32

     Survival Analysis for TIME     Time to reintervention

     Strata MONTPLAC = January

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2551.18                 .30     (  2550.60,   2551.77 )
     (Limited to   4017.0 )
     Median:    3054.00                1.55     (  3050.97,   3057.03 )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .        3827.00      3054.00      2494.00      1996.00      1584.00      1247.00
     Standard Error        .            .            .            .           1.55         1.09          .86          .66          .50

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              966.00       728.00       511.00       342.00       175.00
     Standard Error        .38          .30          .22          .16          .12

     Survival Analysis for TIME     Time to reintervention

     Strata MONTPLAC = February

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2531.89                 .30     (  2531.30,   2532.48 )
     (Limited to   3986.0 )
     Median:    2997.00                1.50     (  2994.07,   2999.93 )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .        3724.00      2997.00      2458.00      2009.00      1590.00      1258.00
     Standard Error        .            .            .            .           1.50         1.04          .84          .67          .52

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              963.00       726.00       506.00       332.00       174.00
     Standard Error        .40          .31          .23          .16          .

     Survival Analysis for TIME     Time to reintervention

     Strata MONTPLAC = March

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2542.31                 .28     (  2541.76,   2542.85 )
     (Limited to   3958.0 )
     Median:    3114.00                 .       (      .  ,       .   )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .            .        3114.00      2528.00      2036.00      1631.00      1281.00
     Standard Error        .            .            .            .            .           1.07          .82          .64          .50

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              980.00       734.00       528.00       346.00       183.00
     Standard Error        .39          .29          .21          .15          .

     Survival Analysis for TIME     Time to reintervention

     Strata MONTPLAC = April

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2546.66                 .30     (  2546.08,   2547.24 )
     (Limited to   3927.0 )
     Median:    3220.00                 .       (      .  ,       .   )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .            .        3220.00      2578.00      2087.00      1658.00      1301.00
     Standard Error        .            .            .            .            .           1.24          .91          .72          .56

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              994.00       754.00       539.00       348.00       182.00
     Standard Error        .42          .31          .24          .17          .

     Survival Analysis for TIME     Time to reintervention

     Strata MONTPLAC = May

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2498.24                 .29     (  2497.68,   2498.81 )
     (Limited to   3897.0 )
     Median:    3032.00                1.48     (  3029.09,   3034.91 )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .        3725.00      3032.00      2462.00      1974.00      1589.00      1258.00
     Standard Error        .            .            .            .           1.48         1.11          .84          .64          .49

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              990.00       733.00       530.00       343.00       180.00
     Standard Error        .39          .31          .23          .17          .

     Survival Analysis for TIME     Time to reintervention

     Strata MONTPLAC = June

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2490.10                 .29     (  2489.54,   2490.66 )
     (Limited to   3866.0 )
     Median:    3068.00                1.56     (  3064.94,   3071.06 )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .        3793.00      3068.00      2482.00      1995.00      1608.00      1275.00
     Standard Error        .            .            .            .           1.56         1.13          .84          .64          .51

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              989.00       729.00       527.00       336.00       175.00
     Standard Error        .41          .31          .23          .17          .

     Survival Analysis for TIME     Time to reintervention

     Strata MONTPLAC = July

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2478.50                 .29     (  2477.94,   2479.06 )
     (Limited to   3836.0 )
     Median:    3127.00                 .       (      .  ,       .   )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .            .        3127.00      2489.00      2018.00      1575.00      1240.00
     Standard Error        .            .            .            .            .           1.18          .88          .69          .50

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              965.00       721.00       512.00       332.00       178.00
     Standard Error        .39          .30          .23          .16          .

     Survival Analysis for TIME     Time to reintervention

     Strata MONTPLAC = August

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2450.80                 .31     (  2450.19,   2451.40 )
     (Limited to   3805.0 )
     Median:    3077.00                 .       (      .  ,       .   )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .            .        3077.00      2458.00      1973.00      1573.00      1246.00
     Standard Error        .            .            .            .            .           1.27          .92          .70          .56

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              947.00       720.00       516.00       317.00       167.00
     Standard Error        .43          .31          .25          .18          .

     Survival Analysis for TIME     Time to reintervention

     Strata MONTPLAC = September

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2447.42                 .29     (  2446.85,   2447.98 )
     (Limited to   3773.0 )
     Median:    3101.00                1.52     (  3098.01,   3103.99 )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .        3733.00      3101.00      2555.00      2033.00      1603.00      1246.00
     Standard Error        .            .            .            .           1.52         1.18          .96          .72          .55

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              951.00       705.00       505.00       331.00       175.00
     Standard Error        .42          .31          .22          .16          .

     Survival Analysis for TIME     Time to reintervention

     Strata MONTPLAC = October

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2423.78                 .28     (  2423.23,   2424.33 )
     (Limited to   3744.0 )
     Median:    3059.00                 .       (      .  ,       .   )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .            .        3059.00      2488.00      1975.00      1582.00      1238.00
     Standard Error        .            .            .            .            .           1.17          .88          .66          .54

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              934.00       700.00       503.00       320.00       168.00
     Standard Error        .40          .29          .22          .16          .

     Survival Analysis for TIME     Time to reintervention

     Strata MONTPLAC = November

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2398.30                 .27     (  2397.77,   2398.84 )
     (Limited to   3713.0 )
     Median:    2931.00                1.48     (  2928.09,   2933.91 )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .        3640.00      2931.00      2396.00      1954.00      1557.00      1232.00
     Standard Error        .            .            .            .           1.48         1.04          .81          .65          .50

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              953.00       722.00       502.00       321.00       161.00
     Standard Error        .38          .30          .23          .16          .

     Survival Analysis for TIME     Time to reintervention

     Strata MONTPLAC = December

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2382.04                 .30     (  2381.45,   2382.63 )
     (Limited to   3683.0 )
     Median:    2989.00                 .       (      .  ,       .   )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .            .        2989.00      2421.00      1919.00      1535.00      1225.00
     Standard Error        .            .            .            .            .           1.25          .94          .68          .53

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              945.00       692.00       481.00       301.00       158.00
     Standard Error        .44          .34          .25          .17          .

     Survival Analysis for TIME     Time to reintervention

                                      Total      Number       Number        Percent
                                                 Events      Censored      Censored

    MONTPLAC        January          ******      ******       ******          65.99

    MONTPLAC        February         ******      ******       ******          66.47

    MONTPLAC        March            ******      ******       ******          67.22

    MONTPLAC        April            ******      ******       ******          67.56

    MONTPLAC        May              ******      ******       ******          67.36

    MONTPLAC        June             ******      ******       ******          67.75

    MONTPLAC        July             ******      ******       ******          68.24

    MONTPLAC        August           ******      ******       ******          68.37

    MONTPLAC        September        ******      ******       ******          69.03

    MONTPLAC        October          ******      ******       ******          68.84

    MONTPLAC        November         ******      ******       ******          68.87

    MONTPLAC        December         ******      ******       ******          68.52

    Overall                        ********    ********     ********          67.84

    >Warning # 3211
    >On at least one case, the value of the weight variable was zero, negative,
    >or missing.  Such cases are invisible to statistical procedures and graphs
    >which need positively weighted cases, but remain on the file and are
    >processed by non-statistical facilities such as LIST and SAVE.

    KM
      time  /STATUS=reint(1)
        /strata = chpaygra
        /PRINT MEAN
        /PERCENTILES = (25,35,40,45,50,55,60,65,70,75,80,85,90,95)
        /Save survival (survchpg).

# Kaplan-Meier

Notes
Output Created | 30-MAY-2003 17:21:21
Comments |
Input | Data | D:\Longitudinal Data\Rep_Longitudinal Analysis Age group Master 1991 to 2001.sav
Filter | <none>
Weight | weighting (for time-dependent censor adjustment)
Split File | <none>
N of Rows in Working Data File | 813324
Syntax | KM time /STATUS=reint(1) /strata = chpaygra /PRINT MEAN /PERCENTILES = (25,35,40,45,50,55,60,65,70,75,80,85,90,95) /Save survival (survchpg).
Resources | Elapsed Time | 0:03:36.62

     Survival Analysis for TIME     Time to reintervention

     Strata CHPAYGRA = not applicable

    >Warning # 20077.  Command name: KM
    >Survival estimates cannot be computed since all observations are censored.

     Survival Analysis for TIME     Time to reintervention

     Strata CHPAYGRA = non-paying to paying

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2511.55                 .22     (  2511.12,   2511.98 )
     (Limited to   4017.0 )
     Median:    2957.00                 .99     (  2955.05,   2958.95 )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .        3615.00      2957.00      2371.00      1914.00      1513.00      1186.00
     Standard Error        .            .            .            .            .99          .76          .59          .47          .37

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              911.00       667.00       458.00       287.00       154.00
     Standard Error        .29          .24          .18          .12          .

     Survival Analysis for TIME     Time to reintervention

     Strata CHPAYGRA = paying to non-paying

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2465.19                 .28     (  2464.64,   2465.73 )
     (Limited to   4016.0 )
     Median:    2711.00                1.08     (  2708.88,   2713.12 )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .        3332.00      2711.00      2212.00      1793.00      1453.00      1148.00
     Standard Error        .            .            .            .           1.08          .84          .66          .53          .43

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              896.00       679.00       495.00       317.00       173.00
     Standard Error        .34          .27          .22          .16          .

     Survival Analysis for TIME     Time to reintervention

     Strata CHPAYGRA = no change non-payer

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2381.08                 .25     (  2380.60,   2381.57 )
     (Limited to   4016.0 )
     Median:    2499.00                 .88     (  2497.27,   2500.73 )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .        3745.00      3044.00      2499.00      2036.00      1630.00      1301.00      1026.00
     Standard Error        .            .            .           1.28          .88          .68          .53          .40          .30

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              796.00       585.00       398.00       244.00       140.00
     Standard Error        .24          .20          .15          .09          .

     Survival Analysis for TIME     Time to reintervention

     Strata CHPAYGRA = no change full payer

              Survival Time    Standard Error   95% Confidence Interval

     Mean:      2528.49                 .12     (  2528.26,   2528.73 )
     (Limited to   4016.0 )
     Median:    3031.00                 .63     (  3029.76,   3032.24 )

                                                                   Percentiles

                         25.00        35.00        40.00        45.00        50.00        55.00        60.00        65.00        70.00

     Value                 .            .            .        3817.00      3031.00      2431.00      1937.00      1526.00      1193.00
     Standard Error        .            .            .            .            .63          .44          .33          .25          .19

                                                                   Percentiles

                         75.00        80.00        85.00        90.00        95.00

     Value              908.00       667.00       459.00       287.00       156.00
     Standard Error        .15          .12          .09          .06          .

     Survival Analysis for TIME     Time to reintervention

                                           Total   Number    Number     Percent
                                                   Events   Censored   Censored

    CHPAYGRA     not applicable           ******        0    ******      100.00

    CHPAYGRA     non-paying to paying     ******   ******    ******       58.32

    CHPAYGRA     paying to non-paying     ******   ******    ******       55.42

    CHPAYGRA     no change non-payer      ******   ******    ******       64.63

    CHPAYGRA     no change full payer     ******   ******    ******       64.23

    Overall                             ******** ********  ********       67.84

    >Warning # 3211
    >On at least one case, the value of the weight variable was zero, negative,
    >or missing.  Such cases are invisible to statistical procedures and graphs
    >which need positively weighted cases, but remain on the file and are
    >processed by non-statistical facilities such as LIST and SAVE.

    weight off.

    Save outfile='D:\temp1.sav'.

    ********************************************************************************************************.
    * Create Excel file for plotting.

    Get file='D:\temp1.sav'.

    select if (reint=1).

    sort cases by time.

    If (Montplac = 1) Mont1=survmpla.
    If (Montplac = 2) Mont2=survmpla.
    If (Montplac = 3) Mont3=survmpla.
    If (Montplac = 4) Mont4=survmpla.
    If (Montplac = 5) Mont5=survmpla.
    If (Montplac = 6) Mont6=survmpla.
    If (Montplac = 7) Mont7=survmpla.
    If (Montplac = 8) Mont8=survmpla.
    If (Montplac = 9) Mont9=survmpla.
    If (Montplac = 10) Mont10=survmpla.
    If (Montplac = 11) Mont11=survmpla.
    If (Montplac = 12) Mont12=survmpla.

    If (chpaygra = 1)   chpaygr1 = survchpg.
    If (chpaygra = 2)   chpaygr2 = survchpg.
    If (chpaygra = 3)   chpaygr3 = survchpg.
    If (chpaygra = 4)   chpaygr4 = survchpg.

    aggregate outfile=*
     /presorted
     /break time
     / survall mont1 mont2 mont3 mont4 mont5 mont6 mont7 mont8 mont9 mont10 mont11 mont12
      chpaygr1 chpaygr2 chpaygr3 chpaygr4
      = max(survall mont1 mont2 mont3 mont4 mont5 mont6 mont7 mont8 mont9 mont10 mont11 mont12
      chpaygr1 chpaygr2 chpaygr3 chpaygr4).

    Save outfile='D:\Longitudinal Data\Rep_Age adjusted Univariate Survival supplement.sav'.

    SAVE TRANSLATE OUTFILE='I:\Research Projects\Longevity\Rep_Univariate Survival 1 supplement.xls'
      /TYPE=XLS /MAP /REPLACE /FIELDNAMES.

    Data written to I:\Research Projects\Longevity\Rep_Univariate Survival 1 supplement.xls.
    18 variables and 3775 cases written to range: SPSS.
    Variable: TIME       Type: Number   Width:  8   Dec: 2
    Variable: SURVALL    Type: Number   Width: 10   Dec: 5
    Variable: MONT1      Type: Number   Width:  8   Dec: 2
    Variable: MONT2      Type: Number   Width:  8   Dec: 2
    Variable: MONT3      Type: Number   Width:  8   Dec: 2
    Variable: MONT4      Type: Number   Width:  8   Dec: 2
    Variable: MONT5      Type: Number   Width:  8   Dec: 2
    Variable: MONT6      Type: Number   Width:  8   Dec: 2
    Variable: MONT7      Type: Number   Width:  8   Dec: 2
    Variable: MONT8      Type: Number   Width:  8   Dec: 2
    Variable: MONT9      Type: Number   Width:  8   Dec: 2
    Variable: MONT10     Type: Number   Width:  8   Dec: 2
    Variable: MONT11     Type: Number   Width:  8   Dec: 2
    Variable: MONT12     Type: Number   Width:  8   Dec: 2
    Variable: CHPAYGR1   Type: Number   Width:  8   Dec: 2
    Variable: CHPAYGR2   Type: Number   Width:  8   Dec: 2
    Variable: CHPAYGR3   Type: Number   Width:  8   Dec: 2
    Variable: CHPAYGR4   Type: Number   Width:  8   Dec: 2