. // this is operating on rymbp2 for this do file
. *********   Psychological sequelae:
.
. cd /Users/robertyaffee/Documents/data/research/chwk/phase4/survival/wk
/Users/robertyaffee/Documents/data/research/chwk/phase4/survival/wk

.
.
. use stdep28aug2013.dta, clear

.
.
.
. di c(filename)
stdep28aug2013.dta

. di c(pwd)
/Users/robertyaffee/Documents/data/research/chwk/phase4/survival/wk

. di c(current_date)
 2 Sep 2013

. di c(current_time)
13:25:53

.
. global user "Robert Alan Yaffee"

. di "$user"
Robert Alan Yaffee

. di c(os)
MacOSX

. di c(osdtl)
10.6.8

.
. sort id date depinr

.
. // New Variable Construction
.
. * whole sample age group
. cap drop agegp

. by id: g agegp = 0 if age < 43
(868 missing values generated)

. by id: replace agegp = 1 if age > 42 & age < 56
(432 real changes made)

. by id: replace agegp = 2 if age < 85 & age >= 56
(436 real changes made)

.
.  label var agegp "3way bkdwn of age in years"

.  cap label drop ag

.  label define ag  0 "28 thru 42" 1 "43 thru 55"  2 "56 thru 84"

.  label values agegp ag

.  tab agegp

 3way bkdwn |
  of age in |
      years |      Freq.     Percent        Cum.
------------+-----------------------------------
 28 thru 42 |        342       28.26       28.26
 43 thru 55 |        432       35.70       63.97
 56 thru 84 |        436       36.03      100.00
------------+-----------------------------------
      Total |      1,210      100.00

.
. * Defining gender-specific agegroups: magegp and fagegp
. cap drop magegp

. g magegp = 0 if age <= 41 & gender==1
(1053 missing values generated)

.  replace magegp = 1 if age >41 & age < 56 & gender==1
(194 real changes made)

.  replace magegp = 2 if age >= 56 & age < 78 & gender==1
(175 real changes made)

. cap label define mag 0 "30 thru 40" 1 "41 thru 55" 2 "56 thru 77"

.  label values magegp mag

.  label var magegp "Male specific age group in years"

.  tab magegp

       Male |
   specific |
  age group |
   in years |      Freq.     Percent        Cum.
------------+-----------------------------------
 30 thru 40 |        157       29.85       29.85
 41 thru 55 |        194       36.88       66.73
 56 thru 77 |        175       33.27      100.00
------------+-----------------------------------
      Total |        526      100.00

.
. * Defining gender-specific agegroups: magegp and fagegp
. cap drop fagegp

. g fagegp = 0 if age < 43 & gender==2
(1041 missing values generated)

.  replace fagegp = 1 if age > 43 & age < 57 & gender==2
(256 real changes made)

.  replace fagegp = 2 if age > 56 & age < 84 & gender==2
(243 real changes made)

. cap label define fag 0 "28 thru 43" 1 "44 thru 56" 2 "57 thru 84"

.  label values fagegp fag

.  label var fagegp "Female specific age group in years"

. tab fagegp

     Female |
   specific |
  age group |
   in years |      Freq.     Percent        Cum.
------------+-----------------------------------
 28 thru 43 |        169       25.30       25.30
 44 thru 56 |        256       38.32       63.62
 57 thru 84 |        243       36.38      100.00
------------+-----------------------------------
      Total |        668      100.00

.
.  centile avgcumdosew, centile(50)

                                                       -- Binom. Interp. --
    Variable |     Obs  Percentile      Centile        [95% Conf. Interval]
-------------+-------------------------------------------------------------
 avgcumdosew |     1210        50         .7915        .7705151       .8189

.    cap gen cumdosewgp = 0 if avgcumdosew <= r(c_1)

.         replace cumdosewgp = 1 if avgcumdosew > r(c_1) & avgcumdosew < .
(0 real changes made)

.   cap   label define cdg 0 "low" 1 "high"

.    label values cumdosewgp cdg

.    label var cumdosewgp "Avgcumdosew grouped into low and high"

.  xtset id date
       panel variable:  id (unbalanced)
        time variable:   date, 1980h2 to 2010h2, but with gaps
                delta:  1 halfyear

.
.   sort id date

.   cap drop rdhlgp

.   centile radhlw, centile(50)

                                                       -- Binom. Interp. --
    Variable |     Obs  Percentile      Centile        [95% Conf. Interval]
-------------+-------------------------------------------------------------
      radhlw |     1210        50            50              50          50

.  cap gen rdhlgp = 0 if radhlw <= 50

.   replace rdhlgp = 1 if radhlw > 50 & radhlw < .
(559 real changes made)

.   cap label define rgp 0 "low" 1 "high"

.   label values rdhlgp rgp

.   tab rdhlgp

     rdhlgp |      Freq.     Percent        Cum.
------------+-----------------------------------
        low |        651       53.80       53.80
       high |        559       46.20      100.00
------------+-----------------------------------
      Total |      1,210      100.00

.   label var rdhlgp "Radhlw grouped into low and high"

.
.  xtset id date
       panel variable:  id (unbalanced)
        time variable:   date, 1980h2 to 2010h2, but with gaps
                delta:  1 halfyear

.
.   cap drop rdfgp

.   centile radfmw, centile(50)

                                                       -- Binom. Interp. --
    Variable |     Obs  Percentile      Centile        [95% Conf. Interval]
-------------+-------------------------------------------------------------
      radfmw |     1210        50            70              60          80

.   gen rdfgp = 0 if radfmw <= 70
(596 missing values generated)

.   replace rdfgp = 1 if radfmw > 70 & radfmw < .
(596 real changes made)

. cap label define fgp 0 "low" 1 "high"

.   label values rdfgp fgp

.   tab rdfgp

      rdfgp |      Freq.     Percent        Cum.
------------+-----------------------------------
        low |        614       50.74       50.74
       high |        596       49.26      100.00
------------+-----------------------------------
      Total |      1,210      100.00

.   label var rdfgp "Radfmw grouped into low and high"

.
.   centile radfmw, centile(50)

                                                       -- Binom. Interp. --
    Variable |     Obs  Percentile      Centile        [95% Conf. Interval]
-------------+-------------------------------------------------------------
      radfmw |     1210        50            70              60          80

.
.   centile kzchorn, centile(50)

                                                       -- Binom. Interp. --
    Variable |     Obs  Percentile      Centile        [95% Conf. Interval]
-------------+-------------------------------------------------------------
     kzchorn |     1210        50            80              80          80

.
.   cap drop kzchorngp

.   g kzchorngp = 0 if kzchorn <= 80
(540 missing values generated)

.   replace kzchorngp = 1 if kzchorn > 80
(540 real changes made)

.   label values kzchorngp fgp

.    tab kzchorngp

  kzchorngp |      Freq.     Percent        Cum.
------------+-----------------------------------
        low |        670       55.37       55.37
       high |        540       44.63      100.00
------------+-----------------------------------
      Total |      1,210      100.00

.
.  cap by id: gen married = 0

.    by id: replace married = 1 if marrw == 3
(0 real changes made)

.   cap label define mar 0  "not married" 1 "married"

.    label values married mar

.    label var married "Is respondent married or not?"

.
.  cap drop unemp

.  cap by id: gen unemp=0

.  by id: replace unemp=1 if emplw==5
(77 real changes made)

.  cap label define unem 0 "no" 1 "yes"

.  label values unemp unem

.
.  alpha radhlw radfmw kzchorn, item detail

Test scale = mean(unstandardized items)

                                                            average
                             item-test     item-rest       interitem
Item         |  Obs  Sign   correlation   correlation     covariance      alpha
-------------+-----------------------------------------------------------------
radhlw       | 1210    +       0.9177        0.7924        646.7494      0.7292
radfmw       | 1210    +       0.9132        0.7857        667.7054      0.7358
kzchorn      | 1210    +       0.8037        0.6176        1064.827      0.8902
-------------+-----------------------------------------------------------------
Test scale   |                                             793.0941      0.8538
-------------+-----------------------------------------------------------------

Interitem covariances (obs=1210 in all pairs)

            radhlw     radfmw    kzchorn
 radhlw  1347.5683
 radfmw  1064.8274  1307.2353
kzchorn   667.7054   646.7494   946.8030

.
.  sort id date

.  cap drop percHlthRsk

.  by id: gen percHlthRsk = 0

.  by id: replace percHlthRsk = (radhlw + radfmw + kzchorn)/3
(1131 real changes made)

.  label var percHlthRsk "Perceived risk of exposure to radiation"

.
. cap gen percRiskgp = 0 if percHlthRsk < 50

. replace percRiskgp = 1 if percHlthRsk >= 50 & percHlthRsk < 83.3334
(0 real changes made)

. replace percRiskgp = 2 if percHlthRsk >=83.3334 & percHlthRsk < .
(0 real changes made)

. cap label define prg 0 "low" 1 "medium" 2 "high"

. label values percRiskgp prg

. label var percRiskgp "Perceived risk group level"

. tab percRiskgp

  Perceived |
 risk group |
      level |      Freq.     Percent        Cum.
------------+-----------------------------------
        low |        373       30.83       30.83
     medium |        440       36.36       67.19
       high |        397       32.81      100.00
------------+-----------------------------------
      Total |      1,210      100.00

.
.  cap gen y2009 = 0

. replace y2009 = 1 if year >= 2009 & year < .
(0 real changes made)

.
. cap gen fcrisis2007 = 0

. replace fcrisis2007 = 1 if year >= 2007 & year < .
(0 real changes made)

.
. cap gen fcrisis2008 = 0

. replace fcrisis2008 = 1 if year >= 2008 & year < .
(0 real changes made)

.
. cap gen Chornobyl = 0

. replace Chornobyl = 1 if date >= h(1986h1) & date <= ihdate
(0 real changes made)

.  save stdepress28aug2013c, replace
file stdepress28aug2013c.dta saved

.
. sort id date

.
. title Examination of total depression time for respondents in recurrent episodes


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                            Examination                              *****
*****                                 of                                  *****
*****                               total                                 *****
*****                             depression                              *****
*****                                time                                 *****
*****                                for                                  *****
*****                            respondents                              *****
*****                                 in                                  *****
*****                             recurrent                               *****
*****                              episodes                               *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:25:53  *****
*******************************************************************************
*******************************************************************************


.
. stset endepdate, id(id) failure(outcome==1) time0(startdate) exit(time .)

                id:  id
     failure event:  outcome == 1
obs. time interval:  (startdate, endepdate]
 exit on or before:  time .

------------------------------------------------------------------------------
     1210  total observations
        0  exclusions
------------------------------------------------------------------------------
     1210  observations remaining, representing
      683  subjects
      980  failures in multiple-failure-per-subject data
    29853  total analysis time at risk and under observation
                                              at risk from t =         0
                                   earliest observed entry t =        40
                                        last observed exit t =       101

.
. title Summary statistics for depression episode history analysis among Chornobyl survivors


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                              Summary                                *****
*****                             statistics                              *****
*****                                for                                  *****
*****                             depression                              *****
*****                              episode                                *****
*****                              history                                *****
*****                              analysis                               *****
*****                               among                                 *****
*****                             Chornobyl                               *****
*****                             survivors                               *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:25:53  *****
*******************************************************************************
*******************************************************************************


.
. set more off

. bysort gender: stdescribe  /* describing the data for males and females */

-------------
-> gender = 1. male

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

                                   +-------------- per subject --------------+
Category                   total        mean         min     median        max
------------------------------------------------------------------------------
no. of subjects              331
no. of records               526    1.589124           1          1          8

(first) entry time                        40          40         40         40
(final) exit time                   86.65861          41         98        101

subjects with gap             91
time on gap if gap           586    3.005128           1          2         20
time at risk               14858    44.88822           1         54         61

failures                     396    1.196375           0          1          8
------------------------------------------------------------------------------

-------------
-> gender = 2. female

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

                                   +-------------- per subject --------------+
Category                   total        mean         min     median        max
------------------------------------------------------------------------------
no. of subjects              352
no. of records               684    1.943182           1          1          9

(first) entry time                        40          40         40         40
(final) exit time                   85.35511          41         94        101

subjects with gap            132
time on gap if gap           970    2.921687           1          2         22
time at risk               14995    42.59943           1       46.5         61

failures                     584    1.659091           0          1          9
------------------------------------------------------------------------------

. set more off

. sort id date depinr

. bysort agegp: stdescribe // age group breakdown

-------------
-> agegp = 28 thru 42

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

                                   +-------------- per subject --------------+
Category                   total        mean         min     median        max
------------------------------------------------------------------------------
no. of subjects              236
no. of records               342    1.449153           1          1          7

(first) entry time                        40          40         40         40
(final) exit time                   89.42373          41         98        101

subjects with gap             54
time on gap if gap           316    2.981132           2          2         20
time at risk               11348    48.08475           1         56         61

failures                     234    .9915254           0          1          7
------------------------------------------------------------------------------

-------------
-> agegp = 43 thru 55

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

                                   +-------------- per subject --------------+
Category                   total        mean         min     median        max
------------------------------------------------------------------------------
no. of subjects              227
no. of records               432    1.903084           1          1          8

(first) entry time                        40          40         40         40
(final) exit time                   84.51982          41         96        101

subjects with gap             85
time on gap if gap           641    3.126829           1          2         22
time at risk                9465    41.69604           1         48         61

failures                     370    1.629956           0          1          8
------------------------------------------------------------------------------

-------------
-> agegp = 56 thru 84

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

                                   +-------------- per subject --------------+
Category                   total        mean         min     median        max
------------------------------------------------------------------------------
no. of subjects              220
no. of records               436    1.981818           1          1          9

(first) entry time                        40          40         40         40
(final) exit time                   83.81364          41         93        101

subjects with gap             84
time on gap if gap           599    2.773148           1          2         10
time at risk                9040    41.09091           1         46         61

failures                     376    1.709091           0          1          9
------------------------------------------------------------------------------

.
. sort id date

. stset endepdate, id(id) failure(outcome==1) time0(startdate) exit(time .)

                id:  id
     failure event:  outcome == 1
obs. time interval:  (startdate, endepdate]
 exit on or before:  time .

------------------------------------------------------------------------------
     1210  total observations
        0  exclusions
------------------------------------------------------------------------------
     1210  observations remaining, representing
      683  subjects
      980  failures in multiple-failure-per-subject data
    29853  total analysis time at risk and under observation
                                              at risk from t =         0
                                   earliest observed entry t =        40
                                        last observed exit t =       101

. title Life table analysis of males and females


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                                Life                                 *****
*****                               table                                 *****
*****                              analysis                               *****
*****                                 of                                  *****
*****                               males                                 *****
*****                                and                                  *****
*****                              females                                *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:25:53  *****
*******************************************************************************
*******************************************************************************


.
. tab depinr

 Depression |
    episode |
   sequence |
     number |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        230       19.01       19.01
          1 |        453       37.44       56.45
          2 |        223       18.43       74.88
          3 |        134       11.07       85.95
          4 |         77        6.36       92.31
          5 |         48        3.97       96.28
          6 |         24        1.98       98.26
          7 |         13        1.07       99.34
          8 |          7        0.58       99.92
          9 |          1        0.08      100.00
------------+-----------------------------------
      Total |      1,210      100.00

. scatter tothyrsdep year  || lowess tothyrsdep year, ///
>    legend(rows(2)) title(Total accumulated depression time over the years)

.
.
. stci, by(depinr outcome)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

depinr       |    no. of
outcome      |  subjects         50%     Std. Err.     [95% Conf. Interval]
-------------+-------------------------------------------------------------
     0 never |       230           .             .            .          .
  1 reported |       453          56      1.351191           54         60
  2 reported |       223          52      .8601491           44         52
  3 reported |       134          54      1.990538           50         58
  4 reported |        77          56             .           56         70
  5 reported |        48          62             .            .          .
  6 reported |        24          72             .            .          .
  7 reported |        13          84      2.309401           82         90
  8 reported |         7          90             .           90          .
  9 reported |         1           .             .            .          .
-------------+-------------------------------------------------------------
       total |       683          66      1.367573           64         68

.
. // Graphical decomposition of survival probability
. sts graph, surv by(gender) xtitle(Analysis time in 62 half-year periods 1980-2009)  ///
>   xline(40 52)  text(.5 39 "1980 Study recall begins" .5 51 "1986 Chornobyl event", orientation(vertical)) ///
>   ytitle(Probability of no depression) ci

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save kmsurv.gph, replace
(file kmsurv.gph saved)

. graph export kmsurv.eps, replace
(file kmsurv.eps written in EPS format)

.
. sts graph, surv by(agegp) xtitle(Analysis time in 62 half-year periods 1980-2009)  ///
>   xline(40 52)  text(.35 39 "1980 Study begins" .26 50 "1986 Chornobyl", orientation(vertical)) ///
>   ytitle(Probability of no depression) ci title(Surival probability by age group) ///
>   legend(rows(6))

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save kmsurvxage.gph, replace
(file kmsurvxage.gph saved)

. graph export kmsurvxage.eps, replace
(file kmsurvxage.eps written in EPS format)

.
. sts graph, surv by(percRiskgp) xtitle(Analysis time in 62 half-year periods 1980-2009)  ///
>   xline(40 52)  text(.35 39 "Study recall begins" .29 51 "1986 Chornobyl", orientation(vertical)) ///
>   ytitle("Probability of no depression")  ///
>   ci title(Survival Probability by level of perceived risk of exposure) ///
>   legend(rows(6))

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save kmsurvxprg.gph, replace
(file kmsurvxprg.gph saved)

. graph export kmsurvxprg.eps, replace
(file kmsurvxprg.eps written in EPS format)

.
. stsum, by(depinr gender)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

depinr   |               incidence       no. of    +------ Survival time -----+
gender   | time at risk     rate        subjects        25%       50%       75%
---------+---------------------------------------------------------------------
       0 |
 1. male |         7835          0           130          .         .         .
       0 |
2. femal |         5921          0           100          .         .         .
       1 |
 1. male |         4610   .0436009           201         52        54        76
       1 |
2. femal |         5927   .0425173           252         52        58        76
       2 |
 1. male |         1345    .067658            91         50        52        66
       2 |
2. femal |         1630   .0809816           132         44        50        52
       3 |
 1. male |          676   .0769231            52         54        58        76
       3 |
2. femal |          743   .1103634            82         50        54        56
       4 |
 1. male |          240   .1166667            28         62        62        76
       4 |
2. femal |          391   .1253197            49         56        56        60
       5 |
 1. male |          118   .1355932            16         76        80        82
       5 |
2. femal |          197   .1624365            32         62        62        62
       6 |
 1. male |           12   .3333333             4         84        84        84
       6 |
2. femal |          104   .1923077            20         72        72        72
       7 |
 1. male |           20        .15             3         94        94       100
       7 |
2. femal |           56   .1785714            10         82        84        90
       8 |
 1. male |            2         .5             1          .         .         .
       8 |
2. femal |           24        .25             6         90        90        96
       9 |
2. femal |            2         .5             1          .         .         .
---------+---------------------------------------------------------------------
   total |        29853   .0328275           683         52        66        86

. sts list, by(gender)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

           Beg.          Net            Survivor      Std.
  Time    Total   Fail   Lost           Function     Error     [95% Conf. Int.]
-------------------------------------------------------------------------------
1. male
    40        0      0   -331             1.0000         .          .         .
    41      331     17      0             0.9486    0.0121     0.9187    0.9678
    42      314      4     -4             0.9366    0.0134     0.9044    0.9582
    43      314      1      0             0.9336    0.0137     0.9009    0.9558
    44      313      5     -6             0.9187    0.0150     0.8836    0.9435
    46      314      4     -2             0.9070    0.0159     0.8703    0.9336
    48      312      4     -4             0.8953    0.0167     0.8573    0.9237
    50      312      5     -3             0.8810    0.0177     0.8413    0.9112
    52      310     63     -2             0.7019    0.0246     0.6508    0.7471
    54      249     10    -20             0.6738    0.0251     0.6217    0.7203
    56      259     12    -11             0.6425    0.0255     0.5901    0.6901
    58      258      8    -10             0.6226    0.0257     0.5700    0.6707
    60      260     12    -11             0.5939    0.0258     0.5414    0.6424
    62      259      5    -13             0.5824    0.0258     0.5300    0.6311
    64      267     10     -6             0.5606    0.0258     0.5085    0.6094
    66      263     10     -9             0.5393    0.0256     0.4877    0.5880
    68      262      6     -3             0.5269    0.0256     0.4756    0.5756
    70      259      6     -4             0.5147    0.0254     0.4637    0.5633
    72      257     16     -5             0.4827    0.0251     0.4327    0.5308
    74      246      7     -7             0.4689    0.0249     0.4194    0.5168
    76      246     14     -5             0.4423    0.0245     0.3938    0.4896
    78      237     15     -6             0.4143    0.0240     0.3670    0.4608
    80      228     18    -12             0.3816    0.0233     0.3359    0.4270
    82      222     13    -12             0.3592    0.0227     0.3148    0.4037
    84      221      8     -6             0.3462    0.0224     0.3026    0.3901
    86      219     10     -6             0.3304    0.0219     0.2879    0.3735
    88      215     13     -2             0.3104    0.0213     0.2693    0.3524
    90      204      8     -8             0.2983    0.0209     0.2579    0.3395
    92      204     15     -5             0.2763    0.0201     0.2377    0.3162
    94      194     16     -6             0.2535    0.0192     0.2167    0.2919
    96      184     20     -3             0.2260    0.0181     0.1915    0.2623
    97      167      2      0             0.2233    0.0180     0.1890    0.2593
    98      165     21     15             0.1949    0.0167     0.1632    0.2286
    99      129      0     12             0.1949    0.0167     0.1632    0.2286
   100      117     17     14             0.1665    0.0156     0.1372    0.1984
   101       86      1     85             0.1646    0.0156     0.1354    0.1963
2. female
    40        0      0   -352             1.0000         .          .         .
    41      352     23      0             0.9347    0.0132     0.9033    0.9561
    42      329      5    -15             0.9205    0.0144     0.8869    0.9444
    44      339     10     -2             0.8933    0.0164     0.8564    0.9212
    46      331      1     -9             0.8906    0.0165     0.8534    0.9188
    48      339      7     -3             0.8722    0.0176     0.8331    0.9027
    50      335     11     -8             0.8436    0.0190     0.8021    0.8770
    52      332     68     -5             0.6708    0.0240     0.6212    0.7154
    54      269      9    -30             0.6484    0.0244     0.5983    0.6938
    56      290     23    -16             0.5969    0.0247     0.5468    0.6434
    58      283      9    -18             0.5779    0.0247     0.5280    0.6246
    60      292     22    -11             0.5344    0.0245     0.4852    0.5811
    62      281     15    -14             0.5059    0.0243     0.4573    0.5524
    64      280     23    -10             0.4643    0.0238     0.4171    0.5101
    66      267     15    -16             0.4382    0.0234     0.3920    0.4835
    68      268     22    -10             0.4023    0.0227     0.3577    0.4464
    70      256     21    -21             0.3693    0.0219     0.3264    0.4122
    72      256     22     -8             0.3375    0.0211     0.2965    0.3789
    74      242      8    -20             0.3264    0.0207     0.2861    0.3672
    76      254     25     -8             0.2942    0.0197     0.2562    0.3332
    78      237     21    -14             0.2682    0.0187     0.2321    0.3054
    80      230     28    -14             0.2355    0.0174     0.2022    0.2704
    82      216     18    -20             0.2159    0.0166     0.1843    0.2492
    84      218     17    -10             0.1991    0.0158     0.1691    0.2309
    86      211     15     -8             0.1849    0.0151     0.1564    0.2154
    87      204      2      0             0.1831    0.0150     0.1547    0.2134
    88      202     12    -14             0.1722    0.0144     0.1450    0.2014
    90      204     21     -5             0.1545    0.0134     0.1292    0.1819
    92      188     22    -10             0.1364    0.0124     0.1132    0.1618
    94      176     21     -5             0.1201    0.0114     0.0989    0.1436
    96      160     35     -2             0.0939    0.0098     0.0759    0.1141
    98      127     20     36             0.0791    0.0088     0.0630    0.0974
    99       71      2     11             0.0768    0.0087     0.0610    0.0949
   100       58     10     31             0.0636    0.0081     0.0490    0.0808
   101       17      1     16             0.0599    0.0085     0.0447    0.0779
-------------------------------------------------------------------------------

. sts list, by(agegp)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

           Beg.          Net            Survivor      Std.
  Time    Total   Fail   Lost           Function     Error     [95% Conf. Int.]
-------------------------------------------------------------------------------
28 thru 42
    40        0      0   -236             1.0000         .          .         .
    41      236      5      0             0.9788    0.0094     0.9499    0.9911
    44      231      3      0             0.9661    0.0118     0.9334    0.9829
    46      228      0     -1             0.9661    0.0118     0.9334    0.9829
    48      229      2     -1             0.9577    0.0131     0.9227    0.9770
    50      228      2     -2             0.9493    0.0143     0.9124    0.9709
    52      228     22     -1             0.8577    0.0226     0.8066    0.8961
    54      207      5     -8             0.8370    0.0239     0.7837    0.8781
    56      210      9     -7             0.8011    0.0257     0.7450    0.8461
    58      208      3     -7             0.7895    0.0262     0.7327    0.8357
    60      212      5     -3             0.7709    0.0268     0.7131    0.8186
    62      210      7     -4             0.7452    0.0276     0.6862    0.7948
    64      207      6     -5             0.7236    0.0282     0.6639    0.7746
    66      206      9     -4             0.6920    0.0289     0.6314    0.7447
    68      201      6     -3             0.6713    0.0292     0.6104    0.7249
    70      198     11     -7             0.6340    0.0297     0.5728    0.6890
    72      194     11     -2             0.5981    0.0299     0.5369    0.6539
    74      185      5     -7             0.5819    0.0300     0.5208    0.6381
    76      187     11     -3             0.5477    0.0299     0.4871    0.6042
    78      179     10     -4             0.5171    0.0298     0.4572    0.5736
    80      173      7     -5             0.4962    0.0296     0.4369    0.5526
    82      171      8     -5             0.4730    0.0293     0.4145    0.5291
    84      168      6     -7             0.4561    0.0291     0.3983    0.5119
    86      169     12     -3             0.4237    0.0285     0.3674    0.4787
    87      160      1      0             0.4210    0.0284     0.3649    0.4760
    88      159      7     -5             0.4025    0.0280     0.3474    0.4569
    90      157      4     -4             0.3922    0.0278     0.3377    0.4463
    92      157     11     -2             0.3648    0.0270     0.3120    0.4176
    94      148      8     -3             0.3450    0.0265     0.2936    0.3970
    96      143     17     -1             0.3040    0.0251     0.2556    0.3537
    97      127      2      0             0.2992    0.0249     0.2512    0.3487
    98      125     11     17             0.2729    0.0240     0.2270    0.3207
    99       97      0     11             0.2729    0.0240     0.2270    0.3207
   100       86      6     21             0.2539    0.0235     0.2090    0.3010
   101       59      2     57             0.2453    0.0235     0.2006    0.2924
43 thru 55
    40        0      0   -227             1.0000         .          .         .
    41      227     18      0             0.9207    0.0179     0.8771    0.9493
    42      209      3    -10             0.9075    0.0192     0.8616    0.9387
    43      216      1      0             0.9033    0.0196     0.8568    0.9352
    44      215      4     -1             0.8865    0.0210     0.8378    0.9212
    46      212      2     -4             0.8781    0.0216     0.8284    0.9142
    48      214      1     -2             0.8740    0.0219     0.8238    0.9107
    50      215      7      0             0.8456    0.0236     0.7925    0.8860
    52      208     47     -1             0.6545    0.0306     0.5909    0.7107
    54      162      7    -22             0.6262    0.0311     0.5620    0.6837
    56      177      8    -10             0.5979    0.0313     0.5338    0.6561
    58      179      7     -9             0.5745    0.0313     0.5108    0.6330
    60      181     20     -4             0.5110    0.0309     0.4490    0.5696
    62      165      7    -13             0.4894    0.0306     0.4281    0.5477
    64      171     19     -8             0.4350    0.0296     0.3763    0.4921
    66      160      9    -14             0.4105    0.0291     0.3533    0.4668
    68      165     14     -3             0.3757    0.0281     0.3208    0.4304
    70      154      9    -12             0.3537    0.0274     0.3005    0.4073
    72      157     16    -10             0.3177    0.0260     0.2674    0.3690
    74      151      2    -10             0.3135    0.0258     0.2636    0.3645
    76      159     16     -4             0.2819    0.0244     0.2351    0.3305
    78      147     15     -7             0.2532    0.0230     0.2093    0.2992
    80      139     16    -11             0.2240    0.0215     0.1833    0.2673
    82      134      6    -13             0.2140    0.0209     0.1745    0.2562
    84      141      7     -5             0.2034    0.0203     0.1652    0.2444
    86      139      9     -5             0.1902    0.0194     0.1538    0.2297
    87      135      1      0             0.1888    0.0193     0.1525    0.2281
    88      134      8     -8             0.1775    0.0186     0.1428    0.2154
    90      134     10     -5             0.1643    0.0177     0.1314    0.2004
    92      129     17     -2             0.1426    0.0161     0.1128    0.1758
    94      114     10     -6             0.1301    0.0152     0.1022    0.1615
    96      110     23     -1             0.1029    0.0130     0.0792    0.1301
    98       88     18     19             0.0819    0.0113     0.0616    0.1057
    99       51      2      4             0.0786    0.0110     0.0588    0.1021
   100       45     11     11             0.0594    0.0097     0.0423    0.0805
   101       23      0     23             0.0594    0.0097     0.0423    0.0805
56 thru 84
    40        0      0   -220             1.0000         .          .         .
    41      220     17      0             0.9227    0.0180     0.8786    0.9512
    42      203      6     -9             0.8955    0.0206     0.8469    0.9293
    44      206      8     -7             0.8607    0.0232     0.8079    0.8999
    46      205      3     -6             0.8481    0.0240     0.7940    0.8889
    48      208      8     -4             0.8155    0.0257     0.7588    0.8601
    50      204      7     -9             0.7875    0.0269     0.7290    0.8348
    52      206     62     -5             0.5505    0.0314     0.4868    0.6096
    54      149      7    -20             0.5246    0.0314     0.4612    0.5840
    56      162     18    -10             0.4663    0.0308     0.4050    0.5253
    58      154      7    -12             0.4451    0.0304     0.3848    0.5036
    60      159      9    -15             0.4199    0.0298     0.3611    0.4776
    62      165      6    -10             0.4047    0.0294     0.3469    0.4616
    64      169      8     -3             0.3855    0.0288     0.3291    0.4415
    66      164      7     -7             0.3691    0.0282     0.3140    0.4241
    68      164      8     -7             0.3510    0.0275     0.2975    0.4050
    70      163      7     -6             0.3360    0.0269     0.2837    0.3889
    72      162     11     -1             0.3132    0.0260     0.2630    0.3644
    74      152      8    -10             0.2967    0.0252     0.2481    0.3467
    76      154     12     -6             0.2736    0.0241     0.2273    0.3217
    78      148     11     -9             0.2532    0.0231     0.2092    0.2995
    80      146     23    -10             0.2133    0.0209     0.1739    0.2556
    82      133     17    -14             0.1861    0.0193     0.1500    0.2253
    84      130     12     -4             0.1689    0.0181     0.1351    0.2059
    86      122      4     -6             0.1634    0.0177     0.1304    0.1997
    88      124     10     -3             0.1502    0.0168     0.1191    0.1847
    90      117     15     -4             0.1309    0.0153     0.1027    0.1627
    92      106      9    -11             0.1198    0.0145     0.0932    0.1499
    94      108     19     -2             0.0987    0.0127     0.0756    0.1254
    96       91     15     -3             0.0825    0.0113     0.0621    0.1064
    98       79     12     15             0.0699    0.0101     0.0518    0.0916
    99       52      0      8             0.0699    0.0101     0.0518    0.0916
   100       44     10     13             0.0540    0.0090     0.0383    0.0736
   101       21      0     21             0.0540    0.0090     0.0383    0.0736
-------------------------------------------------------------------------------

. sts list, by(percRiskgp)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

           Beg.          Net            Survivor      Std.
  Time    Total   Fail   Lost           Function     Error     [95% Conf. Int.]
-------------------------------------------------------------------------------
low
    40        0      0   -274             1.0000         .          .         .
    41      274     28      0             0.8978    0.0183     0.8554    0.9283
    42      246      8    -10             0.8686    0.0204     0.8226    0.9034
    43      248      1      0             0.8651    0.0206     0.8187    0.9004
    44      247     12     -4             0.8231    0.0229     0.7728    0.8632
    46      239      5     -3             0.8059    0.0237     0.7544    0.8477
    48      237      8     -2             0.7787    0.0248     0.7254    0.8228
    50      231      8     -3             0.7517    0.0257     0.6971    0.7979
    52      226     24      0             0.6719    0.0276     0.6144    0.7227
    54      202      8     -7             0.6453    0.0281     0.5872    0.6973
    56      201      6     -6             0.6260    0.0283     0.5677    0.6787
    58      201      2     -3             0.6198    0.0284     0.5615    0.6727
    60      202      7     -2             0.5983    0.0286     0.5399    0.6517
    62      197      3     -6             0.5892    0.0286     0.5309    0.6428
    64      200      8     -5             0.5656    0.0286     0.5075    0.6196
    66      197      6     -6             0.5484    0.0286     0.4905    0.6025
    68      197      6     -3             0.5317    0.0286     0.4742    0.5858
    70      194      6     -4             0.5152    0.0284     0.4581    0.5693
    72      192      8     -2             0.4938    0.0283     0.4373    0.5477
    74      186      1     -4             0.4911    0.0282     0.4347    0.5450
    76      189      7     -1             0.4729    0.0280     0.4171    0.5266
    78      183      5     -3             0.4600    0.0278     0.4047    0.5135
    80      181     11     -3             0.4321    0.0274     0.3779    0.4849
    82      173      4     -5             0.4221    0.0272     0.3684    0.4747
    84      174      5     -3             0.4099    0.0270     0.3568    0.4622
    86      172     11     -3             0.3837    0.0264     0.3321    0.4351
    88      164      5     -3             0.3720    0.0261     0.3210    0.4229
    90      162      4     -3             0.3628    0.0258     0.3124    0.4134
    92      161     12     -1             0.3358    0.0251     0.2871    0.3851
    94      150      3     -3             0.3291    0.0249     0.2809    0.3780
    96      150     13     -1             0.3006    0.0239     0.2544    0.3479
    97      138      2      0             0.2962    0.0238     0.2504    0.3433
    98      136     12     17             0.2701    0.0228     0.2263    0.3156
    99      107      0     11             0.2701    0.0228     0.2263    0.3156
   100       96      5     22             0.2560    0.0225     0.2130    0.3010
   101       69      1     68             0.2523    0.0225     0.2094    0.2973
medium
    40        0      0   -226             1.0000         .          .         .
    41      226      9      0             0.9602    0.0130     0.9249    0.9791
    42      217      0     -4             0.9602    0.0130     0.9249    0.9791
    44      221      2     -2             0.9515    0.0143     0.9141    0.9728
    46      221      0     -3             0.9515    0.0143     0.9141    0.9728
    48      224      2     -4             0.9430    0.0154     0.9039    0.9665
    50      226      7     -6             0.9138    0.0184     0.8696    0.9435
    52      225     48     -2             0.7188    0.0289     0.6577    0.7710
    54      179      6    -26             0.6947    0.0295     0.6327    0.7484
    56      199     15    -13             0.6424    0.0302     0.5798    0.6982
    58      197      8    -13             0.6163    0.0304     0.5538    0.6727
    60      202     11     -6             0.5827    0.0304     0.5208    0.6396
    62      197     12    -10             0.5472    0.0302     0.4861    0.6042
    64      195     13     -6             0.5108    0.0298     0.4508    0.5674
    66      188     12    -10             0.4782    0.0294     0.4195    0.5343
    68      186     11     -6             0.4499    0.0288     0.3926    0.5054
    70      181     12    -10             0.4200    0.0282     0.3644    0.4746
    72      179     18     -7             0.3778    0.0271     0.3249    0.4306
    74      168      5    -12             0.3666    0.0267     0.3144    0.4188
    76      175     13     -7             0.3393    0.0258     0.2893    0.3900
    78      169     15     -5             0.3092    0.0246     0.2617    0.3579
    80      159     15    -13             0.2800    0.0234     0.2351    0.3266
    82      157      8    -12             0.2658    0.0228     0.2222    0.3112
    84      161     14     -3             0.2427    0.0216     0.2015    0.2860
    86      150      7     -8             0.2313    0.0210     0.1914    0.2736
    87      151      1      0             0.2298    0.0209     0.1901    0.2719
    88      150     12     -4             0.2114    0.0199     0.1738    0.2517
    90      142     10     -6             0.1965    0.0191     0.1606    0.2352
    92      138     15     -5             0.1752    0.0178     0.1419    0.2114
    94      128     23     -2             0.1437    0.0157     0.1145    0.1761
    96      107     17     -2             0.1209    0.0142     0.0948    0.1503
    98       92     12     18             0.1051    0.0130     0.0813    0.1324
    99       62      1      8             0.1034    0.0129     0.0798    0.1305
   100       53     11     17             0.0819    0.0118     0.0608    0.1069
   101       25      1     24             0.0787    0.0117     0.0577    0.1037
high
    40        0      0   -183             1.0000         .          .         .
    41      183      3      0             0.9836    0.0094     0.9500    0.9947
    42      180      1     -5             0.9781    0.0108     0.9428    0.9917
    44      184      1     -2             0.9728    0.0120     0.9360    0.9886
    46      185      0     -5             0.9728    0.0120     0.9360    0.9886
    48      190      1     -1             0.9677    0.0130     0.9295    0.9854
    50      190      1     -2             0.9626    0.0139     0.9232    0.9820
    52      191     59     -5             0.6653    0.0336     0.5948    0.7263
    54      137      5    -17             0.6410    0.0341     0.5700    0.7034
    56      149     14     -8             0.5808    0.0345     0.5101    0.6448
    58      143      7    -12             0.5523    0.0344     0.4823    0.6168
    60      148     16    -14             0.4926    0.0338     0.4249    0.5567
    62      146      5    -11             0.4757    0.0334     0.4089    0.5395
    64      152     12     -5             0.4382    0.0325     0.3738    0.5007
    66      145      7     -9             0.4170    0.0319     0.3541    0.4787
    68      147     11     -4             0.3858    0.0309     0.3253    0.4459
    70      140      9    -11             0.3610    0.0300     0.3026    0.4196
    72      142     12     -4             0.3305    0.0287     0.2750    0.3870
    74      134      9    -11             0.3083    0.0277     0.2549    0.3631
    76      136     19     -5             0.2652    0.0255     0.2165    0.3163
    78      122     16    -12             0.2305    0.0236     0.1858    0.2781
    80      118     20    -10             0.1914    0.0212     0.1518    0.2345
    82      108     19    -15             0.1577    0.0188     0.1229    0.1964
    84      104      6    -10             0.1486    0.0181     0.1153    0.1860
    86      108      7     -3             0.1390    0.0173     0.1072    0.1748
    87      104      1      0             0.1377    0.0172     0.1061    0.1732
    88      103      8     -9             0.1270    0.0162     0.0973    0.1608
    90      104     15     -4             0.1087    0.0146     0.0822    0.1392
    92       93     10     -9             0.0970    0.0135     0.0727    0.1254
    94       92     11     -6             0.0854    0.0123     0.0633    0.1115
    96       87     25     -2             0.0608    0.0097     0.0437    0.0818
    98       64     17     16             0.0447    0.0079     0.0310    0.0620
    99       31      1      4             0.0432    0.0077     0.0298    0.0603
   100       26     11      6             0.0249    0.0061     0.0149    0.0392
   101        9      0      9             0.0249    0.0061     0.0149    0.0392
-------------------------------------------------------------------------------

.
. sts test gender if depinr < 6

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


          |   Events         Events
gender    |  observed       expected
----------+-------------------------
1. male   |       388         473.93
2. female |       547         461.07
----------+-------------------------
Total     |       935         935.00

                chi2(1) =      34.79
                Pr>chi2 =     0.0000

. sts test gender if depinr > 5

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


          |   Events         Events
gender    |  observed       expected
----------+-------------------------
1. male   |         8           9.32
2. female |        37          35.68
----------+-------------------------
Total     |        45          45.00

                chi2(1) =       0.65
                Pr>chi2 =     0.4205

. sts test agegp if depinr < 6

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


           |   Events         Events
agegp      |  observed       expected
-----------+-------------------------
28 thru 42 |       228         360.56
43 thru 55 |       352         294.79
56 thru 84 |       355         279.66
-----------+-------------------------
Total      |       935         935.00

                 chi2(2) =      88.04
                 Pr>chi2 =     0.0000

. sts test gender

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


          |   Events         Events
gender    |  observed       expected
----------+-------------------------
1. male   |       396         494.95
2. female |       584         485.05
----------+-------------------------
Total     |       980         980.00

                chi2(1) =      44.21
                Pr>chi2 =     0.0000

. sts test agegp

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


           |   Events         Events
agegp      |  observed       expected
-----------+-------------------------
28 thru 42 |       234         376.92
43 thru 55 |       370         308.89
56 thru 84 |       376         294.18
-----------+-------------------------
Total      |       980         980.00

                 chi2(2) =      98.26
                 Pr>chi2 =     0.0000

. sts test gender agegp

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


                      |   Events         Events
gender, agegp         |  observed       expected
----------------------+-------------------------
1. male, 28 thru 42   |       111         211.61
1. male, 43 thru 55   |       143         144.62
1. male, 56 thru 84   |       142         138.73
2. female, 28 thru 42 |       123         165.31
2. female, 43 thru 55 |       227         164.28
2. female, 56 thru 84 |       234         155.46
----------------------+-------------------------
Total                 |       980         980.00

                            chi2(5) =     135.45
                            Pr>chi2 =     0.0000

. sts test gender, wilcoxon

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


          |   Events         Events        Sum of
gender    |  observed       expected        ranks
----------+--------------------------------------
1. male   |       396         494.95       -46735
2. female |       584         485.05        46735
----------+--------------------------------------
Total     |       980         980.00            0

                chi2(1) =      38.05
                Pr>chi2 =     0.0000

. sts test agegp , wilcoxon

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


           |   Events         Events        Sum of
agegp      |  observed       expected        ranks
-----------+--------------------------------------
28 thru 42 |       234         376.92       -72496
43 thru 55 |       370         308.89        29195
56 thru 84 |       376         294.18        43301
-----------+--------------------------------------
Total      |       980         980.00            0

                 chi2(2) =      99.41
                 Pr>chi2 =     0.0000

. sts test gender agegp, wilcoxon

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


                      |   Events         Events        Sum of
gender, agegp         |  observed       expected        ranks
----------------------+--------------------------------------
1. male, 28 thru 42   |       111         211.61       -50419
1. male, 43 thru 55   |       143         144.62          417
1. male, 56 thru 84   |       142         138.73         3267
2. female, 28 thru 42 |       123         165.31       -22077
2. female, 43 thru 55 |       227         164.28        28778
2. female, 56 thru 84 |       234         155.46        40034
----------------------+--------------------------------------
Total                 |       980         980.00            0

                            chi2(5) =     129.82
                            Pr>chi2 =     0.0000

. sts test cumdosewgp, wilcoxon

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


           |   Events         Events        Sum of
cumdosewgp |  observed       expected        ranks
-----------+--------------------------------------
low        |       517         398.31        69850
high       |       463         581.69       -69850
-----------+--------------------------------------
Total      |       980         980.00            0

                 chi2(1) =      88.28
                 Pr>chi2 =     0.0000

. sts test cumdosewgp

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


           |   Events         Events
cumdosewgp |  observed       expected
-----------+-------------------------
low        |       517         398.31
high       |       463         581.69
-----------+-------------------------
Total      |       980         980.00

                 chi2(1) =      66.64
                 Pr>chi2 =     0.0000

. sts test percRiskgp

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


           |   Events         Events
percRiskgp |  observed       expected
-----------+-------------------------
low        |       255         383.93
medium     |       366         339.27
high       |       359         256.80
-----------+-------------------------
Total      |       980         980.00

                 chi2(2) =      95.39
                 Pr>chi2 =     0.0000

. sts test percRiskgp, wilcoxon

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


           |   Events         Events        Sum of
percRiskgp |  observed       expected        ranks
-----------+--------------------------------------
low        |       255         383.93       -52829
medium     |       366         339.27         9502
high       |       359         256.80        43327
-----------+--------------------------------------
Total      |       980         980.00            0

                 chi2(2) =      63.35
                 Pr>chi2 =     0.0000

. sts test rdhlgp

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


       |   Events         Events
rdhlgp |  observed       expected
-------+-------------------------
low    |       488         591.40
high   |       492         388.60
-------+-------------------------
Total  |       980         980.00

             chi2(1) =      50.35
             Pr>chi2 =     0.0000

. sts test rdhlgp, wilcoxon

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


       |   Events         Events        Sum of
rdhlgp |  observed       expected        ranks
-------+--------------------------------------
low    |       488         591.40       -43596
high   |       492         388.60        43596
-------+--------------------------------------
Total  |       980         980.00            0

             chi2(1) =      34.30
             Pr>chi2 =     0.0000

. sts test rdfgp

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


      |   Events         Events
rdfgp |  observed       expected
------+-------------------------
low   |       441         602.83
high  |       539         377.17
------+-------------------------
Total |       980         980.00

            chi2(1) =     125.00
            Pr>chi2 =     0.0000

. sts test rdfgp, wilcoxon

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


      |   Events         Events        Sum of
rdfgp |  observed       expected        ranks
------+--------------------------------------
low   |       441         602.83       -68470
high  |       539         377.17        68470
------+--------------------------------------
Total |       980         980.00            0

            chi2(1) =      85.28
            Pr>chi2 =     0.0000

. sts test kzchorngp

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


          |   Events         Events
kzchorngp |  observed       expected
----------+-------------------------
low       |       506         599.63
high      |       474         380.37
----------+-------------------------
Total     |       980         980.00

                chi2(1) =      41.65
                Pr>chi2 =     0.0000

. sts test kzchorngp, wilcoxon

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


          |   Events         Events        Sum of
kzchorngp |  observed       expected        ranks
----------+--------------------------------------
low       |       506         599.63       -38584
high      |       474         380.37        38584
----------+--------------------------------------
Total     |       980         980.00            0

                chi2(1) =      27.03
                Pr>chi2 =     0.0000

.
.
.
. // Survival decomposition graphs
. sts graph, surv by(cumdosewgp) xtitle(Analysis time in 62 half-year periods 1980-2009)  ///
>   xline(40 52)  text(.45 39 "Study recall begins" .45 51 "1986 Chornobyl", orientation(vertical)) ///
>   title(Survival probability by exposure group) ///
>   ytitle(Probability of no depression) ci

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save kmsurvxcgp.gph, replace
(file kmsurvxcgp.gph saved)

. graph export kmsurvxcgp.eps, replace
(file kmsurvxcgp.eps written in EPS format)

.
. sts graph, surv by(rdhlgp) xtitle(Analysis time in 62 half-year periods 1980-2009)  ///
>   xline(40 52)  text(.35 39 "Recall begins" .35 51 "1986 Chornobyl event", orientation(vertical)) ///
>   ytitle(Probability of no depression) ci title(Survival probability by perceived self-health risk group)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save kmsurvxradhgp.gph, replace
(file kmsurvxradhgp.gph saved)

. graph export kmsurvxradhgp.eps, replace
(file kmsurvxradhgp.eps written in EPS format)

.
. sts graph, surv by(rdfgp) xtitle(Analysis time in 62 half-year periods 1980-2009)  ///
>   xline(40 52)  text(.35 39 "Study recall begins" .45 51 "1986 Chornobyl", orientation(vertical)) ///
>   ytitle(Probability of no depression) ci title(Survival Probability by percieved family health risk group)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save kmsurvxrafgp.gph, replace
(file kmsurvxrafgp.gph saved)

. graph export kmsurvxradfgp.eps, replace
(file kmsurvxradfgp.eps written in EPS format)

.
.   sts graph, surv by(cumdosewgp) ///
>       xline(40 52)  text(.35 39 "Study begins in 1980" .3 51 "1986 Chornobyl", orientation(vertical)) ///
>    xtitle(Analysis time in 62 half-year periods 1980-2009) ///
>    ytitle(Survival probability) ci  title(Survival functions by exposure group)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

.    graph save survexcumgp.gph, replace
(file survexcumgp.gph saved)

.    graph export survxcumgp.eps, replace
(file survxcumgp.eps written in EPS format)

.
. // Hazard rate (Conditional probability of depression)
.  sts graph, haz by(gender) ///
>    xline(52)  text(.045 51 "1986 Chornobyl event", orientation(vertical)) ///
>    xtitle(Analysis time in 62 half-year periods 1980-2009) ///
>    ytitle(Conditional probability of depression) ci  title(Hazard rates by gender)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save hazxgen.gph, replace
(file hazxgen.gph saved)

. graph export hazxgen.eps, replace
(file hazxgen.eps written in EPS format)

.
. sts graph, haz by(agegp) ///
>     xline(12)  text( .04 11 "1986 Chornobyl event", orientation(vertical)) ///
>    xtitle(Analysis time in 62 half-year periods 1980-2009) ///
>    ytitle(Conditional probability of depression) ci title(Hazard rates by age group)  ///
>    legend(rows(6))

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save hazxage.gph, replace
(file hazxage.gph saved)

. graph export hazxage.eps, replace
(file hazxage.eps written in EPS format)

.
. sts graph, haz by(percRiskgp) ///
>     xline(52)  text( .065 51 "1986 Chornobyl", orientation(vertical)) ///
>    xtitle(Analysis time in 62 half-year periods 1980-2009) ///
>    ytitle(Conditional probability of depression) ci  ///
>    title(Hazard rates by level of perceived risk of exposure) ///
>    legend(rows(6))

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save hazradhlgp.gph, replace
(file hazradhlgp.gph saved)

. graph export hazxradhlgp.eps, replace
(file hazxradhlgp.eps written in EPS format)

.
.  sts graph, haz by(cumdosewgp) ///
>       xline(52)  text(.025 50 "1986 Chornobyl ", orientation(vertical)) ///
>    xtitle(Analysis time in 62 half-year periods 1980-2009) ///
>    title(Hazard rate by cumulative exposure group)  ///
>    ytitle(hazard rate) ci

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

.    graph save hazxcgp.gph, replace
(file hazxcgp.gph saved)

.    graph export hazxgp.eps, replace
(file hazxgp.eps written in EPS format)

.
.  // Cumulative hazard rates
.
. sts graph, cumhaz by(gender) ///
>    xline(40 52)  text(1.5 41 "1980 Study begins" 1.5 51 "1986 Chornobyl event", orientation(vertical)) ///
>    xtitle(Analysis time in 62 half-year periods 1980-2009) ///
>    ytitle(Cumulative hazard rate) ci title(Cumulative hazard rates by gender)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save cumhzxgen.gph, replace
(file cumhzxgen.gph saved)

. graph export cumhzxgen.eps, replace
(file cumhzxgen.eps written in EPS format)

.
.
.  sts graph, cumhaz by(agegp) ///
>    xline(40 52)  text(1.5 41 "Study begins in 1980" 1.5 51 "1986 Chornobyl event", orientation(vertical)) ///
>    xtitle(Analysis time in 62 half-year periods 1980-2011) ///
>    ytitle(Cumulative hazard rate) ci title(Cumulative hazard rates by age group) ///
>     legend(rows(6))

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save cumhzxage.gph, replace
(file cumhzxage.gph saved)

.  graph export cumhzxage.eps, replace
(file cumhzxage.eps written in EPS format)

.
.  sts graph, cumhaz by(percRiskgp) ///
>     xline(40 52)  text(2 41 "Study begins" 2 51 "1986 Chornobyl", orientation(vertical)) ///
>    xtitle(Analysis time in 62 half-year periods 1980-2011) ///
>    ytitle(Cumulative hazard rate) ci title(Cumulative hazard by level of perceived risk)  ///
>    legend(rows(6))

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

.    graph save cumhzxprg.gph, replace
(file cumhzxprg.gph saved)

.    graph export cumhzxprg.eps, replace
(file cumhzxprg.eps written in EPS format)

.
.
.  sts graph, cumhaz by(cumdosewgp) ///
>        xline(52)  text(2 51 "1986 Chornobyl event", orientation(vertical)) ///
>    xtitle(Analysis time in 62 half-year periods 1980-2011) ///
>    ytitle(Cumulative hazard rate) ci title(Cumulative hazard by cumulative exposure group)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

.    graph save cumhzxcgp.eps, replace
(file cumhzxcgp.eps saved)

.    graph export cumhazxcgp.eps, replace
(file cumhazxcgp.eps written in EPS format)

.
. est clear

.
. // testing for the optimal AFT distribution begins here
.
.  title Testing Baseline model distributions


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                              Testing                                *****
*****                              Baseline                               *****
*****                               model                                 *****
*****                           distributions                             *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:27:06  *****
*******************************************************************************
*******************************************************************************


. est clear

. forv i=1/2 {
  2. foreach ds in exp weibull gompertz lnormal {
  3. set more off
  4. streg i.agegp i.cumdosewgp i.percRiskgp if gender==`i',  dis(`ds')  iterate(50) nolog
  5. est store mod`ds'`i'
  6. }
  7. }

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Exponential regression -- log relative-hazard form

No. of subjects =          331                     Number of obs   =       526
No. of failures =          396
Time at risk    =        14858
                                                   LR chi2(5)      =    135.63
Log likelihood  =   -83.810665                     Prob > chi2     =    0.0000

-------------+----------------------------------------------------------------
           _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       agegp |
 43 thru 55  |    1.944394    .2556469      5.06    0.000      1.502689     2.515935
 56 thru 84  |    1.710627    .2319425      3.96    0.000      1.311419     2.231357
             |
  cumdosewgp |
       high  |    .4990227    .0515816     -6.72    0.000      .4075076     .6110897
             |
  percRiskgp |
     medium  |    1.758535    .2249522      4.41    0.000      1.368564     2.259628
       high  |    2.345369    .3111596      6.43    0.000      1.808349     3.041865
             |
       _cons |    .0172094    .0020179    -34.64    0.000      .0136759     .0216559
-------------+----------------------------------------------------------------

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Weibull regression -- log relative-hazard form

No. of subjects =          331                     Number of obs   =       526
No. of failures =          396
Time at risk    =        14858
                                                   LR chi2(5)      =    153.66
Log likelihood  =   -60.689802                     Prob > chi2     =    0.0000

-------------+----------------------------------------------------------------
           _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       agegp |
 43 thru 55  |    2.017473    .2671606      5.30    0.000      1.556284     2.615332
 56 thru 84  |    1.757819    .2391908      4.15    0.000      1.346322     2.295088
             |
  cumdosewgp |
       high  |    .4559564    .0475116     -7.54    0.000       .371729     .5592684
             |
  percRiskgp |
     medium  |    1.821194    .2337114      4.67    0.000      1.416194     2.342015
       high  |    2.446194    .3258482      6.72    0.000      1.884107     3.175969
             |
       _cons |    .0000254    .0000242    -11.12    0.000      3.94e-06     .0001642
-------------+----------------------------------------------------------------
       /ln_p |    .8531343    .0860671      9.91    0.000      .6844459     1.021823
-------------+----------------------------------------------------------------
            p |   2.346992    .2019987                    1.982673     2.778254
          1/p |   .4260774    .0366712                    .3599383     .5043696
-------------+----------------------------------------------------------------

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Gompertz regression -- log relative-hazard form

No. of subjects =          331                     Number of obs   =       526
No. of failures =          396
Time at risk    =        14858
                                                   LR chi2(5)      =    154.47
Log likelihood  =   -58.053169                     Prob > chi2     =    0.0000

-------------+----------------------------------------------------------------
           _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       agegp |
 43 thru 55  |    2.013056    .2665564      5.28    0.000      1.552906     2.609557
 56 thru 84  |    1.756729    .2390835      4.14    0.000      1.345426      2.29377
             |
  cumdosewgp |
       high  |    .4562944    .0475051     -7.54    0.000      .3720711     .5595827
             |
  percRiskgp |
     medium  |    1.832376    .2352602      4.72    0.000      1.424716     2.356683
       high  |    2.460717    .3279354      6.76    0.000      1.895063     3.195213
             |
       _cons |    .0039641    .0009686    -22.63    0.000      .0024555     .0063994
-------------+----------------------------------------------------------------
      /gamma |    .0211131    .0029504      7.16    0.000      .0153304     .0268957
-------------+----------------------------------------------------------------

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Lognormal regression -- accelerated failure-time form

No. of subjects =          331                     Number of obs   =       526
No. of failures =          396
Time at risk    =        14858
                                                   LR chi2(5)      =    145.15
Log likelihood  =   -69.500901                     Prob > chi2     =    0.0000

-------------+----------------------------------------------------------------
           _t |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       agegp |
 43 thru 55  |   -.3076162    .0597522     -5.15    0.000     -.4247283    -.1905041
 56 thru 84  |   -.2951975    .0608982     -4.85    0.000     -.4145558    -.1758393
             |
  cumdosewgp |
       high  |     .373874     .052596      7.11    0.000      .2707876     .4769603
             |
  percRiskgp |
     medium  |   -.2322452    .0578497     -4.01    0.000     -.3456285    -.1188618
       high  |   -.3624083    .0708093     -5.12    0.000     -.5011919    -.2236247
             |
       _cons |    4.379851    .0473992     92.40    0.000       4.28695     4.472752
-------------+----------------------------------------------------------------
     /ln_sig |   -.9550246    .0612268    -15.60    0.000     -1.075027    -.8350222
-------------+----------------------------------------------------------------
        sigma |   .3848027    .0235603                    .3412885     .4338649
-------------+----------------------------------------------------------------

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Exponential regression -- log relative-hazard form

No. of subjects =          352                     Number of obs   =       684
No. of failures =          584
Time at risk    =        14995
                                                   LR chi2(5)      =     92.84
Log likelihood  =    44.937123                     Prob > chi2     =    0.0000

-------------+----------------------------------------------------------------
           _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       agegp |
 43 thru 55  |    2.285657    .2705126      6.98    0.000      1.812464      2.88239
 56 thru 84  |    2.430583    .2909406      7.42    0.000      1.922303      3.07326
             |
  cumdosewgp |
       high  |    .5499949    .0479989     -6.85    0.000      .4635248     .6525959
             |
  percRiskgp |
     medium  |    1.006611     .109943      0.06    0.952      .8126298     1.246897
       high  |    1.036664    .1168185      0.32    0.749       .831225     1.292877
             |
       _cons |    .0281314    .0032061    -31.33    0.000      .0224999     .0351725
-------------+----------------------------------------------------------------

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Weibull regression -- log relative-hazard form

No. of subjects =          352                     Number of obs   =       684
No. of failures =          584
Time at risk    =        14995
                                                   LR chi2(5)      =    124.44
Log likelihood  =    97.411869                     Prob > chi2     =    0.0000

-------------+----------------------------------------------------------------
           _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       agegp |
 43 thru 55  |    2.628323    .3173321      8.00    0.000      2.074476     3.330037
 56 thru 84  |    2.737493    .3323707      8.29    0.000      2.157769      3.47297
             |
  cumdosewgp |
       high  |    .4573281    .0412062     -8.68    0.000      .3832947      .545661
             |
  percRiskgp |
     medium  |    .9491525    .1043073     -0.47    0.635      .7652318     1.177278
       high  |    .9867969    .1123137     -0.12    0.907      .7894908     1.233413
             |
       _cons |    7.06e-06    5.72e-06    -14.64    0.000      1.44e-06     .0000345
-------------+----------------------------------------------------------------
       /ln_p |    1.009401    .0635995     15.87    0.000      .8847485     1.134054
-------------+----------------------------------------------------------------
            p |   2.743958    .1745144                    2.422375     3.108232
          1/p |   .3644371     .023178                    .3217263      .412818
-------------+----------------------------------------------------------------

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Gompertz regression -- log relative-hazard form

No. of subjects =          352                     Number of obs   =       684
No. of failures =          584
Time at risk    =        14995
                                                   LR chi2(5)      =    124.86
Log likelihood  =    99.458269                     Prob > chi2     =    0.0000

-------------+----------------------------------------------------------------
           _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       agegp |
 43 thru 55  |     2.63338    .3180174      8.02    0.000      2.078351     3.336629
 56 thru 84  |    2.745895    .3334997      8.32    0.000      2.164224       3.4839
             |
  cumdosewgp |
       high  |    .4575334     .041213     -8.68    0.000       .383486     .5458786
             |
  percRiskgp |
     medium  |     .953006    .1046822     -0.44    0.661      .7684154     1.181939
       high  |    .9918323    .1128203     -0.07    0.943      .7936236     1.239544
             |
       _cons |     .004744    .0010125    -25.07    0.000      .0031224      .007208
-------------+----------------------------------------------------------------
      /gamma |    .0264176    .0025381     10.41    0.000      .0214431     .0313922
-------------+----------------------------------------------------------------

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Lognormal regression -- accelerated failure-time form

No. of subjects =          352                     Number of obs   =       684
No. of failures =          584
Time at risk    =        14995
                                                   LR chi2(5)      =    135.79
Log likelihood  =    97.149867                     Prob > chi2     =    0.0000

-------------+----------------------------------------------------------------
           _t |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       agegp |
 43 thru 55  |   -.2880789    .0401124     -7.18    0.000     -.3666977    -.2094601
 56 thru 84  |   -.3400943    .0412921     -8.24    0.000     -.4210253    -.2591633
             |
  cumdosewgp |
       high  |    .2901925    .0323867      8.96    0.000      .2267158     .3536692
             |
  percRiskgp |
     medium  |    .0547774    .0377365      1.45    0.147     -.0191848     .1287395
       high  |    .0383418    .0397993      0.96    0.335     -.0396634      .116347
             |
       _cons |    4.207667     .036799    114.34    0.000      4.135543     4.279792
-------------+----------------------------------------------------------------
     /ln_sig |   -1.233399    .0425175    -29.01    0.000     -1.316732    -1.150067
-------------+----------------------------------------------------------------
        sigma |   .2913007    .0123854                    .2680097     .3166157
-------------+----------------------------------------------------------------

. est stats _all

Akaike's information criterion and Bayesian information criterion

-------------+---------------------------------------------------------------
       Model |    Obs    ll(null)   ll(model)     df          AIC         BIC
-------------+---------------------------------------------------------------
modexp1      |    526   -151.6251   -83.81067      6     179.6213    205.2131
modweibull1   |   526   -137.5215    -60.6898      7     135.3796    165.2367
modgompertz1   |   526  -135.2886   -58.05317      7     130.1063    159.9634
modlnormal1   |   526   -142.0754    -69.5009      7     153.0018    182.8589
modexp2      |    684   -1.481841    44.93712      6    -77.87425    -50.7065
modweibull2   |   684    35.19043    97.41187      7    -180.8237    -149.128
modgompertz2   |   684    37.0265    99.45827      7    -184.9165   -153.2208
modlnormal2   |   684    29.25705    97.14987      7    -180.2997    -148.604
-------------+---------------------------------------------------------------


Note:  N=Obs used in calculating BIC; see [R] BIC note


. // Gompertz distribution is optimal for baseline
.
.
. est clear

. title Testing distributions for Full Sociodemographic models


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                              Testing                                *****
*****                           distributions                             *****
*****                                for                                  *****
*****                                Full                                 *****
*****                          Sociodemographic                           *****
*****                               models                                *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:27:23  *****
*******************************************************************************
*******************************************************************************


. est clear

.
. forv i=1/2 {
  2. set more off
  3.
. di "Gender == `i'"
  4.
. streg i.agegp i.marrw childw i.emplw  ///
>   inc1w inc2w inc3w inc4w i.educ cumdosewgp i.percRiskgp if gender==`i', dist(lnormal) nolog
  5.   est store sdlnorm`i'
  6.
.
. set more off
  7. di "Gender == `i'"
  8. streg i.agegp  i.marrw childw i.emplw  ///
>       inc1w inc2w inc3w inc4w i.educ cumdosewgp i.percRiskgp if gender==`i', dist(weibull) nolog
  9.   est store sdweib`i'
 10.
. set more off
 11. di "Gender == `i'"
 12. streg gender i.agegp agegp i.marrw childw i.emplw ///
>    inc1w inc2w inc3w inc4w i.educ cumdosewgp i.percRiskgp if gender==`i', dist(gomp) nolog
 13.    est store sdgomp`i'
 14. /*
> set more off
> di "Gender == `i'"
> streg i.agegp i.agegp i.marrw i.emplw  ///
>     inc1w inc2w inc3w inc4w i.educ cumdosewgp if gender==`i'  , dist(gamma)  nolog
>     est store sdgamma`i'
> */
. }
Gender == 1

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Lognormal regression -- accelerated failure-time form

No. of subjects =          331                     Number of obs   =       526
No. of failures =          396
Time at risk    =        14858
                                                   LR chi2(24)     =    221.68
Log likelihood  =   -31.234962                     Prob > chi2     =    0.0000

--------------------------+----------------------------------------------------------------
                        _t |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
--------------------------+----------------------------------------------------------------
                    agegp |
              43 thru 55  |   -.3248336    .0578512     -5.61    0.000     -.4382197    -.2114474
              56 thru 84  |   -.4135258    .0714137     -5.79    0.000      -.553494    -.2735576
                          |
                    marrw |
         2. cohabitating  |    .1414851    .1064458      1.33    0.184     -.0671448     .3501151
              3. married  |   -.0353996    .0757916     -0.47    0.640     -.1839484     .1131492
            4. separated  |   -.3085678    .2631319     -1.17    0.241     -.8242968     .2071612
             5. divorced  |   -.1030777    .1080744     -0.95    0.340     -.3148995     .1087442
              6. widowed  |   -.1576802    .1524279     -1.03    0.301     -.4564333     .1410729
                          |
                   childw |    .0397986    .0316528      1.26    0.209     -.0222398     .1018369
                          |
                    emplw |
            2. part time  |   -.1207947    .0757834     -1.59    0.111     -.2693275     .0277381
              4. retired  |    .2539268    .0773968      3.28    0.001      .1022319     .4056218
           5. unemployed  |   -.2085979    .1376431     -1.52    0.130     -.4783734     .0611776
                          |
                    inc1w |   -.1099348    .1154556     -0.95    0.341     -.3362237      .116354
                    inc2w |   -.1652854    .1020377     -1.62    0.105     -.3652756     .0347049
                    inc3w |   -.1058718    .1040955     -1.02    0.309     -.3098952     .0981516
                    inc4w |   -.3091546     .150724     -2.05    0.040     -.6045683    -.0137409
                          |
                     educ |
     3. technical degree  |   -.1666344    .1359551     -1.23    0.220     -.4331015     .0998326
4. did not finish coll..  |    .2674133     .171301      1.56    0.119     -.0683305      .603157
5. graduated college/b..  |   -.2515325    .1434834     -1.75    0.080     -.5327548     .0296899
6. finished specialist..  |    .0225681    .1348633      0.17    0.867     -.2417591     .2868953
7. doctor of science/phd  |     .110427    .2796401      0.39    0.693     -.4376576     .6585115
8. doctor of medicine/md  |    .6125789    .3208446      1.91    0.056      -.016265     1.241423
                          |
               cumdosewgp |    .3448672    .0489646      7.04    0.000      .2488984      .440836
                          |
               percRiskgp |
                  medium  |   -.2001957    .0532595     -3.76    0.000     -.3045825    -.0958089
                    high  |   -.3469569    .0668042     -5.19    0.000     -.4778908     -.216023
                          |
                    _cons |    4.617678    .1728927     26.71    0.000      4.278814     4.956541
--------------------------+----------------------------------------------------------------
                  /ln_sig |   -1.037086     .058847    -17.62    0.000     -1.152424    -.9217482
--------------------------+----------------------------------------------------------------
                     sigma |   .3544861    .0208604                    .3158701     .3978229
--------------------------+----------------------------------------------------------------
Gender == 1

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Weibull regression -- log relative-hazard form

No. of subjects =          331                     Number of obs   =       526
No. of failures =          396
Time at risk    =        14858
                                                   LR chi2(24)     =    233.33
Log likelihood  =   -20.855375                     Prob > chi2     =    0.0000

--------------------------+----------------------------------------------------------------
                        _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
--------------------------+----------------------------------------------------------------
                    agegp |
              43 thru 55  |    2.080595    .3019605      5.05    0.000      1.565493     2.765183
              56 thru 84  |    2.304014    .4004879      4.80    0.000      1.638807     3.239235
                          |
                    marrw |
         2. cohabitating  |    .5545739    .1715987     -1.91    0.057      .3023965     1.017049
              3. married  |     1.03265    .1784771      0.19    0.853      .7359305     1.449005
            4. separated  |    2.791632    1.493573      1.92    0.055      .9782513     7.966473
             5. divorced  |    1.445267    .3469402      1.53    0.125      .9028486     2.313563
              6. widowed  |     1.35684    .5260289      0.79    0.431      .6346421     2.900869
                          |
                   childw |    .9806521    .0733513     -0.26    0.794      .8469277     1.135491
                          |
                    emplw |
            2. part time  |    1.019314    .1778598      0.11    0.913      .7240721      1.43494
              4. retired  |    .5606391    .0998762     -3.25    0.001      .3954069     .7949182
           5. unemployed  |      1.0111    .3007773      0.04    0.970      .5643947     1.811364
                          |
                    inc1w |    1.316822    .4173563      0.87    0.385      .7075309     2.450804
                    inc2w |     1.24431    .3639962      0.75    0.455      .7013391     2.207646
                    inc3w |    1.056439    .3166887      0.18    0.855      .5870564     1.901118
                    inc4w |    1.963088     .754227      1.76    0.079      .9244945     4.168455
                          |
                     educ |
     3. technical degree  |    1.987827     .876383      1.56    0.119      .8377319     4.716849
4. did not finish coll..  |    .6080197    .3242024     -0.93    0.351        .21382     1.728968
5. graduated college/b..  |    2.090226    .9403187      1.64    0.101      .8655017     5.047993
6. finished specialist..  |    1.190071    .5239884      0.40    0.693      .5020983     2.820701
7. doctor of science/phd  |    .4003432    .4368632     -0.84    0.402       .047161      3.39846
8. doctor of medicine/md  |    .2542212    .2790204     -1.25    0.212      .0295785     2.184982
                          |
               cumdosewgp |    .4209533    .0462677     -7.87    0.000      .3393727     .5221449
                          |
               percRiskgp |
                  medium  |    1.794389    .2354936      4.45    0.000      1.387413     2.320744
                    high  |    2.568601    .3532084      6.86    0.000      1.961769     3.363143
                          |
                    _cons |    5.91e-06    6.20e-06    -11.46    0.000      7.54e-07     .0000463
--------------------------+----------------------------------------------------------------
                    /ln_p |    .9316971    .0817008     11.40    0.000      .7715664     1.091828
--------------------------+----------------------------------------------------------------
                         p |   2.538814    .2074233                    2.163152     2.979715
                       1/p |   .3938847    .0321807                    .3356025     .4622884
--------------------------+----------------------------------------------------------------
Gender == 1

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id
note: gender omitted because of collinearity
note: agegp omitted because of collinearity

Gompertz regression -- log relative-hazard form

No. of subjects =          331                     Number of obs   =       526
No. of failures =          396
Time at risk    =        14858
                                                   LR chi2(24)     =    234.66
Log likelihood  =   -17.958924                     Prob > chi2     =    0.0000

--------------------------+----------------------------------------------------------------
                        _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
--------------------------+----------------------------------------------------------------
                   gender |           1   (omitted)
                          |
                    agegp |
              43 thru 55  |    2.078217    .3016537      5.04    0.000      1.563648     2.762123
              56 thru 84  |    2.302847    .4002493      4.80    0.000      1.638026     3.237496
                          |
                    agegp |           1   (omitted)
                          |
                    marrw |
         2. cohabitating  |    .5540024    .1714877     -1.91    0.056      .3020146     1.016238
              3. married  |    1.032683     .178616      0.19    0.852      .7357674     1.449417
            4. separated  |    2.865777    1.534189      1.97    0.049      1.003583     8.183361
             5. divorced  |    1.453455    .3489009      1.56    0.119      .9079699     2.326655
              6. widowed  |    1.346793    .5219397      0.77    0.442      .6301213     2.878576
                          |
                   childw |    .9806029    .0733369     -0.26    0.793      .8469034     1.135409
                          |
                    emplw |
            2. part time  |    1.024929    .1788527      0.14    0.888      .7280432     1.442882
              4. retired  |    .5622206    .1000656     -3.24    0.001        .39665      .796904
           5. unemployed  |    1.000703    .2975445      0.00    0.998      .5587438     1.792246
                          |
                    inc1w |    1.323968    .4194134      0.89    0.376      .7115897     2.463347
                    inc2w |    1.247813    .3648267      0.76    0.449       .703528     2.213186
                    inc3w |    1.056469    .3166046      0.18    0.855      .5871743     1.900844
                    inc4w |    1.957393    .7517773      1.75    0.080      .9220539     4.155273
                          |
                     educ |
     3. technical degree  |    1.979037    .8721243      1.55    0.121      .8343446     4.694208
4. did not finish coll..  |    .6072028    .3236929     -0.94    0.349      .2135835     1.726234
5. graduated college/b..  |    2.090978    .9404805      1.64    0.101      .8659565     5.048973
6. finished specialist..  |    1.185168    .5216141      0.39    0.699      .5002078     2.808079
7. doctor of science/phd  |    .3990517     .435442     -0.84    0.400      .0470116     3.387298
8. doctor of medicine/md  |    .2518802     .276512     -1.26    0.209      .0292922     2.165888
                          |
               cumdosewgp |    .4212755    .0462593     -7.87    0.000      .3397017      .522438
                          |
               percRiskgp |
                  medium  |    1.808387    .2373935      4.51    0.000      1.398141     2.339008
                    high  |    2.585009    .3554976      6.91    0.000      1.974251     3.384712
                          |
                    _cons |    .0018357     .000935    -12.37    0.000      .0006765     .0049813
--------------------------+----------------------------------------------------------------
                   /gamma |    .0239172    .0030171      7.93    0.000      .0180038     .0298305
--------------------------+----------------------------------------------------------------
Gender == 2

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Lognormal regression -- accelerated failure-time form

No. of subjects =          352                     Number of obs   =       684
No. of failures =          584
Time at risk    =        14995
                                                   LR chi2(25)     =    252.16
Log likelihood  =    155.33536                     Prob > chi2     =    0.0000

--------------------------+----------------------------------------------------------------
                        _t |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
--------------------------+----------------------------------------------------------------
                    agegp |
              43 thru 55  |   -.3106488    .0395664     -7.85    0.000     -.3881975    -.2331001
              56 thru 84  |    -.423351    .0480506     -8.81    0.000     -.5175285    -.3291735
                          |
                    marrw |
         2. cohabitating  |    .1625019     .104083      1.56    0.118     -.0414971     .3665009
              3. married  |    .1817275    .0569132      3.19    0.001      .0701797     .2932753
            4. separated  |     .280449    .1240348      2.26    0.024      .0373452     .5235527
             5. divorced  |    .1052838    .0831926      1.27    0.206     -.0577708     .2683384
              6. widowed  |    .2731343    .0751663      3.63    0.000      .1258111     .4204574
                          |
                   childw |    .0076933    .0202855      0.38    0.705     -.0320655      .047452
                          |
                    emplw |
            2. part time  |    .0264763    .0579856      0.46    0.648     -.0871735      .140126
            3. voluntary  |      1.7544    262.1599      0.01    0.995     -512.0696     515.5784
              4. retired  |    .1980771    .0481932      4.11    0.000      .1036201     .2925341
           5. unemployed  |   -.0214829    .0575816     -0.37    0.709     -.1343409      .091375
                          |
                    inc1w |   -.2653737    .0618159     -4.29    0.000     -.3865306    -.1442167
                    inc2w |   -.1806076    .0494995     -3.65    0.000     -.2776249    -.0835902
                    inc3w |   -.0485861    .0520606     -0.93    0.351     -.1506229     .0534507
                    inc4w |   -.1121578    .1039294     -1.08    0.281     -.3158557     .0915402
                          |
                     educ |
2. graduated high school  |   -1.754469     46.6877     -0.04    0.970     -93.26068     89.75174
     3. technical degree  |   -1.666463    46.68767     -0.04    0.972     -93.17262      89.8397
4. did not finish coll..  |   -1.551063    46.68769     -0.03    0.973     -93.05725     89.95512
5. graduated college/b..  |   -1.657697    46.68768     -0.04    0.972     -93.16386     89.84847
6. finished specialist..  |   -1.523946    46.68767     -0.03    0.974      -93.0301     89.98221
7. doctor of science/phd  |   -1.915781    46.68805     -0.04    0.967     -93.42269     89.59113
                          |
               cumdosewgp |    .2685269    .0316163      8.49    0.000      .2065602     .3304937
                          |
               percRiskgp |
                  medium  |    .0541654    .0362433      1.49    0.135     -.0168702      .125201
                    high  |    .0038736    .0407058      0.10    0.924     -.0759084     .0836555
                          |
                    _cons |    5.812574    46.68765      0.12    0.901     -85.69354     97.31869
--------------------------+----------------------------------------------------------------
                  /ln_sig |   -1.291849    .0422307    -30.59    0.000     -1.374619    -1.209078
--------------------------+----------------------------------------------------------------
                     sigma |   .2747624    .0116034                    .2529359     .2984723
--------------------------+----------------------------------------------------------------
Gender == 2

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Weibull regression -- log relative-hazard form

No. of subjects =          352                     Number of obs   =       684
No. of failures =          584
Time at risk    =        14995
                                                   LR chi2(25)     =    246.52
Log likelihood  =    158.45027                     Prob > chi2     =    0.0000

--------------------------+----------------------------------------------------------------
                        _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
--------------------------+----------------------------------------------------------------
                    agegp |
              43 thru 55  |    2.941628     .380767      8.34    0.000      2.282483     3.791125
              56 thru 84  |    3.333467    .4703941      8.53    0.000      2.528022     4.395531
                          |
                    marrw |
         2. cohabitating  |    .6868824    .2270776     -1.14    0.256      .3593206     1.313054
              3. married  |    .6691336    .1098455     -2.45    0.014      .4850415     .9230957
            4. separated  |    .4747326    .2292367     -1.54    0.123      .1842573     1.223132
             5. divorced  |    .7495852    .1761668     -1.23    0.220      .4729034     1.188145
              6. widowed  |    .5823659    .1220961     -2.58    0.010      .3861332     .8783242
                          |
                   childw |    .9612042     .058234     -0.65    0.514      .8535836     1.082394
                          |
                    emplw |
            2. part time  |    1.007279    .1773493      0.04    0.967      .7133134      1.42239
            3. voluntary  |    1.96e-07    .0003115     -0.01    0.992             0            .
              4. retired  |    .6457701    .0829257     -3.41    0.001       .502079     .8305844
           5. unemployed  |    1.156524    .1969983      0.85    0.393      .8282547     1.614899
                          |
                    inc1w |    2.908425    .5484645      5.66    0.000      2.009742     4.208968
                    inc2w |    2.578201    .4475681      5.46    0.000       1.83464     3.623122
                    inc3w |    1.659853    .3165746      2.66    0.008      1.142154     2.412208
                    inc4w |    2.118617    .6744437      2.36    0.018      1.135219     3.953895
                          |
                     educ |
2. graduated high school  |     4568928    7.25e+09      0.01    0.992             0            .
     3. technical degree  |     3690462    5.85e+09      0.01    0.992             0            .
4. did not finish coll..  |     2702806    4.29e+09      0.01    0.993             0            .
5. graduated college/b..  |     3897179    6.18e+09      0.01    0.992             0            .
6. finished specialist..  |     2490600    3.95e+09      0.01    0.993             0            .
7. doctor of science/phd  |     5278217    8.37e+09      0.01    0.992             0            .
                          |
               cumdosewgp |    .4346804    .0417023     -8.68    0.000      .3601699     .5246051
                          |
               percRiskgp |
                  medium  |     .903479    .1006245     -0.91    0.362      .7262999     1.123881
                    high  |    1.041654    .1279335      0.33    0.740      .8188055     1.325153
                          |
                    _cons |    8.67e-13    1.37e-09     -0.02    0.986             0            .
--------------------------+----------------------------------------------------------------
                    /ln_p |    1.055926    .0622732     16.96    0.000       .933873     1.177979
--------------------------+----------------------------------------------------------------
                         p |   2.874637    .1790128                    2.544344     3.247805
                       1/p |   .3478701     .021663                    .3079002     .3930285
--------------------------+----------------------------------------------------------------
Gender == 2

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id
note: gender omitted because of collinearity
note: agegp omitted because of collinearity

Gompertz regression -- log relative-hazard form

No. of subjects =          352                     Number of obs   =       684
No. of failures =          584
Time at risk    =        14995
                                                   LR chi2(25)     =    247.02
Log likelihood  =    160.53872                     Prob > chi2     =    0.0000

--------------------------+----------------------------------------------------------------
                        _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
--------------------------+----------------------------------------------------------------
                   gender |           1   (omitted)
                          |
                    agegp |
              43 thru 55  |    2.947013    .3814929      8.35    0.000      2.286617     3.798138
              56 thru 84  |    3.332374    .4695943      8.54    0.000      2.528154     4.392422
                          |
                    agegp |           1   (omitted)
                          |
                    marrw |
         2. cohabitating  |    .6863489    .2270307     -1.14    0.255       .358909     1.312519
              3. married  |    .6693418    .1099085     -2.44    0.014      .4851515     .9234608
            4. separated  |    .4760855    .2298988     -1.54    0.124      .1847757     1.226663
             5. divorced  |    .7517463    .1766495     -1.21    0.225       .474298     1.191492
              6. widowed  |    .5839681    .1224029     -2.57    0.010      .3872332     .8806546
                          |
                   childw |    .9623511    .0583097     -0.63    0.526      .8545913     1.083699
                          |
                    emplw |
            2. part time  |    1.012327    .1780399      0.07    0.944      .7171639     1.428971
            3. voluntary  |    1.96e-07    .0003099     -0.01    0.992             0            .
              4. retired  |    .6464511    .0830861     -3.39    0.001      .5024973     .8316442
           5. unemployed  |    1.151536     .196133      0.83    0.407      .8247044     1.607891
                          |
                    inc1w |    2.929461    .5526099      5.70    0.000      2.024036     4.239917
                    inc2w |    2.582949    .4484372      5.47    0.000      1.837956     3.629917
                    inc3w |    1.662299    .3170106      2.66    0.008      1.143878     2.415675
                    inc4w |    2.135081    .6796099      2.38    0.017       1.14412     3.984348
                          |
                     educ |
2. graduated high school  |     4571747    7.24e+09      0.01    0.992             0            .
     3. technical degree  |     3687862    5.84e+09      0.01    0.992             0            .
4. did not finish coll..  |     2711479    4.29e+09      0.01    0.993             0            .
5. graduated college/b..  |     3893729    6.17e+09      0.01    0.992             0            .
6. finished specialist..  |     2494354    3.95e+09      0.01    0.993             0            .
7. doctor of science/phd  |     5259088    8.33e+09      0.01    0.992             0            .
                          |
               cumdosewgp |     .435426    .0417234     -8.68    0.000      .3608697     .5253858
                          |
               percRiskgp |
                  medium  |    .9097479    .1012146     -0.85    0.395      .7315097     1.131415
                    high  |    1.049965    .1287354      0.40    0.691      .8256762     1.335181
                          |
                    _cons |    9.22e-10    1.46e-06     -0.01    0.990             0            .
--------------------------+----------------------------------------------------------------
                   /gamma |    .0282919    .0025952     10.90    0.000      .0232054     .0333785
--------------------------+----------------------------------------------------------------

.
. title Comparison of sociodemographic models for males and females


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                             Comparison                              *****
*****                                 of                                  *****
*****                          sociodemographic                           *****
*****                               models                                *****
*****                                for                                  *****
*****                               males                                 *****
*****                                and                                  *****
*****                              females                                *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:27:38  *****
*******************************************************************************
*******************************************************************************


. est stats _all

Akaike's information criterion and Bayesian information criterion

-------------+---------------------------------------------------------------
       Model |    Obs    ll(null)   ll(model)     df          AIC         BIC
-------------+---------------------------------------------------------------
sdlnorm1     |    526   -142.0754   -31.23496     26     114.4699    225.3678
sdweib1      |    526   -137.5215   -20.85538     26     93.71075    204.6086
sdgomp1      |    526   -135.2886   -17.95892     26     87.91785    198.8157
sdlnorm2     |    684    29.25705    155.3354     27    -256.6707   -134.4159
sdweib2      |    684    35.19043    158.4503     27    -262.9005   -140.6457
sdgomp2      |    684     37.0265    160.5387     27    -267.0774   -144.8226
-------------+---------------------------------------------------------------


Note:  N=Obs used in calculating BIC; see [R] BIC note


.
.
. //   Gompertz best for sociodemographics for both men and women */
. est clear

.
. cap drop cs1

. cap drop hz1

. cap drop srv1

.
.
.
. title Graphical test of Male Gompertz model residual fit


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                             Graphical                               *****
*****                                test                                 *****
*****                                 of                                  *****
*****                                Male                                 *****
*****                              Gompertz                               *****
*****                               model                                 *****
*****                              residual                               *****
*****                                fit                                  *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:27:38  *****
*******************************************************************************
*******************************************************************************


. set more off

. streg i.agegp  i.marrw childw i.emplw occ1w-occ8w  ///
>     inc1w inc2w inc3w inc4w jsw deaw dvcew sepaw accdw ///
>          cataw illw movew shjobw shfamw shhlw shfincw shhousw shrelaw suprtw suchrw   ///
>          dafter toxic-goodrad kzunder-icdxcnt WHPel-HP2vacatn goferw-radtlw i.cumdosewgp i.percRiskgp ///
>     fcrisis2008 y2009 if gender==1, dist(gomp) nolog nohr       vce(robust)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id
note: occ8w omitted because of collinearity

Gompertz regression -- log relative-hazard form

No. of subjects      =          291                Number of obs   =       483
No. of failures      =          370
Time at risk         =        13382
                                                   Wald chi2(82)   =         .
Log pseudolikelihood =    230.14026                Prob > chi2     =         .

(Std. Err. adjusted for 291 clusters in id)
-----------------+----------------------------------------------------------------
                 |               Robust
               _t |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-----------------+----------------------------------------------------------------
           agegp |
     43 thru 55  |    .5197967    .2076746      2.50    0.012       .112762     .9268314
     56 thru 84  |    .6636528    .2382127      2.79    0.005      .1967645     1.130541
                 |
           marrw |
2. cohabitating  |   -.5150346    .4041958     -1.27    0.203     -1.307244     .2771746
     3. married  |    .4682995    .2458657      1.90    0.057     -.0135885     .9501875
   4. separated  |    .6305126    .7950515      0.79    0.428     -.9277597     2.188785
    5. divorced  |   -.9558964    .4223094     -2.26    0.024     -1.783608    -.1281851
     6. widowed  |    .6275634     .411751      1.52    0.127     -.1794537      1.43458
                 |
          childw |   -.2170884    .0853174     -2.54    0.011     -.3843075    -.0498694
                 |
           emplw |
   2. part time  |    .1590923    .2193691      0.73    0.468     -.2708633     .5890478
     4. retired  |    1.144852    .7039307      1.63    0.104     -.2348267     2.524531
  5. unemployed  |    1.512613    .7378068      2.05    0.040      .0665378     2.958687
                 |
           occ1w |    .4278254    .5904957      0.72    0.469     -.7295248     1.585176
           occ2w |    .4776717    .6144493      0.78    0.437     -.7266269      1.68197
           occ3w |    .4483365    .5772879      0.78    0.437      -.683127       1.5798
           occ4w |   -.1540967    .6016708     -0.26    0.798      -1.33335     1.025156
           occ5w |    .0464903    .6122021      0.08    0.939     -1.153404     1.246384
           occ6w |    2.275144    .8531649      2.67    0.008      .6029717     3.947317
           occ7w |   -1.294236    .4859703     -2.66    0.008      -2.24672    -.3417515
           occ8w |           0   (omitted)
           inc1w |   -.0525396    .4295133     -0.12    0.903     -.8943702     .7892911
           inc2w |   -.0695528    .4266174     -0.16    0.870     -.9057076     .7666019
           inc3w |    -.051946    .3817253     -0.14    0.892     -.8001139     .6962219
           inc4w |   -.0954769    .4541818     -0.21    0.833      -.985657     .7947031
             jsw |    .0017049    .0030541      0.56    0.577      -.004281     .0076909
            deaw |     .274531    .0845932      3.25    0.001      .1087314     .4403306
           dvcew |    1.361841     .428184      3.18    0.001      .5226164     2.201067
           sepaw |   -.2631913    .3466516     -0.76    0.448     -.9426159     .4162333
           accdw |    .1966864    .1373642      1.43    0.152     -.0725425     .4659153
           cataw |     .567691    .3120451      1.82    0.069     -.0439062     1.179288
            illw |    .2542525     .090379      2.81    0.005      .0771129      .431392
           movew |   -.0522975     .152094     -0.34    0.731     -.3503963     .2458012
          shjobw |    .0039493    .0026175      1.51    0.131      -.001181     .0090796
          shfamw |   -.0058771    .0033139     -1.77    0.076     -.0123721     .0006179
           shhlw |   -.0037095    .0028397     -1.31    0.191     -.0092753     .0018563
         shfincw |   -.0040824    .0028327     -1.44    0.150     -.0096344     .0014697
         shhousw |    .0017748    .0025204      0.70    0.481     -.0031651     .0067148
         shrelaw |    .0073761    .0030166      2.45    0.014      .0014637     .0132886
          suprtw |   -.0039296     .002617     -1.50    0.133     -.0090588     .0011996
          suchrw |   -.0030825    .0024698     -1.25    0.212     -.0079232     .0017583
          dafter |    .0005243    .0006522      0.80    0.421     -.0007539     .0018025
           toxic |    .0002431    .0022536      0.11    0.914     -.0041739     .0046601
          repair |   -.0025003    .0022037     -1.13    0.257     -.0068195      .001819
            skin |    .0035917    .0020421      1.76    0.079     -.0004106     .0075941
            near |    -.000017      .00249     -0.01    0.995     -.0048973     .0048633
           cloud |    .0011921    .0023732      0.50    0.615     -.0034593     .0058435
           world |   -.0085029    .0040308     -2.11    0.035     -.0164031    -.0006027
        healthef |    .0060974    .0087284      0.70    0.485       -.01101     .0232048
          carcin |   -.0074345     .008237     -0.90    0.367     -.0235787     .0087097
           woman |    .0039105     .003062      1.28    0.202     -.0020909     .0099119
         saferad |    .0017212    .0021602      0.80    0.426     -.0025127     .0059552
         goodrad |    .0073302    .0022203      3.30    0.001      .0029786     .0116819
         kzunder |     .000703    .0026939      0.26    0.794     -.0045769     .0059829
          chsize |    .0015268    .0028562      0.53    0.593     -.0040712     .0071248
         icdxcnt |   -.0206711    .0536262     -0.39    0.700     -.1257765     .0844343
           WHPel |     .001127     .003022      0.37    0.709      -.004796     .0070499
         WHPpain |    -.010224     .006099     -1.68    0.094     -.0221778     .0017299
           WHPer |    .0127351    .0069737      1.83    0.068     -.0009331     .0264033
        WHPsleep |    .0021063    .0029184      0.72    0.470     -.0036137     .0078262
       WHPsociso |    .0117823    .0037669      3.13    0.002      .0043994     .0191652
           WHPpa |    .0079059    .0052805      1.50    0.134     -.0024437     .0182556
         HP2work |    .3188439    .1584898      2.01    0.044      .0082096     .6294782
       HP2hmcare |    .5226916     .181047      2.89    0.004       .167846     .8775371
      HP2probsoc |   -.2178609    .2190025     -0.99    0.320     -.6470979     .2113762
        HP2pbfhm |    .1868179     .264285      0.71    0.480     -.3311712     .7048069
       HP2sxlife |   -.2229572    .1860312     -1.20    0.231     -.5875717     .1416573
       HP2inthob |     .486756    .2668618      1.82    0.068     -.0362836     1.009796
       HP2vacatn |   -.1875397    .2411864     -0.78    0.437     -.6602564      .285177
          goferw |   -.0017166    .0035185     -0.49    0.626     -.0086128     .0051795
          fdferw |    .0077539    .0035615      2.18    0.029      .0007736     .0147343
          trgovw |   -.0011083    .0021807     -0.51    0.611     -.0053824     .0031659
          trrepw |    .0055719    .0021138      2.64    0.008      .0014288      .009715
           defnw |   -.0055065    .0027599     -2.00    0.046     -.0109157    -.0000972
          efradw |    .0084618    .0022609      3.74    0.000      .0040306     .0128931
           ecprw |   -.0022032    .0023104     -0.95    0.340     -.0067315     .0023251
          polprw |   -.0001898    .0024737     -0.08    0.939     -.0050382     .0046586
            airw |    .0016668    .0026417      0.63    0.528     -.0035109     .0068444
            radw |    .0068297    .0022533      3.03    0.002      .0024133      .011246
          radchw |   -.0004929    .0024971     -0.20    0.844     -.0053871     .0044013
          radtlw |      .00911    .0028331      3.22    0.001      .0035573     .0146628
                 |
      cumdosewgp |
           high  |   -.2146824    .1573643     -1.36    0.172     -.5231108      .093746
                 |
      percRiskgp |
         medium  |   -.2122734    .1672855     -1.27    0.204      -.540147     .1156002
           high  |    -.152065    .2114584     -0.72    0.472     -.5665157     .2623858
                 |
     fcrisis2008 |   -.8469545    .2161327     -3.92    0.000     -1.270567    -.4233422
           y2009 |   -.9929258    .2196737     -4.52    0.000     -1.423478    -.5623733
           _cons |   -9.758742    .8326757    -11.72    0.000     -11.39076    -8.126728
-----------------+----------------------------------------------------------------
          /gamma |     .069219    .0055474     12.48    0.000      .0583464     .0800916
-----------------+----------------------------------------------------------------

.     est store sdgomp1

.         predict cs1, csnell
(919 missing values generated)

.         predict hz1, haz
(157 missing values generated)

.         predict srv1, sur
(157 missing values generated)

.
. title(Graphical test of fit)


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                             (Graphical                              *****
*****                                test                                 *****
*****                                 of                                  *****
*****                                fit)                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:27:41  *****
*******************************************************************************
*******************************************************************************


.
. cap drop km1

. cap drop cumhaz1

. stset cs1, failure(outcome==1)

     failure event:  outcome == 1
obs. time interval:  (0, cs1]
 exit on or before:  failure

------------------------------------------------------------------------------
     1210  total observations
      919  event time missing (cs1>=.)                          PROBABLE ERROR
------------------------------------------------------------------------------
      291  observations remaining, representing
      178  failures in single-record/single-failure data
      370  total analysis time at risk and under observation
                                              at risk from t =         0
                                   earliest observed entry t =         0
                                        last observed exit t =  8.056648

.
. sts gen km1=s

. gen cumhaz1 = -ln(km1)
(920 missing values generated)

. line cumhaz1 cs1 cs1, sort name("Gompertz, replace") title(Male Cox-Snell residuals deviate from optimal line)

. graph save malerestest.gph, replace
(file malerestest.gph saved)

. graph export malerestest.eps, replace
(file malerestest.eps written in EPS format)

.
.
. stset, clear

. stset endepdate, id(id) failure(outcome==1)  time0(startdate) exit(time .)

                id:  id
     failure event:  outcome == 1
obs. time interval:  (startdate, endepdate]
 exit on or before:  time .

------------------------------------------------------------------------------
     1210  total observations
        0  exclusions
------------------------------------------------------------------------------
     1210  observations remaining, representing
      683  subjects
      980  failures in multiple-failure-per-subject data
    29853  total analysis time at risk and under observation
                                              at risk from t =         0
                                   earliest observed entry t =        40
                                        last observed exit t =       101

. cap drop cs2

. cap drop hz2

. cap drop srv2

.
. title Full Female Gompertz model


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                                Full                                 *****
*****                               Female                                *****
*****                              Gompertz                               *****
*****                               model                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:27:43  *****
*******************************************************************************
*******************************************************************************


. set more off

. streg i.agegp  i.marrw childw i.emplw  ///
>     inc1w inc2w inc3w inc4w

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Fitting constant-only model:

Iteration 0:   log likelihood = -170.39943
Iteration 1:   log likelihood = -120.69922
Iteration 2:   log likelihood = -119.26118
Iteration 3:   log likelihood = -119.26017
Iteration 4:   log likelihood = -119.26017

Fitting full model:

Iteration 0:   log likelihood = -119.26017
Iteration 1:   log likelihood = -25.969324
Iteration 2:   log likelihood = -17.598157
Iteration 3:   log likelihood = -17.393008
Iteration 4:   log likelihood = -17.356192
Iteration 5:   log likelihood = -17.347978
Iteration 6:   log likelihood = -17.345947
Iteration 7:   log likelihood = -17.345538
Iteration 8:   log likelihood =  -17.34545
Iteration 9:   log likelihood =  -17.34543
Iteration 10:  log likelihood = -17.345425
Iteration 11:  log likelihood = -17.345424

Gompertz regression -- log relative-hazard form

No. of subjects =          683                     Number of obs   =      1210
No. of failures =          980
Time at risk    =        29853
                                                   LR chi2(16)     =    203.83
Log likelihood  =   -17.345424                     Prob > chi2     =    0.0000

-----------------+----------------------------------------------------------------
               _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-----------------+----------------------------------------------------------------
           agegp |
     43 thru 55  |    2.049765    .1778357      8.27    0.000      1.729237     2.429705
     56 thru 84  |    2.542948    .2531131      9.38    0.000      2.092246     3.090737
                 |
           marrw |
2. cohabitating  |    .4637466    .1024187     -3.48    0.001      .3008101     .7149392
     3. married  |    .7762981    .0896858     -2.19    0.028      .6189977     .9735717
   4. separated  |    .7207707    .2540249     -0.93    0.353      .3612466     1.438104
    5. divorced  |    .8692963    .1398839     -0.87    0.384      .6341554     1.191626
     6. widowed  |    .8374483    .1324344     -1.12    0.262      .6142549      1.14174
                 |
          childw |    1.014175     .045077      0.32    0.751      .9295651     1.106487
                 |
           emplw |
   2. part time  |    .9511665    .1124449     -0.42    0.672      .7544479     1.199178
   3. voluntary  |    2.26e-08    .0000889     -0.00    0.996             0            .
     4. retired  |    .6282703    .0623419     -4.68    0.000        .51723      .763149
  5. unemployed  |    1.287244    .1797672      1.81    0.071       .979012     1.692519
                 |
           inc1w |    2.324055     .355467      5.51    0.000      1.722083     3.136452
           inc2w |    1.895977    .2664724      4.55    0.000      1.439461     2.497274
           inc3w |    1.243284    .1853208      1.46    0.144      .9283089     1.665131
           inc4w |    1.523588    .3385398      1.90    0.058        .98567      2.35507
           _cons |    .0037142    .0007976    -26.06    0.000      .0024382     .0056579
-----------------+----------------------------------------------------------------
          /gamma |    .0204089    .0019108     10.68    0.000      .0166639     .0241539
-----------------+----------------------------------------------------------------

.         sw deaw dvcew sepaw accdw ///
>          cataw illw movew shjobw shfamw shhlw shfincw shhousw shrelaw suprtw suchrw   ///
>          dafter toxic-goodrad kzunder-icdxcnt WHPel-HP2vacatn goferw-radtlw i.cumdosewgp i.percRiskgp ///
>           fcrisis2008 y2009 if gender==2, dist(gomp) nolog nohr vce(robust)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Gompertz regression -- log relative-hazard form

No. of subjects      =          260                Number of obs   =       570
No. of failures      =          505
Time at risk         =        11489
                                                   Wald chi2(60)   =   1013.78
Log pseudolikelihood =    495.47204                Prob > chi2     =    0.0000

(Std. Err. adjusted for 260 clusters in id)
-------------+----------------------------------------------------------------
             |               Robust
           _t |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
        deaw |    .0238353    .0586489      0.41    0.684     -.0911144      .138785
       dvcew |    .3197401    .2071189      1.54    0.123     -.0862054     .7256857
       sepaw |    -.238965    .2979277     -0.80    0.423     -.8228926     .3449626
       accdw |    .1413356    .1122983      1.26    0.208      -.078765     .3614362
       cataw |    1.018095    .2105799      4.83    0.000      .6053658     1.430824
        illw |   -.0175506    .0608696     -0.29    0.773     -.1368528     .1017516
       movew |    .1147023    .1272232      0.90    0.367     -.1346507     .3640552
      shjobw |    .0028173    .0016716      1.69    0.092      -.000459     .0060936
      shfamw |    -.000073    .0020021     -0.04    0.971      -.003997     .0038511
       shhlw |    .0048836    .0019186      2.55    0.011      .0011231      .008644
     shfincw |   -.0019749    .0021583     -0.92    0.360     -.0062052     .0022553
     shhousw |    .0045325    .0015929      2.85    0.004      .0014106     .0076544
     shrelaw |    .0007513    .0021045      0.36    0.721     -.0033733      .004876
      suprtw |   -.0019527    .0013958     -1.40    0.162     -.0046883     .0007829
      suchrw |    .0026602    .0014677      1.81    0.070     -.0002164     .0055367
      dafter |    -.026526    .0147846     -1.79    0.073     -.0555032     .0024512
       toxic |   -.0003106    .0020227     -0.15    0.878      -.004275     .0036539
      repair |   -.0004014     .001581     -0.25    0.800     -.0035001     .0026974
        skin |    -.001642    .0016032     -1.02    0.306     -.0047843     .0015003
        near |    .0002225    .0020001      0.11    0.911     -.0036975     .0041426
       cloud |    .0011301    .0017669      0.64    0.522      -.002333     .0045932
       world |   -.0052824    .0029091     -1.82    0.069     -.0109842     .0004193
    healthef |   -.0284284    .0092255     -3.08    0.002       -.04651    -.0103467
      carcin |    .0318485    .0091201      3.49    0.000      .0139734     .0497236
       woman |    .0021119    .0026362      0.80    0.423      -.003055     .0072788
     saferad |    .0014107    .0018218      0.77    0.439     -.0021601     .0049814
     goodrad |   -.0016828    .0014536     -1.16    0.247     -.0045317     .0011662
     kzunder |    .0033118    .0024958      1.33    0.185     -.0015799     .0082036
      chsize |    .0068633    .0024817      2.77    0.006      .0019992     .0117274
     icdxcnt |     .066018    .0233984      2.82    0.005      .0201579      .111878
       WHPel |    .0053074    .0021084      2.52    0.012       .001175     .0094398
     WHPpain |    .0040668    .0033745      1.21    0.228     -.0025471     .0106807
       WHPer |    .0027829    .0037215      0.75    0.455      -.004511     .0100769
    WHPsleep |      .00004    .0024296      0.02    0.987     -.0047219     .0048018
   WHPsociso |    .0011779    .0025823      0.46    0.648     -.0038833      .006239
       WHPpa |   -.0054025     .004183     -1.29    0.197      -.013601      .002796
     HP2work |    .0820532    .1297083      0.63    0.527     -.1721704     .3362769
   HP2hmcare |   -.2025516    .1235395     -1.64    0.101     -.4446845     .0395813
  HP2probsoc |   -.3352684    .1802421     -1.86    0.063     -.6885365     .0179997
    HP2pbfhm |    .1064537    .1923251      0.55    0.580     -.2704965     .4834039
   HP2sxlife |    .2165709    .1492005      1.45    0.147     -.0758567     .5089984
   HP2inthob |    .1112384     .188696      0.59    0.556      -.258599     .4810758
   HP2vacatn |    .1927368    .1711535      1.13    0.260     -.1427179     .5281915
      goferw |    .0080519    .0032287      2.49    0.013      .0017239       .01438
      fdferw |     .006495    .0027468      2.36    0.018      .0011113     .0118787
      trgovw |    .0016749     .002136      0.78    0.433     -.0025117     .0058614
      trrepw |    .0062088    .0019726      3.15    0.002      .0023426      .010075
       defnw |    .0011473     .002312      0.50    0.620     -.0033841     .0056787
      efradw |    .0013653    .0017878      0.76    0.445     -.0021386     .0048693
       ecprw |   -.0033639    .0020461     -1.64    0.100     -.0073741     .0006464
      polprw |   -.0022359    .0019896     -1.12    0.261     -.0061354     .0016637
        airw |   -.0013397    .0023151     -0.58    0.563     -.0058773     .0031979
        radw |    .0033587    .0018961      1.77    0.076     -.0003575     .0070749
      radchw |    .0030648    .0023907      1.28    0.200      -.001621     .0077505
      radtlw |    .0022804    .0022238      1.03    0.305     -.0020782      .006639
             |
  cumdosewgp |
       high  |   -.4892589    .1001901     -4.88    0.000     -.6856278    -.2928899
             |
  percRiskgp |
     medium  |   -.9756402    .1534846     -6.36    0.000     -1.276464     -.674816
       high  |    -1.15731    .2117594     -5.47    0.000     -1.572351    -.7422696
             |
 fcrisis2008 |   -1.272941    .1893897     -6.72    0.000     -1.644138    -.9017444
       y2009 |    -.836261    .1938812     -4.31    0.000     -1.216261    -.4562608
       _cons |   -9.337078    .5263294    -17.74    0.000     -10.36866    -8.305491
-------------+----------------------------------------------------------------
      /gamma |    .0788478    .0047711     16.53    0.000      .0694965     .0881991
-------------+----------------------------------------------------------------

.     est store sdgomp2

.         predict cs2, csnell
(950 missing values generated)

.         predict hz2, haz
(157 missing values generated)

.         predict srv2, sur
(157 missing values generated)

.
. title(Graphical test of Female Gompertz model residual fit)


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                             (Graphical                              *****
*****                                test                                 *****
*****                                 of                                  *****
*****                               Female                                *****
*****                              Gompertz                               *****
*****                               model                                 *****
*****                              residual                               *****
*****                                fit)                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:27:49  *****
*******************************************************************************
*******************************************************************************


.
. cap drop km2

. cap drop cumhaz2

. stset cs2, failure(outcome==1)

     failure event:  outcome == 1
obs. time interval:  (0, cs2]
 exit on or before:  failure

------------------------------------------------------------------------------
     1210  total observations
      950  event time missing (cs2>=.)                          PROBABLE ERROR
------------------------------------------------------------------------------
      260  observations remaining, representing
      195  failures in single-record/single-failure data
      505  total analysis time at risk and under observation
                                              at risk from t =         0
                                   earliest observed entry t =         0
                                        last observed exit t =  10.94275

.
. sts gen km2=s

. gen cumhaz2 = -ln(km2)
(951 missing values generated)

. line cumhaz2 cs2 cs2, sort name("Gompertz, replace") title(female Cox-Snell residuals deviate from optimal line)

. graph save femrestest.gph, replace
(file femrestest.gph saved)

. graph export femrestest.eps, replace
(file femrestest.eps written in EPS format)

.
. est clear

.
. stset, clear

.
. stset endepdate, id(id) failure(outcome==1) time0(startdate) exit(time .)

                id:  id
     failure event:  outcome == 1
obs. time interval:  (startdate, endepdate]
 exit on or before:  time .

------------------------------------------------------------------------------
     1210  total observations
        0  exclusions
------------------------------------------------------------------------------
     1210  observations remaining, representing
      683  subjects
      980  failures in multiple-failure-per-subject data
    29853  total analysis time at risk and under observation
                                              at risk from t =         0
                                   earliest observed entry t =        40
                                        last observed exit t =       101

. // Variable index
.  set more off

.  des agegp marrw childw emplw occ1w-occ8w inc1w-inc4w jsw deaw dvcew sepaw accdw ///
>     cataw illw movew shjobw shfamw shhlw shfincw shhousw shrelaw suprtw suchrw   ///
>          dafter toxic-icdxcnt WHPel-HP2vacatn goferw-radtlw dauthw-neiw cumdosewgp percRiskgp

              storage   display    value
variable name   type    format     label      variable label
-------------


agegp             float     %10.0g       ag             3way bkdwn of age in years


marrw             float     %15.0g       LABH           cohabitation/marital status


childw            float     %9.0g                       number of children


emplw             float     %15.0g       LABI           mode of employment


occ1w             float     %15.0g       LABJ           profess executive administration


occ2w             float     %15.0g       LABJ           technical sales admin support


occ3w             float     %15.0g       LABJ           service occup protective services


occ4w             float     %15.0g       LABJ           precision prod mechan craft construction


occ5w             float     %15.0g       LABJ           factory laborer machinist transp cleaner


occ6w             float     %15.0g       LABJ           farming agricul forestry fishing trapping logging


occ7w             float     %15.0g       LABJ           homemaking or caregiving


occ8w             float     %15.0g       LABJ           student


inc1w             float     %15.0g       LABJ           Income is not sufficient for basic neccessities


inc2w             float     %15.0g       LABJ           Income is just sufficient for basic neccessities


inc3w             float     %15.0g       LABJ           Income is sufficient for basics plus extra purchases/savings


inc4w             float     %15.0g       LABJ           Income allows to comfortably afford luxury items


jsw               float     %9.0g                       Job satisfaction on a scale of 0-100% in


deaw              float     %9.0g                       Total number of death experienced in time period


dvcew             float     %9.0g                       Total number of divorces experienced in time period


sepaw             float     %9.0g                       Total number of separations experienced in time period


accdw             float     %9.0g                       Total number of accidents experienced in time period


cataw             float     %9.0g                       Total number of disasters experienced in time period


illw              float     %9.0g                       Total number of illnesses experienced in time period


movew             float     %9.0g                       Total number of moves experienced in time period


shjobw            float     %9.0g                       Percentage of strains and hassles related to job


shfamw            float     %9.0g                       Percentage of strains and hassles related to family


shhlw             float     %9.0g                       Percentage of strains and hassles related to health


shfincw           float     %9.0g                       Percentage of strains and hassles related to finances


shhousw           float     %9.0g                       Percentage of strains and hassles related to housing


shrelaw           float     %9.0g                       Percentage of strains and hassles related to relationships


suprtw            float     %9.0g                       Level of support (in percent) from partner


suchrw            float     %9.0g                       Level of support (in percent) from Chernobyl survivor benefits


dafter            int       %8.0g                   *   #days lapsed after Chornobyl accident before you heard about the acc


toxic             byte      %8.0g                       all radioactive materials remain toxic for thousands of years (% of agree)


repair            byte      %8.0g                   *    body has capability to repair tissue damage caused by exposure (% of agree)


skin              byte      %8.0g                       a suntan is caused by radiating damage to the skin (% of agree)


near              byte      %8.0g                   *   radiation from a nuclear plant is more concentrated near the plant (% of agree)


cloud             byte      %8.0g                   *   radioactive fallout is only harmful when visible (% of agree)


world             byte      %8.0g                   *   the chornobyl accident has affected people around the world(% of agree)


healthef          byte      %8.0g                   *   a person exposed to any radiation  likely to suffer from (% of agree)


carcin            byte      %8.0g                   *   a person exposed to carcinogen  is likely to get cancer (% of agree)


woman             byte      %8.0g                   *   pregnant exposed to radiation likely  birth to children with deffects (% agree)


saferad           byte      %8.0g                       there is no safe level of radiation (% of agree)


goodrad           byte      %8.0g                       small doses can actually improve one's health(% of agree)


kzchorn           byte      %8.0g                   *   in k/z most cancerare known to be caused by radiation from Chern (% of agree)


kzunder           byte      %8.0g                       people in k/z underestimate the risks assoicated with radiation (% of agree)


chsize            byte      %8.0g                   *   rad. fallout fr Cher affected mr ppl than the rad from other sites (% of agree)


icdxcnt           float     %9.0g                       count of icdx illnesses


WHPel             float     %9.0g                       Wtd Health Profile Pt 1 Energy Level Subscale


WHPpain           float     %9.0g                       Wtd Health Profile Pain Pt 1 subscale


WHPer             float     %9.0g                       Wtd Health Profile Emotional reaction Pt 1 subscale


WHPsleep          float     %9.0g                       Wtd Health Profile Sleep Pt 1 subscale


WHPsociso         float     %9.0g                       Wtd Health Profile Social Isolation Pt 1 subscale


WHPpa             float     %9.0g                       Wtd Health Profile Physical Ability Pt 1 Subscale


HP2work           float     %9.0g        hp2fmt         Nottingham Health profile subscale Part2: paid employment


HP2hmcare         float     %9.0g        hp2fmt         Hlth profile Pt2: Home cleaning, cooking and repairs


HP2probsoc        float     %9.0g        hp2fmt         Hlth profile Pt2: Hlth causing probs with social life


HP2pbfhm          float     %9.0g        hp2fmt         Hlth profile Pt2: Hlth causing probs with family members at home


HP2sxlife         float     %9.0g        hp2fmt         Hlth profile Pt2: Hlth causing probs with sex life


HP2inthob         float     %9.0g        hp2fmt         Hlth profile Pt2: Hlth probs interfering with interests & hobbies


HP2vacatn         float     %9.0g        hp2fmt         Hlth profile Pt2: Hlth probs interfering with vacations


goferw            float     %9.0g                       level of fear in percent from going outdoors


fdferw            float     %9.0g                       level of fear in percent from consuming foods contaminated with radiation


trgovw            float     %9.0g                       level of trust in government reports about chornobyl


trrepw            float     %9.0g                       level of trust in  medical/scientific reports about chornobyl


defnw             float     %9.0g                       consider hazardous (in per) - deficiencies in essential nutrition


efradw            float     %9.0g                       consider hazardous (in per) - effects of radiation


ecprw             float     %9.0g                       consider hazardous (in per) - economic problems


polprw            float     %9.0g                       consider hazardous (in per) - political problems


airw              float     %9.0g                       consider hazardous (in per) - air and water pollution


radw              float     %9.0g                       believed % of the radioactively contaminated area


radchw            float     %9.0g                       believed % of polution related to chornobyl


radtlw            float     %9.0g                       believed % of cumulated radiation exposed to in a lifetime


dauthw            float     %9.0g                       level of danger by authorities in %


medw              float     %9.0g                       level of danger by general media %


neiw              float     %9.0g                       level of danger by neighbors in  %


cumdosewgp        float     %9.0g        cdg            Avgcumdosew grouped into low and high


percRiskgp        float     %9.0g        prg            Perceived risk group level


.  label list ag LABH LABI LABJ hp2fmt cdg rgp fgp
ag:
           0 28 thru 42
           1 43 thru 55
           2 56 thru 84
LABH:
           0 0. not answered
           1 1. single
           2 2. cohabitating
           3 3. married
           4 4. separated
           5 5. divorced
           6 6. widowed
LABI:
           0 0. not answered
           1 1. full time
           2 2. part time
           3 3. voluntary
           4 4. retired
           5 5. unemployed
LABJ:
           0 0. not selected
           1 1. selected
hp2fmt:
           0 0. no
           1 1. yes
cdg:
           0 low
           1 high
rgp:
           0 low
           1 high
fgp:
           0 low
           1 high

.
.
.
. * Constructing the male model for stratification
.          tab depinr if gender==1

 Depression |
    episode |
   sequence |
     number |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        130       24.71       24.71
          1 |        201       38.21       62.93
          2 |         91       17.30       80.23
          3 |         52        9.89       90.11
          4 |         28        5.32       95.44
          5 |         16        3.04       98.48
          6 |          4        0.76       99.24
          7 |          3        0.57       99.81
          8 |          1        0.19      100.00
------------+-----------------------------------
      Total |        526      100.00

.
. set more off

. title Full male cox regression


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                                Full                                 *****
*****                                male                                 *****
*****                                cox                                  *****
*****                             regression                              *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:27:51  *****
*******************************************************************************
*******************************************************************************


. stcox i.agegp i.marrw childw i.emplw occ1w-occ7w  ///
>     inc1w inc2w inc3w inc4w jsw deaw dvcew sepaw accdw ///
>          cataw illw movew shjobw shfamw shhlw shfincw shhousw shrelaw suprtw suchrw   ///
>          dafter skin-icdxcnt WHPel-HP2vacatn goferw-radtlw i.cumdosewgp i.percRiskgp ///
>     dauthw-neiw fcrisis2008 y2009 if gender==1, nolog nohr vce(robust)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Cox regression -- Breslow method for ties

No. of subjects      =          290                Number of obs   =       482
No. of failures      =          370
Time at risk         =        13321
                                                   Wald chi2(85)   =   3083.44
Log pseudolikelihood =   -1649.6143                Prob > chi2     =    0.0000

(Std. Err. adjusted for 290 clusters in id)
-----------------+----------------------------------------------------------------
                 |               Robust
               _t |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-----------------+----------------------------------------------------------------
           agegp |
     43 thru 55  |    .4392818    .1903129      2.31    0.021      .0662754     .8122883
     56 thru 84  |     .378897    .2258892      1.68    0.093     -.0638376     .8216317
                 |
           marrw |
2. cohabitating  |   -.2560031    .3373894     -0.76    0.448     -.9172742      .405268
     3. married  |    .3978633    .2157728      1.84    0.065     -.0250437     .8207702
   4. separated  |    .8609837    .6787475      1.27    0.205      -.469337     2.191304
    5. divorced  |   -.6644964    .3765751     -1.76    0.078      -1.40257     .0735771
     6. widowed  |     .622159    .3753581      1.66    0.097     -.1135293     1.357847
                 |
          childw |   -.1617582    .0821141     -1.97    0.049     -.3226989    -.0008176
                 |
           emplw |
   2. part time  |    .0880898    .1952451      0.45    0.652     -.2945835     .4707631
     4. retired  |    1.293948     .641619      2.02    0.044      .0363981     2.551498
  5. unemployed  |    1.465036    .6916588      2.12    0.034      .1094093     2.820662
                 |
           occ1w |    .6969981    .5153458      1.35    0.176      -.313061     1.707057
           occ2w |    .7876079    .5216461      1.51    0.131     -.2347997     1.810015
           occ3w |    .8059481    .5197965      1.55    0.121     -.2128343     1.824731
           occ4w |    .1764538    .5326153      0.33    0.740     -.8674531     1.220361
           occ5w |    .4129854    .5204026      0.79    0.427      -.606985     1.432956
           occ6w |    2.437982    .7018488      3.47    0.001      1.062384      3.81358
           occ7w |   -.9667523    .4097825     -2.36    0.018     -1.769911    -.1635933
           inc1w |     .107533    .3915526      0.27    0.784     -.6598959     .8749619
           inc2w |    .1723337    .3853676      0.45    0.655     -.5829729     .9276404
           inc3w |    .1449746    .3563615      0.41    0.684     -.5534812     .8434304
           inc4w |    .1161508    .4148382      0.28    0.779     -.6969172     .9292188
             jsw |    .0009219    .0028597      0.32    0.747      -.004683     .0065268
            deaw |    .2859349    .0747766      3.82    0.000      .1393755     .4324942
           dvcew |    1.174837    .3812648      3.08    0.002       .427572     1.922102
           sepaw |   -.3172316    .3314383     -0.96    0.338     -.9668387     .3323755
           accdw |     .128227    .1116384      1.15    0.251     -.0905803     .3470343
           cataw |     .411929    .2777964      1.48    0.138      -.132542     .9563999
            illw |    .2481869    .0783237      3.17    0.002      .0946753     .4016986
           movew |   -.0118922     .132827     -0.09    0.929     -.2722284     .2484441
          shjobw |    .0011253    .0023806      0.47    0.636     -.0035406     .0057912
          shfamw |    -.003634    .0030994     -1.17    0.241     -.0097087     .0024407
           shhlw |   -.0020718    .0026781     -0.77    0.439     -.0073207     .0031771
         shfincw |    -.005439    .0025972     -2.09    0.036     -.0105294    -.0003487
         shhousw |    .0016199    .0022675      0.71    0.475     -.0028242     .0060641
         shrelaw |    .0075745    .0026472      2.86    0.004       .002386      .012763
          suprtw |   -.0018615    .0022954     -0.81    0.417     -.0063604     .0026375
          suchrw |   -.0043179    .0021289     -2.03    0.043     -.0084904    -.0001453
          dafter |   -.0000167    .0006183     -0.03    0.978     -.0012285     .0011951
            skin |    .0045147    .0018913      2.39    0.017      .0008078     .0082215
            near |    .0013025    .0023598      0.55    0.581     -.0033227     .0059276
           cloud |    .0002769    .0020741      0.13    0.894     -.0037882      .004342
           world |   -.0073999    .0036502     -2.03    0.043     -.0145541    -.0002456
        healthef |    .0089116    .0087678      1.02    0.309     -.0082728     .0260961
          carcin |   -.0111638    .0082179     -1.36    0.174     -.0272705      .004943
           woman |    .0051981    .0028166      1.85    0.065     -.0003224     .0107187
         saferad |    .0029656    .0022119      1.34    0.180     -.0013697     .0073008
         goodrad |    .0053139    .0021584      2.46    0.014      .0010836     .0095442
         kzchorn |   -.0115619     .003304     -3.50    0.000     -.0180375    -.0050862
         kzunder |    .0038318    .0024737      1.55    0.121     -.0010165     .0086802
          chsize |    .0018364    .0024995      0.73    0.463     -.0030625     .0067353
         icdxcnt |    .0180592    .0497178      0.36    0.716     -.0793859     .1155042
           WHPel |    .0016767    .0027215      0.62    0.538     -.0036574     .0070108
         WHPpain |   -.0063871    .0059532     -1.07    0.283     -.0180552      .005281
           WHPer |    .0114107    .0062247      1.83    0.067     -.0007895     .0236108
        WHPsleep |    .0018422    .0028372      0.65    0.516     -.0037187      .007403
       WHPsociso |    .0126186    .0033188      3.80    0.000      .0061138     .0191235
           WHPpa |    .0066497    .0050292      1.32    0.186     -.0032074     .0165068
         HP2work |    .3250728    .1547313      2.10    0.036       .021805     .6283405
       HP2hmcare |    .4623876    .1672492      2.76    0.006      .1345852     .7901901
      HP2probsoc |   -.0899071     .195505     -0.46    0.646     -.4730897     .2932756
        HP2pbfhm |    .0209523    .2367166      0.09    0.929     -.4430036     .4849082
       HP2sxlife |   -.2717453    .1646435     -1.65    0.099     -.5944405       .05095
       HP2inthob |    .2892007    .2486402      1.16    0.245     -.1981252     .7765266
       HP2vacatn |   -.1634948    .2221379     -0.74    0.462     -.5988772     .2718876
          goferw |   -.0011907    .0032445     -0.37    0.714     -.0075498     .0051684
          fdferw |    .0049585    .0033259      1.49    0.136     -.0015602     .0114771
          trgovw |   -.0016113    .0021141     -0.76    0.446     -.0057549     .0025322
          trrepw |    .0070899    .0019864      3.57    0.000      .0031966     .0109832
           defnw |   -.0054756     .002525     -2.17    0.030     -.0104245    -.0005268
          efradw |    .0070295    .0019932      3.53    0.000      .0031229     .0109362
           ecprw |   -.0021613    .0019404     -1.11    0.265     -.0059643     .0016417
          polprw |   -.0014172    .0021956     -0.65    0.519     -.0057205     .0028861
            airw |    .0013839    .0023982      0.58    0.564     -.0033166     .0060843
            radw |    .0059417    .0020909      2.84    0.004      .0018436     .0100397
          radchw |   -.0015833    .0023862     -0.66    0.507     -.0062602     .0030937
          radtlw |      .00887    .0024839      3.57    0.000      .0040017     .0137383
                 |
      cumdosewgp |
           high  |   -.0646316    .1425576     -0.45    0.650     -.3440394     .2147762
                 |
      percRiskgp |
         medium  |    .1811224    .1732902      1.05    0.296     -.1585202      .520765
           high  |    .3822428    .2332135      1.64    0.101     -.0748473     .8393329
                 |
          dauthw |    .0017819    .0035303      0.50    0.614     -.0051375     .0087012
            medw |   -.0003264     .003809     -0.09    0.932     -.0077919     .0071392
            neiw |    .0016695    .0026979      0.62    0.536     -.0036184     .0069574
     fcrisis2008 |   -.9425038    .2075271     -4.54    0.000     -1.349249    -.5357582
           y2009 |   -1.310417    .2016571     -6.50    0.000     -1.705657    -.9151762
-----------------+----------------------------------------------------------------

. estat phtest , detail

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |       rho            chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      0b.agegp    |            .            .        1             .
      1.agegp     |      0.04020         0.72        1         0.3957
      2.agegp     |     -0.02826         0.32        1         0.5724
      1b.marrw    |            .            .        1             .
      2.marrw     |     -0.00653         0.02        1         0.8973
      3.marrw     |      0.04403         0.95        1         0.3306
      4.marrw     |      0.03195         0.35        1         0.5533
      5.marrw     |      0.06095         1.86        1         0.1725
      6.marrw     |      0.06411         1.39        1         0.2379
      childw      |     -0.00092         0.00        1         0.9826
      1b.emplw    |            .            .        1             .
      2.emplw     |     -0.07018         2.61        1         0.1062
      4.emplw     |     -0.07446         4.12        1         0.0423
      5.emplw     |     -0.12105        13.37        1         0.0003
      occ1w       |     -0.11422         9.01        1         0.0027
      occ2w       |     -0.13306        12.92        1         0.0003
      occ3w       |     -0.10584         7.94        1         0.0048
      occ4w       |     -0.08293         4.62        1         0.0316
      occ5w       |     -0.10681         7.28        1         0.0070
      occ6w       |     -0.03866         1.09        1         0.2969
      occ7w       |      0.04310         0.72        1         0.3970
      inc1w       |     -0.12336         8.23        1         0.0041
      inc2w       |     -0.16756        18.44        1         0.0000
      inc3w       |     -0.16695        17.24        1         0.0000
      inc4w       |     -0.16306        13.84        1         0.0002
      jsw         |      0.00671         0.02        1         0.8838
      deaw        |     -0.07787         4.18        1         0.0410
      dvcew       |     -0.01977         0.25        1         0.6168
      sepaw       |      0.05753         1.81        1         0.1789
      accdw       |      0.06834         2.71        1         0.0999
      cataw       |      0.12331         5.79        1         0.0161
      illw        |     -0.02259         0.35        1         0.5543
      movew       |     -0.11245         6.57        1         0.0104
      shjobw      |      0.16560        19.23        1         0.0000
      shfamw      |     -0.00915         0.05        1         0.8171
      shhlw       |     -0.04693         1.46        1         0.2267
      shfincw     |     -0.03891         0.59        1         0.4436
      shhousw     |     -0.05642         1.20        1         0.2738
      shrelaw     |     -0.08855         4.04        1         0.0445
      suprtw      |     -0.07855         3.32        1         0.0683
      suchrw      |      0.09044         3.58        1         0.0586
      dafter      |      0.11022         8.46        1         0.0036
      skin        |     -0.05361         1.45        1         0.2291
      near        |     -0.20093        23.97        1         0.0000
      cloud       |      0.03861         0.65        1         0.4219
      world       |      0.01058         0.08        1         0.7758
      healthef    |      0.11789         6.15        1         0.0131
      carcin      |     -0.11438         6.85        1         0.0089
      woman       |      0.03425         0.39        1         0.5298
      saferad     |      0.00618         0.02        1         0.8922
      goodrad     |      0.03859         0.63        1         0.4263
      kzchorn     |      0.14481         9.79        1         0.0018
      kzunder     |     -0.08877         2.26        1         0.1330
      chsize      |     -0.04180         0.72        1         0.3956
      icdxcnt     |     -0.11121        10.37        1         0.0013
      WHPel       |     -0.13259         9.48        1         0.0021
      WHPpain     |      0.03360         0.59        1         0.4422
      WHPer       |      0.08035         4.27        1         0.0389
      WHPsleep    |     -0.03843         0.71        1         0.3996
      WHPsociso   |      0.03045         0.55        1         0.4570
      WHPpa       |     -0.07574         3.25        1         0.0716
      HP2work     |     -0.05910         1.98        1         0.1593
      HP2hmcare   |      0.14350         9.82        1         0.0017
      HP2probsoc  |      0.00565         0.02        1         0.8899
      HP2pbfhm    |      0.06227         2.28        1         0.1314
      HP2sxlife   |      0.08949         2.99        1         0.0838
      HP2inthob   |     -0.01858         0.22        1         0.6416
      HP2vacatn   |     -0.10195         4.19        1         0.0406
      goferw      |     -0.03179         0.43        1         0.5096
      fdferw      |      0.11379         9.76        1         0.0018
      trgovw      |      0.04864         0.85        1         0.3576
      trrepw      |     -0.13543         6.87        1         0.0087
      defnw       |      0.19175        27.43        1         0.0000
      efradw      |     -0.05902         1.58        1         0.2088
      ecprw       |     -0.02096         0.20        1         0.6562
      polprw      |      0.00728         0.03        1         0.8728
      airw        |     -0.11114         8.53        1         0.0035
      radw        |     -0.15044         6.62        1         0.0101
      radchw      |      0.06532         1.86        1         0.1732
      radtlw      |      0.02356         0.39        1         0.5319
      0b.cumdose~p |           .            .        1             .
      1.cumdosewgp |    -0.12313        10.20        1         0.0014
      0b.percRis~p |           .            .        1             .
      1.percRiskgp |    -0.10144         6.26        1         0.0123
      2.percRiskgp |    -0.01216         0.07        1         0.7975
      dauthw      |     -0.08661         6.57        1         0.0104
      medw        |      0.09504         8.83        1         0.0030
      neiw        |     -0.07643         3.35        1         0.0671
      fcrisis2008 |     -0.26861        44.78        1         0.0000
      y2009       |     -0.14807        12.18        1         0.0005
      ------------+---------------------------------------------------
      global test |                    204.46       85         0.0000
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

. stphplot if depinr < 4, by(depinr) xline(51 96 98) nolntime ///
>    title("Male Recurrent event depression model" "Survival probability by analysis time") ///
>    text(-.8 50 "1986 Chornobyl"   .5 95 "2008 Financial Crisis"  .4 97 "Gas shut-off", orientation(vertical)) ///
>    caption(depinr=depression episode number)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save mcreha1.gph, replace
(file mcreha1.gph saved)

. graph export mcreha1.eps, replace
(file mcreha1.eps written in EPS format)

.
. stcoxkm if depinr < 4, by(depinr) title("Male Recurrent depression events analysis" "Survival proability by analysis time") ///
>     xline(52 96 98)  text(50 -.25 "1986 Chornobyl" , orientation(vertical)) ///
>            caption(depinr=depression episode number)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

. graph save mcreha2.gph, replace
(file mcreha2.gph saved)

. graph export mcreha2.eps, replace
(file mcreha2.eps written in EPS format)

.
.          sort id date

. title Trimm1  male cox regression (at .15)


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                               Trimm1                                *****
*****                                male                                 *****
*****                                cox                                  *****
*****                             regression                              *****
*****                                (at                                  *****
*****                                .15)                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:27:59  *****
*******************************************************************************
*******************************************************************************


.         set more off

.         stcox i.agegp i.marrw childw i.emplw occ1w-occ7w  ///
>      deaw dvcew  ///
>          cataw illw  shrelaw suchrw  ///
>           skin cloud world woman goodrad WHPer WHPsociso ///
>           fdferw  trrepw defnw efradw radw radtlw i.cumdosewgp i.percRiskgp ///
>       fcrisis2008 y2009 ///
>           if gender==1 , nolog vce(robust)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Cox regression -- Breslow method for ties

No. of subjects      =          291                Number of obs   =       483
No. of failures      =          370
Time at risk         =        13382
                                                   Wald chi2(42)   =    774.16
Log pseudolikelihood =   -1685.4131                Prob > chi2     =    0.0000

(Std. Err. adjusted for 291 clusters in id)
-----------------+----------------------------------------------------------------
                 |               Robust
               _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-----------------+----------------------------------------------------------------
           agegp |
     43 thru 55  |    1.694685    .2714265      3.29    0.001      1.238106     2.319639
     56 thru 84  |    1.691796    .3158607      2.82    0.005       1.17335     2.439319
                 |
           marrw |
2. cohabitating  |    .5548428     .168171     -1.94    0.052      .3063187     1.005001
     3. married  |    1.126473    .2244453      0.60    0.550      .7622939     1.664636
   4. separated  |    1.455848    .9587145      0.57    0.568      .4004765     5.292427
    5. divorced  |    .5557994    .1696866     -1.92    0.054      .3055234     1.011094
     6. widowed  |    1.131849    .3867733      0.36    0.717      .5793185      2.21136
                 |
          childw |    .8980977     .062947     -1.53    0.125      .7828229     1.030347
                 |
           emplw |
   2. part time  |    .9003827    .1404537     -0.67    0.501      .6632013     1.222388
     4. retired  |    2.508918    1.313514      1.76    0.079       .899187     7.000401
  5. unemployed  |     2.05844    1.151538      1.29    0.197      .6876334      6.16197
                 |
           occ1w |    1.527947    .7609663      0.85    0.395      .5756823     4.055401
           occ2w |    1.422152    .7163187      0.70    0.484      .5299161     3.816671
           occ3w |    1.641637    .8198403      0.99    0.321      .6168555     4.368886
           occ4w |    .9496114    .4846781     -0.10    0.919      .3492174     2.582236
           occ5w |    1.103677    .5530067      0.20    0.844      .4133709     2.946753
           occ6w |     10.8681    6.664419      3.89    0.000      3.267297     36.15083
           occ7w |    .4240763    .1342235     -2.71    0.007       .228051     .7885987
            deaw |    1.205016    .0813142      2.76    0.006      1.055732     1.375408
           dvcew |    1.612456    .4974436      1.55    0.121       .880829      2.95178
           cataw |    1.681045    .3069383      2.84    0.004      1.175331     2.404354
            illw |    1.199229     .059434      3.67    0.000      1.088219     1.321563
         shrelaw |    1.001956    .0014995      1.31    0.192      .9990211     1.004899
          suchrw |    .9967589    .0015916     -2.03    0.042      .9936442     .9998832
            skin |    1.002983    .0015289      1.95    0.051      .9999906     1.005984
           cloud |    .9995206    .0015023     -0.32    0.750      .9965804     1.002469
           world |    .9997084    .0025444     -0.11    0.909      .9947338     1.004708
           woman |    1.003902    .0024043      1.63    0.104      .9992011     1.008626
         goodrad |     1.00281    .0017916      1.57    0.116      .9993049     1.006328
           WHPer |    1.015917    .0039688      4.04    0.000      1.008168     1.023726
       WHPsociso |    1.010703    .0028282      3.80    0.000      1.005175     1.016261
          fdferw |    1.006066    .0019984      3.04    0.002      1.002157      1.00999
          trrepw |    1.004693    .0016406      2.87    0.004      1.001482     1.007913
           defnw |    .9969795    .0018941     -1.59    0.111       .993274     1.000699
          efradw |    1.007074    .0016939      4.19    0.000      1.003759     1.010399
            radw |    1.003072    .0017224      1.79    0.074      .9997022     1.006454
          radtlw |    1.003906     .001765      2.22    0.027      1.000453     1.007372
                 |
      cumdosewgp |
           high  |    .9804647    .1071269     -0.18    0.857      .7914593     1.214606
                 |
      percRiskgp |
         medium  |    .9368478    .1261723     -0.48    0.628      .7195009     1.219851
           high  |    .8314913    .1270496     -1.21    0.227       .616306     1.121809
                 |
     fcrisis2008 |    .3094209    .0559315     -6.49    0.000      .2171125     .4409755
           y2009 |     .321144    .0623403     -5.85    0.000      .2195154     .4698234
-----------------+----------------------------------------------------------------

.
.
.
. forv i=1/3 {
  2. title Linearity test for depinr==`i' and gender==male
  3. title2 testing without agegp
  4. set more off
  5. fracpoly, powers(-2 -1 -0.5 .5 1 2) compare: ///
>         stcox married childw  occ1w-occ7w  ///
>      deaw dvcew  ///
>          cataw illw  shrelaw suchrw  ///
>           skin cloud world woman goodrad WHPer WHPsociso ///
>           fdferw  trrepw defnw efradw radw radtlw avgcumdosew percHlthRsk ///
>       fcrisis2008 y2009 ///
>           if gender==1 & depinr==`i', nolog vce(robust)
  6. }


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                             Linearity                               *****
*****                                test                                 *****
*****                                for                                  *****
*****                             depinr==1                               *****
*****                                and                                  *****
*****                            gender==male                             *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:28:00  *****
*******************************************************************************
*******************************************************************************


-------------
title2: testing
                                       Date and time:   2 Sep 2013    13:28:00
                                       Working directory:  /Users/robertyaffee/Documents/data/research/chwk/phase4/survival/wk
                                       Stata data file:  stdepress28aug2013c.dta  has  1868  variables and  1210  observations

testing
-------------
-> gen double Ichil__1 = childw-1.078651685 if e(sample)
-> gen double Ideaw__1 = deaw-.5112359551 if e(sample)
-> gen double Iillw__1 = illw-.4157303371 if e(sample)
-> gen double Ishre__1 = shrelaw-42.92696629 if e(sample)
-> gen double Isuch__1 = suchrw-38.06179775 if e(sample)
-> gen double Iskin__1 = skin-45.20224719 if e(sample)
-> gen double Iclou__1 = cloud-31.12921348 if e(sample)
-> gen double Iworl__1 = world-86.74157303 if e(sample)
-> gen double Iwoma__1 = woman-66.62921348 if e(sample)
-> gen double Igood__1 = goodrad-53.53932584 if e(sample)
-> gen double IWHPe__1 = WHPer-14.98988753 if e(sample)
-> gen double IWHPs__1 = WHPsociso-9.392471972 if e(sample)
-> gen double Ifdfe__1 = fdferw-33.23033708 if e(sample)
-> gen double Itrre__1 = trrepw-46.51685393 if e(sample)
-> gen double Idefn__1 = defnw-59.44382022 if e(sample)
-> gen double Iefra__1 = efradw-60.03370787 if e(sample)
-> gen double Iradw__1 = radw-46.52247191 if e(sample)
-> gen double Iradt__1 = radtlw-54.69662921 if e(sample)
-> gen double Iavgc__1 = avgcumdosew-1.006996066 if e(sample)
-> gen double Iperc__1 = percHlthRsk-59.67041198 if e(sample)
......
-> gen double Imarr__1 = X^-2 if e(sample)
-> gen double Imarr__2 = X^-2*ln(X) if e(sample)
   (where: X = (married+1))

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

note: Imarr__2 omitted because of collinearity
Iteration 0:   log pseudolikelihood = -766.20356
Iteration 1:   log pseudolikelihood = -725.96191
Iteration 2:   log pseudolikelihood =  -709.8672
Iteration 3:   log pseudolikelihood = -709.36283
Iteration 4:   log pseudolikelihood = -709.35984
Iteration 5:   log pseudolikelihood = -709.35984
Refining estimates:
Iteration 0:   log pseudolikelihood = -709.35984

Cox regression -- Breslow method for ties

No. of subjects      =          178                Number of obs   =       178
No. of failures      =          178
Time at risk         =         4145
                                                   Wald chi2(32)   =    249.76
Log pseudolikelihood =   -709.35984                Prob > chi2     =    0.0000

(Std. Err. adjusted for 178 clusters in id)
-------------+----------------------------------------------------------------
             |               Robust
           _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    Imarr__1 |    .7383779    .1992033     -1.12    0.261      .4351483     1.252911
    Imarr__2 |           1   (omitted)
    Ichil__1 |    .9093375    .0944093     -0.92    0.360      .7419106     1.114548
       occ1w |    1.008272     .278671      0.03    0.976      .5865682     1.733153
       occ2w |     .904164    .2503089     -0.36    0.716      .5255336     1.555586
       occ3w |    .6709418    .2449758     -1.09    0.274      .3280139      1.37239
       occ4w |    .6435292    .2416993     -1.17    0.241      .3082269     1.343587
       occ5w |    .7211479    .2643684     -0.89    0.373      .3515435     1.479346
       occ6w |    4.507288    3.261854      2.08    0.037      1.091224     18.61729
       occ7w |    .6979658    .2202245     -1.14    0.254      .3760626     1.295413
    Ideaw__1 |    1.097247    .0735787      1.38    0.166      .9621105     1.251365
       dvcew |    .7759714    .1900663     -1.04    0.300       .480123      1.25412
       cataw |    1.952967    .5700536      2.29    0.022       1.10214     3.460613
    Iillw__1 |    .9744905    .0824953     -0.31    0.760      .8255042     1.150366
    Ishre__1 |    1.005672    .0016867      3.37    0.001      1.002371     1.008983
    Isuch__1 |    .9984343    .0017101     -0.91    0.360      .9950881     1.001792
    Iskin__1 |     1.00025    .0018741      0.13    0.894      .9965837      1.00393
    Iclou__1 |    1.001951    .0021901      0.89    0.373      .9976675     1.006253
    Iworl__1 |    1.005555    .0029335      1.90    0.058      .9998219     1.011321
    Iwoma__1 |    1.006755    .0030647      2.21    0.027      1.000766     1.012779
    Igood__1 |    .9949277    .0022254     -2.27    0.023      .9905755      .999299
    IWHPe__1 |    1.005088    .0054301      0.94    0.348      .9945009     1.015787
    IWHPs__1 |    1.006282    .0037117      1.70    0.090      .9990333     1.013583
    Ifdfe__1 |    1.008122    .0023199      3.52    0.000      1.003586      1.01268
    Itrre__1 |    1.008972    .0026268      3.43    0.001      1.003837     1.014134
    Idefn__1 |    .9926996    .0023804     -3.06    0.002      .9880451     .9973761
    Iefra__1 |    1.012714    .0023729      5.39    0.000      1.008073     1.017375
    Iradw__1 |    1.008754    .0026875      3.27    0.001        1.0035     1.014035
    Iradt__1 |    1.002627    .0021544      1.22    0.222      .9984136     1.006859
    Iavgc__1 |    1.022646    .0167033      1.37    0.170      .9904264     1.055913
    Iperc__1 |    .9873262    .0031286     -4.03    0.000      .9812133     .9934771
 fcrisis2008 |    .3006585    .0699531     -5.17    0.000      .1905582     .4743724
       y2009 |    2.056018    .5222465      2.84    0.005      1.249725     3.382514
-------------+----------------------------------------------------------------
Deviance:  1418.72. Best powers of married among 27 models fit: -2 -2.

Fractional polynomial model comparisons:
---------------------------------------------------------------
married          df       Deviance   Dev. dif.  P (*)  Powers
---------------------------------------------------------------
Not in model      0       1419.544     0.824    0.935
Linear            1       1418.720     0.000    1.000  1
m = 1             2       1418.720     0.000    1.000  -2
m = 2             4       1418.720        --       --  -2 -2
---------------------------------------------------------------
(*) P-value from deviance difference comparing reported model with m = 2 model


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                             Linearity                               *****
*****                                test                                 *****
*****                                for                                  *****
*****                             depinr==2                               *****
*****                                and                                  *****
*****                            gender==male                             *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:28:35  *****
*******************************************************************************
*******************************************************************************


-------------
title2: testing
                                       Date and time:   2 Sep 2013    13:28:35
                                       Working directory:  /Users/robertyaffee/Documents/data/research/chwk/phase4/survival/wk
                                       Stata data file:  stdepress28aug2013c.dta  has  1868  variables and  1210  observations

testing
-------------
-> gen double Ichil__1 = childw-1.393258427 if e(sample)
-> gen double Ideaw__1 = deaw-.6853932584 if e(sample)
-> gen double Iillw__1 = illw-.6516853933 if e(sample)
-> gen double Ishre__1 = shrelaw-45.05617978 if e(sample)
-> gen double Isuch__1 = suchrw-42.68539326 if e(sample)
-> gen double Iskin__1 = skin-44.56179775 if e(sample)
-> gen double Iclou__1 = cloud-43.60674157 if e(sample)
-> gen double Iworl__1 = world-88.53932584 if e(sample)
-> gen double Iwoma__1 = woman-73.76404494 if e(sample)
-> gen double Igood__1 = goodrad-53.25842697 if e(sample)
-> gen double IWHPe__1 = WHPer-16.44764032 if e(sample)
-> gen double IWHPs__1 = WHPsociso-9.625618056 if e(sample)
-> gen double Ifdfe__1 = fdferw-29.1011236 if e(sample)
-> gen double Itrre__1 = trrepw-50.16853933 if e(sample)
-> gen double Idefn__1 = defnw-67.48314607 if e(sample)
-> gen double Iefra__1 = efradw-60.85393258 if e(sample)
-> gen double Iradw__1 = radw-46.73033708 if e(sample)
-> gen double Iradt__1 = radtlw-55.8988764 if e(sample)
-> gen double Iavgc__1 = avgcumdosew-1.512926955 if e(sample)
-> gen double Iperc__1 = percHlthRsk-69.1947563 if e(sample)
......
-> gen double Imarr__1 = X^-2 if e(sample)
-> gen double Imarr__2 = X^-2*ln(X) if e(sample)
   (where: X = (married+1))

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

note: Imarr__2 omitted because of collinearity
note: occ7w omitted because of collinearity
Iteration 0:   log pseudolikelihood = -274.97545
Iteration 1:   log pseudolikelihood = -254.63958
Iteration 2:   log pseudolikelihood = -248.66163
Iteration 3:   log pseudolikelihood = -248.62768
Iteration 4:   log pseudolikelihood = -248.62764
Refining estimates:
Iteration 0:   log pseudolikelihood = -248.62764

Cox regression -- Breslow method for ties

No. of subjects      =           89                Number of obs   =        89
No. of failures      =           89
Time at risk         =         1341
                                                   Wald chi2(31)   =    146.13
Log pseudolikelihood =   -248.62764                Prob > chi2     =    0.0000

(Std. Err. adjusted for 89 clusters in id)
-------------+----------------------------------------------------------------
             |               Robust
           _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    Imarr__1 |    1.640393    .6477814      1.25    0.210      .7565082     3.556987
    Imarr__2 |           1   (omitted)
    Ichil__1 |    .9394909    .1282606     -0.46    0.648      .7189279     1.227721
       occ1w |    3.547598    1.529694      2.94    0.003      1.523714      8.25972
       occ2w |    2.589353    1.178773      2.09    0.037      1.060942     6.319617
       occ3w |    2.627231      1.4618      1.74    0.083      .8828495     7.818254
       occ4w |    1.872389    .6853134      1.71    0.087      .9137923     3.836582
       occ5w |    3.473486    1.701901      2.54    0.011      1.329545     9.074612
       occ6w |    39.55657    30.52929      4.77    0.000       8.71508     179.5419
       occ7w |           1   (omitted)
    Ideaw__1 |    1.210711    .1430863      1.62    0.106      .9603784     1.526296
       dvcew |    .2081426    .1143754     -2.86    0.004       .070896     .6110835
       cataw |    1.619673    .9101194      0.86    0.391      .5384237     4.872263
    Iillw__1 |    1.141966    .1130805      1.34    0.180      .9405137     1.386569
    Ishre__1 |    .9998732    .0035333     -0.04    0.971       .992972     1.006822
    Isuch__1 |    1.005931    .0034111      1.74    0.081      .9992681     1.012639
    Iskin__1 |    .9993541     .003388     -0.19    0.849      .9927358     1.006016
    Iclou__1 |    .9956976    .0031252     -1.37    0.170      .9895911     1.001842
    Iworl__1 |    1.010438    .0064094      1.64    0.102      .9979536     1.023079
    Iwoma__1 |    .9999179    .0049711     -0.02    0.987       .990222     1.009709
    Igood__1 |    .9943484    .0040122     -1.40    0.160      .9865156     1.002243
    IWHPe__1 |    1.008063    .0085974      0.94    0.346      .9913524     1.025055
    IWHPs__1 |    1.002952     .007794      0.38    0.704      .9877915     1.018345
    Ifdfe__1 |    1.011186    .0046781      2.40    0.016      1.002058     1.020396
    Itrre__1 |    1.009538    .0044589      2.15    0.032      1.000837     1.018316
    Idefn__1 |     1.00014    .0050145      0.03    0.978      .9903596     1.010017
    Iefra__1 |    1.005487    .0033818      1.63    0.104       .998881     1.012138
    Iradw__1 |     1.00399    .0032195      1.24    0.214      .9976997      1.01032
    Iradt__1 |    .9984762      .00315     -0.48    0.629      .9923214     1.004669
    Iavgc__1 |    1.082898    .0244214      3.53    0.000      1.036075     1.131837
    Iperc__1 |    .9941615    .0052061     -1.12    0.263        .98401     1.004418
 fcrisis2008 |    .1039093    .0489328     -4.81    0.000      .0412865     .2615174
       y2009 |     2.32029    1.427661      1.37    0.171      .6947084     7.749645
-------------+----------------------------------------------------------------
Deviance:   497.26. Best powers of married among 27 models fit: -2 -2.

Fractional polynomial model comparisons:
---------------------------------------------------------------
married          df       Deviance   Dev. dif.  P (*)  Powers
---------------------------------------------------------------
Not in model      0        497.982     0.727    0.948
Linear            1        497.255     0.000    1.000  1
m = 1             2        497.255     0.000    1.000  -2
m = 2             4        497.255        --       --  -2 -2
---------------------------------------------------------------
(*) P-value from deviance difference comparing reported model with m = 2 model


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                             Linearity                               *****
*****                                test                                 *****
*****                                for                                  *****
*****                             depinr==3                               *****
*****                                and                                  *****
*****                            gender==male                             *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:29:09  *****
*******************************************************************************
*******************************************************************************


-------------
title2: testing
                                       Date and time:   2 Sep 2013    13:29:09
                                       Working directory:  /Users/robertyaffee/Documents/data/research/chwk/phase4/survival/wk
                                       Stata data file:  stdepress28aug2013c.dta  has  1868  variables and  1210  observations

testing
-------------
-> gen double Ichil__1 = childw-1.568627451 if e(sample)
-> gen double Ideaw__1 = deaw-.6470588235 if e(sample)
-> gen double Iillw__1 = illw-1.431372549 if e(sample)
-> gen double Ishre__1 = shrelaw-44.11764706 if e(sample)
-> gen double Isuch__1 = suchrw-60.58823529 if e(sample)
-> gen double Iskin__1 = skin-48.7254902 if e(sample)
-> gen double Iclou__1 = cloud-55.68627451 if e(sample)
-> gen double Iworl__1 = world-93.1372549 if e(sample)
-> gen double Iwoma__1 = woman-80.39215686 if e(sample)
-> gen double Igood__1 = goodrad-50.19607843 if e(sample)
-> gen double IWHPe__1 = WHPer-17.27294102 if e(sample)
-> gen double IWHPs__1 = WHPsociso-13.01490204 if e(sample)
-> gen double Ifdfe__1 = fdferw-21.66666667 if e(sample)
-> gen double Itrre__1 = trrepw-49.01960784 if e(sample)
-> gen double Idefn__1 = defnw-72.94117647 if e(sample)
-> gen double Iefra__1 = efradw-58.82352941 if e(sample)
-> gen double Iradw__1 = radw-47.15686275 if e(sample)
-> gen double Iradt__1 = radtlw-54.74509804 if e(sample)
-> gen double Iavgc__1 = avgcumdosew-2.200521563 if e(sample)
-> gen double Iperc__1 = percHlthRsk-74.57516319 if e(sample)
......
-> gen double Imarr__1 = X^-1 if e(sample)
-> gen double Imarr__2 = X^-1*ln(X) if e(sample)
   (where: X = (married+1))

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

note: Imarr__2 omitted because of collinearity
note: occ7w omitted because of collinearity
Iteration 0:   log pseudolikelihood = -131.42926
Iteration 1:   log pseudolikelihood = -107.21927
Iteration 2:   log pseudolikelihood = -102.08076
Iteration 3:   log pseudolikelihood = -101.69862
Iteration 4:   log pseudolikelihood = -101.68551
Iteration 5:   log pseudolikelihood = -101.68547
Refining estimates:
Iteration 0:   log pseudolikelihood = -101.68547

Cox regression -- Breslow method for ties

No. of subjects      =           51                Number of obs   =        51
No. of failures      =           51
Time at risk         =          660
                                                   Wald chi2(31)   =    256.94
Log pseudolikelihood =   -101.68547                Prob > chi2     =    0.0000

(Std. Err. adjusted for 51 clusters in id)
-------------+----------------------------------------------------------------
             |               Robust
           _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    Imarr__1 |    3.355191    6.281428      0.65    0.518      .0855339     131.6122
    Imarr__2 |           1   (omitted)
    Ichil__1 |    .6401114    .3589502     -0.80    0.426      .2132721      1.92122
       occ1w |    .7784421    .5925182     -0.33    0.742      .1751163     3.460398
       occ2w |    4.339465    4.238344      1.50    0.133      .6398376     29.43083
       occ3w |    .2532712    .3749578     -0.93    0.354      .0139129     4.610575
       occ4w |    5.743594    6.874508      1.46    0.144      .5500227      59.9773
       occ5w |     6.51351    6.992401      1.75    0.081      .7943847     53.40713
       occ6w |    11.75665    20.12115      1.44    0.150       .410656     336.5805
       occ7w |           1   (omitted)
    Ideaw__1 |    1.466366    .2954784      1.90    0.057      .9879209     2.176521
       dvcew |    .2259728    .3160413     -1.06    0.288      .0145741     3.503729
       cataw |    .0488005    .0800433     -1.84    0.066      .0019601     1.215004
    Iillw__1 |    .8693129      .10537     -1.16    0.248      .6854904     1.102429
    Ishre__1 |    .9808948    .0085924     -2.20    0.028      .9641977     .9978811
    Isuch__1 |    1.008119    .0047393      1.72    0.085      .9988733     1.017451
    Iskin__1 |    .9808377    .0111671     -1.70    0.089      .9591931     1.002971
    Iclou__1 |    .9832873     .007781     -2.13    0.033      .9681545     .9986566
    Iworl__1 |    1.019643    .0088584      2.24    0.025      1.002428     1.037154
    Iwoma__1 |    .9845866    .0118981     -1.29    0.199      .9615407     1.008185
    Igood__1 |     1.00745    .0122592      0.61    0.542      .9837072     1.031767
    IWHPe__1 |     1.02079    .0130706      1.61    0.108      .9954914     1.046732
    IWHPs__1 |    .9909726    .0092025     -0.98    0.329      .9730991     1.009174
    Ifdfe__1 |    .9884335    .0096946     -1.19    0.236      .9696139     1.007618
    Itrre__1 |     1.00474     .006138      0.77    0.439      .9927816     1.016843
    Idefn__1 |    .9981599    .0067727     -0.27    0.786      .9849736     1.011523
    Iefra__1 |    1.009345    .0055137      1.70    0.089       .998596      1.02021
    Iradw__1 |    1.001392    .0076511      0.18    0.856      .9865077     1.016501
    Iradt__1 |    .9748101    .0123722     -2.01    0.044      .9508601     .9993632
    Iavgc__1 |    1.052521    .0435144      1.24    0.216       .970598     1.141358
    Iperc__1 |    1.007501    .0128561      0.59    0.558      .9826156     1.033016
 fcrisis2008 |    .0037183    .0091539     -2.27    0.023      .0000298     .4633142
       y2009 |    .2357375    .2693197     -1.26    0.206      .0251171     2.212528
-------------+----------------------------------------------------------------
Deviance:   203.37. Best powers of married among 27 models fit: -1 -1.

Fractional polynomial model comparisons:
---------------------------------------------------------------
married          df       Deviance   Dev. dif.  P (*)  Powers
---------------------------------------------------------------
Not in model      0        203.744     0.373    0.985
Linear            1        203.371     0.000    1.000  1
m = 1             2        203.371     0.000    1.000  -1
m = 2             4        203.371        --       --  -1 -1
---------------------------------------------------------------
(*) P-value from deviance difference comparing reported model with m = 2 model

.       sort id date

. title Trimm1  male cox regression (at .15)


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                               Trimm1                                *****
*****                                male                                 *****
*****                                cox                                  *****
*****                             regression                              *****
*****                                (at                                  *****
*****                                .15)                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:29:44  *****
*******************************************************************************
*******************************************************************************


.         set more off

.         stcox i.agegp i.marrw  childw i.emplw occ1w-occ7w  ///
>      deaw dvcew  ///
>          cataw illw shrelaw suchrw  ///
>           skin cloud world woman goodrad WHPer WHPsociso ///
>           fdferw  trrepw defnw efradw radw radtlw i.cumdosewgp i.percRiskgp ///
>       fcrisis2008 y2009 ///
>           if gender==1 , nolog vce(robust)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Cox regression -- Breslow method for ties

No. of subjects      =          291                Number of obs   =       483
No. of failures      =          370
Time at risk         =        13382
                                                   Wald chi2(42)   =    774.16
Log pseudolikelihood =   -1685.4131                Prob > chi2     =    0.0000

(Std. Err. adjusted for 291 clusters in id)
-----------------+----------------------------------------------------------------
                 |               Robust
               _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-----------------+----------------------------------------------------------------
           agegp |
     43 thru 55  |    1.694685    .2714265      3.29    0.001      1.238106     2.319639
     56 thru 84  |    1.691796    .3158607      2.82    0.005       1.17335     2.439319
                 |
           marrw |
2. cohabitating  |    .5548428     .168171     -1.94    0.052      .3063187     1.005001
     3. married  |    1.126473    .2244453      0.60    0.550      .7622939     1.664636
   4. separated  |    1.455848    .9587145      0.57    0.568      .4004765     5.292427
    5. divorced  |    .5557994    .1696866     -1.92    0.054      .3055234     1.011094
     6. widowed  |    1.131849    .3867733      0.36    0.717      .5793185      2.21136
                 |
          childw |    .8980977     .062947     -1.53    0.125      .7828229     1.030347
                 |
           emplw |
   2. part time  |    .9003827    .1404537     -0.67    0.501      .6632013     1.222388
     4. retired  |    2.508918    1.313514      1.76    0.079       .899187     7.000401
  5. unemployed  |     2.05844    1.151538      1.29    0.197      .6876334      6.16197
                 |
           occ1w |    1.527947    .7609663      0.85    0.395      .5756823     4.055401
           occ2w |    1.422152    .7163187      0.70    0.484      .5299161     3.816671
           occ3w |    1.641637    .8198403      0.99    0.321      .6168555     4.368886
           occ4w |    .9496114    .4846781     -0.10    0.919      .3492174     2.582236
           occ5w |    1.103677    .5530067      0.20    0.844      .4133709     2.946753
           occ6w |     10.8681    6.664419      3.89    0.000      3.267297     36.15083
           occ7w |    .4240763    .1342235     -2.71    0.007       .228051     .7885987
            deaw |    1.205016    .0813142      2.76    0.006      1.055732     1.375408
           dvcew |    1.612456    .4974436      1.55    0.121       .880829      2.95178
           cataw |    1.681045    .3069383      2.84    0.004      1.175331     2.404354
            illw |    1.199229     .059434      3.67    0.000      1.088219     1.321563
         shrelaw |    1.001956    .0014995      1.31    0.192      .9990211     1.004899
          suchrw |    .9967589    .0015916     -2.03    0.042      .9936442     .9998832
            skin |    1.002983    .0015289      1.95    0.051      .9999906     1.005984
           cloud |    .9995206    .0015023     -0.32    0.750      .9965804     1.002469
           world |    .9997084    .0025444     -0.11    0.909      .9947338     1.004708
           woman |    1.003902    .0024043      1.63    0.104      .9992011     1.008626
         goodrad |     1.00281    .0017916      1.57    0.116      .9993049     1.006328
           WHPer |    1.015917    .0039688      4.04    0.000      1.008168     1.023726
       WHPsociso |    1.010703    .0028282      3.80    0.000      1.005175     1.016261
          fdferw |    1.006066    .0019984      3.04    0.002      1.002157      1.00999
          trrepw |    1.004693    .0016406      2.87    0.004      1.001482     1.007913
           defnw |    .9969795    .0018941     -1.59    0.111       .993274     1.000699
          efradw |    1.007074    .0016939      4.19    0.000      1.003759     1.010399
            radw |    1.003072    .0017224      1.79    0.074      .9997022     1.006454
          radtlw |    1.003906     .001765      2.22    0.027      1.000453     1.007372
                 |
      cumdosewgp |
           high  |    .9804647    .1071269     -0.18    0.857      .7914593     1.214606
                 |
      percRiskgp |
         medium  |    .9368478    .1261723     -0.48    0.628      .7195009     1.219851
           high  |    .8314913    .1270496     -1.21    0.227       .616306     1.121809
                 |
     fcrisis2008 |    .3094209    .0559315     -6.49    0.000      .2171125     .4409755
           y2009 |     .321144    .0623403     -5.85    0.000      .2195154     .4698234
-----------------+----------------------------------------------------------------

.           estat phtest

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |                      chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      global test |                    117.08       42         0.0000
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

.           estat phtest, detail

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |       rho            chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      0b.agegp    |            .            .        1             .
      1.agegp     |     -0.05536         0.77        1         0.3796
      2.agegp     |     -0.14948         6.17        1         0.0130
      1b.marrw    |            .            .        1             .
      2.marrw     |      0.03156         0.28        1         0.5964
      3.marrw     |      0.08650         2.29        1         0.1303
      4.marrw     |      0.08716         2.52        1         0.1121
      5.marrw     |      0.15177         8.30        1         0.0040
      6.marrw     |      0.09737         1.86        1         0.1732
      childw      |      0.02765         0.19        1         0.6659
      1b.emplw    |            .            .        1             .
      2.emplw     |     -0.07667         3.06        1         0.0803
      4.emplw     |     -0.06991         2.27        1         0.1318
      5.emplw     |     -0.08875         4.32        1         0.0377
      occ1w       |     -0.09151         3.80        1         0.0514
      occ2w       |     -0.09932         4.71        1         0.0300
      occ3w       |     -0.07646         2.82        1         0.0931
      occ4w       |     -0.06682         2.00        1         0.1575
      occ5w       |     -0.06149         1.78        1         0.1818
      occ6w       |     -0.08212         2.99        1         0.0837
      occ7w       |      0.00469         0.00        1         0.9465
      deaw        |     -0.12441         8.04        1         0.0046
      dvcew       |      0.00122         0.00        1         0.9842
      cataw       |      0.13573         4.90        1         0.0269
      illw        |     -0.04728         0.77        1         0.3799
      shrelaw     |     -0.13771         5.40        1         0.0201
      suchrw      |      0.09007         2.26        1         0.1326
      skin        |     -0.02834         0.25        1         0.6137
      cloud       |      0.00628         0.01        1         0.9154
      world       |      0.02367         0.19        1         0.6657
      woman       |      0.01542         0.05        1         0.8176
      goodrad     |      0.00828         0.02        1         0.8945
      WHPer       |      0.05265         1.06        1         0.3035
      WHPsociso   |      0.02147         0.21        1         0.6492
      fdferw      |      0.02093         0.13        1         0.7145
      trrepw      |     -0.09098         2.18        1         0.1396
      defnw       |      0.13405         5.98        1         0.0145
      efradw      |     -0.15557         6.94        1         0.0084
      radw        |     -0.13229         3.62        1         0.0572
      radtlw      |     -0.03337         0.32        1         0.5739
      0b.cumdose~p |           .            .        1             .
      1.cumdosewgp |    -0.01426         0.06        1         0.8006
      0b.percRis~p |           .            .        1             .
      1.percRiskgp |     0.04705         0.85        1         0.3578
      2.percRiskgp |     0.05823         1.44        1         0.2308
      fcrisis2008 |     -0.25869        20.17        1         0.0000
      y2009       |     -0.17560        16.20        1         0.0001
      ------------+---------------------------------------------------
      global test |                    117.08       42         0.0000
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

.           cap predict bsurv, basesurv

.           stcurve, hazard

.           cap predict hr, hr"

.           stphplot if depinr < 3, xline(3.95 4.56 4.58) by(depinr) title("Male recurrent survival probability by ln(time)")  ///
>             text(-1.2 3.94 "1986 Chornobyl" .25 4.55 "2008 financial crisis" 1.2 4.57 "2009 Russian gas-shutoff" , ///
>                 orientation(vertical)) ///
>            caption(depinr=depression episode number)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

.           graph save mcrreehasurv.gph, replace
(file mcrreehasurv.gph saved)

.           graph export mcrreehasurv.eps, replace
(file mcrreehasurv.eps written in EPS format)

.
.           cap  predict rescsm, csnell

.         sts graph, haz xline(52)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

.         stcurve, hazard  at1(y2009=0) at2(y2009=1)

.         stcurve, hazard  at1(percRiskgp=0) at2(percRiskgp=1) at3(percRiskgp=2)

.         stpower cox, hr


Estimated sample size for Cox PH regression


Wald test, hazard metric


Ho: [b1, b2, ..., bp] = [0, b2, ..., bp]

Input parameters:

alpha =      0.0500  (two sided)
hratio =      0.5000
sd =      0.5000
power =      0.8000


Estimated number of events and sample size:


E =          66
N =          66

.
.
. title Final cox regression male model


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                               Final                                 *****
*****                                cox                                  *****
*****                             regression                              *****
*****                                male                                 *****
*****                               model                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:29:55  *****
*******************************************************************************
*******************************************************************************


.
.                 * The male model episode one
. set more off

. title(Trimmed at .10)


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                              (Trimmed                               *****
*****                                 at                                  *****
*****                                .10)                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:29:55  *****
*******************************************************************************
*******************************************************************************


.         stcox i.agegp married childw i.emplw occ6w  ///
>      deaw  accdw ///
>          cataw illw movew shfamw shhlw  ///
>           skin woman  chsize WHPel-WHPer WHPsociso ///
>           fdferw  trrepw-efradw radw radtlw i.cumdosewgp i.percRiskgp ///
>       fcrisis2008 y2009 if gender==1 & depinr==1, nolog nohr vce(robust)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Cox regression -- Breslow method for ties

No. of subjects      =          178                Number of obs   =       178
No. of failures      =          178
Time at risk         =         4145
                                                   Wald chi2(33)   =    197.52
Log pseudolikelihood =   -710.67787                Prob > chi2     =    0.0000

(Std. Err. adjusted for 178 clusters in id)
---------------+----------------------------------------------------------------
               |               Robust
             _t |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
---------------+----------------------------------------------------------------
         agegp |
   43 thru 55  |    .2836174    .1736328      1.63    0.102     -.0566967     .6239315
   56 thru 84  |    .9111027    .2423063      3.76    0.000      .4361911     1.386014
               |
       married |    .2541273    .1906836      1.33    0.183     -.1196057     .6278603
        childw |   -.2663521    .1193671     -2.23    0.026     -.5003072    -.0323969
               |
         emplw |
 2. part time  |   -.3726477    .2120071     -1.76    0.079      -.788174     .0428786
   4. retired  |   -.6205321    .2732427     -2.27    0.023     -1.156078    -.0849861
5. unemployed  |   -.2013336    .3755571     -0.54    0.592     -.9374121     .5347448
               |
         occ6w |    2.929126    .5062051      5.79    0.000      1.936982     3.921269
          deaw |    .0304455    .0747731      0.41    0.684     -.1161071     .1769982
         accdw |   -.0204912    .1928885     -0.11    0.915     -.3985458     .3575634
         cataw |    .8457315    .3282704      2.58    0.010      .2023333      1.48913
          illw |    .0304055    .0960418      0.32    0.752     -.1578331      .218644
         movew |    .1717913    .1456127      1.18    0.238     -.1136044      .457187
        shfamw |   -.0018125    .0017373     -1.04    0.297     -.0052177     .0015926
         shhlw |   -.0017796    .0019401     -0.92    0.359     -.0055821      .002023
          skin |   -.0025759    .0020072     -1.28    0.199     -.0065099     .0013581
         woman |    .0059083    .0028317      2.09    0.037      .0003583     .0114582
        chsize |    .0046126    .0035673      1.29    0.196     -.0023792     .0116044
         WHPel |    .0031227    .0027267      1.15    0.252     -.0022215     .0084669
       WHPpain |    -.003744    .0058885     -0.64    0.525     -.0152853     .0077973
         WHPer |    .0022314     .007272      0.31    0.759     -.0120215     .0164842
     WHPsociso |    .0057961    .0044997      1.29    0.198     -.0030231     .0146154
        fdferw |    .0081007    .0025308      3.20    0.001      .0031405     .0130609
        trrepw |    .0108016     .002487      4.34    0.000      .0059272      .015676
         defnw |   -.0055499    .0027671     -2.01    0.045     -.0109734    -.0001264
        efradw |    .0106361     .002135      4.98    0.000      .0064516     .0148206
          radw |    .0061607    .0023567      2.61    0.009      .0015416     .0107798
        radtlw |   -.0002614    .0019426     -0.13    0.893     -.0040688      .003546
               |
    cumdosewgp |
         high  |    -.150943    .1475106     -1.02    0.306     -.4400583     .1381724
               |
    percRiskgp |
       medium  |   -.4842373    .2111034     -2.29    0.022     -.8979922    -.0704823
         high  |   -.2626484    .2252747     -1.17    0.244     -.7041786     .1788818
               |
   fcrisis2008 |   -1.348235    .3064838     -4.40    0.000     -1.948932    -.7475377
         y2009 |    .9884596    .3473226      2.85    0.004      .3077198       1.6692
---------------+----------------------------------------------------------------

.           est store mcoxregepi1

.           local NR2 1 - (exp(-2*(e(ll)-e(ll_0))/e(N_sub)))

.           di "NR2 = ",`NR2'
NR2 =  .46414096

.           estadd scalar NR2 = `NR2'

added scalar:
                e(NR2) =  .46414096

.           estat phtest, detail

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |       rho            chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      0b.agegp    |            .            .        1             .
      1.agegp     |     -0.28552        15.21        1         0.0001
      2.agegp     |      0.01199         0.03        1         0.8567
      married     |     -0.06278         0.87        1         0.3522
      childw      |     -0.08008         1.70        1         0.1919
      1b.emplw    |            .            .        1             .
      2.emplw     |     -0.16545         4.34        1         0.0372
      4.emplw     |     -0.02079         0.10        1         0.7565
      5.emplw     |     -0.12756         3.50        1         0.0613
      occ6w       |      0.18973         7.52        1         0.0061
      deaw        |      0.00769         0.01        1         0.9139
      accdw       |     -0.13725         3.64        1         0.0564
      cataw       |      0.04607         0.41        1         0.5226
      illw        |      0.17214         4.94        1         0.0262
      movew       |      0.00911         0.02        1         0.8921
      shfamw      |      0.08949         1.35        1         0.2450
      shhlw       |      0.01976         0.08        1         0.7724
      skin        |     -0.04985         0.44        1         0.5056
      woman       |      0.03262         0.22        1         0.6427
      chsize      |      0.06538         0.92        1         0.3365
      WHPel       |      0.02426         0.18        1         0.6752
      WHPpain     |     -0.06295         0.79        1         0.3747
      WHPer       |     -0.02349         0.15        1         0.6975
      WHPsociso   |      0.14144         3.50        1         0.0613
      fdferw      |      0.08287         1.57        1         0.2102
      trrepw      |      0.02223         0.09        1         0.7642
      defnw       |     -0.02710         0.16        1         0.6885
      efradw      |     -0.01536         0.03        1         0.8672
      radw        |      0.09318         1.23        1         0.2669
      radtlw      |     -0.09795         1.94        1         0.1639
      0b.cumdose~p |           .            .        1             .
      1.cumdosewgp |     0.12510         1.95        1         0.1621
      0b.percRis~p |           .            .        1             .
      1.percRiskgp |     0.03604         0.44        1         0.5073
      2.percRiskgp |     0.11184         2.87        1         0.0905
      fcrisis2008 |     -0.12897         2.61        1         0.1061
      y2009       |     -0.24474        10.61        1         0.0011
      ------------+---------------------------------------------------
      global test |                     75.63       33         0.0000
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

.           estat phtest

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |                      chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      global test |                     75.63       33         0.0000
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

.           stcurve, hazard  at1(y2009=0) at2(y2009=1) title(Male hazard in episode 1 in year 2009)

.           stcurve, hazard  at1(percRiskgp=0) at2(percRiskgp=1) at3(percRiskgp=2) ///
>              title(Male hazard in episode 1 for level of perceived risk)

.
. est clear

.                         * The male model episode two
. set more off

. title(Trimmed at .10)


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                              (Trimmed                               *****
*****                                 at                                  *****
*****                                .10)                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:30:01  *****
*******************************************************************************
*******************************************************************************


.         stcox i.agegp married childw i.emplw occ6w  ///
>      deaw  accdw ///
>          cataw illw movew shfamw shhlw  ///
>           skin woman  chsize WHPel-WHPer WHPsociso ///
>           fdferw  trrepw-efradw radw radtlw i.cumdosewgp i.percRiskgp ///
>       fcrisis2008 y2009 if gender==1 & depinr == 2, nolog nohr vce(robust)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Cox regression -- Breslow method for ties

No. of subjects      =           89                Number of obs   =        89
No. of failures      =           89
Time at risk         =         1341
                                                   Wald chi2(33)   =    160.41
Log pseudolikelihood =   -242.44947                Prob > chi2     =    0.0000

(Std. Err. adjusted for 89 clusters in id)
---------------+----------------------------------------------------------------
               |               Robust
             _t |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
---------------+----------------------------------------------------------------
         agegp |
   43 thru 55  |    .5971981    .3184146      1.88    0.061     -.0268831     1.221279
   56 thru 84  |    .8974607    .3103293      2.89    0.004      .2892265     1.505695
               |
       married |   -.0527819    .2739972     -0.19    0.847     -.5898066     .4842428
        childw |   -.3090231    .1545395     -2.00    0.046     -.6119149    -.0061312
               |
         emplw |
 2. part time  |    .6246591    .3096024      2.02    0.044      .0178495     1.231469
   4. retired  |   -.8912639    .3567783     -2.50    0.012     -1.590537    -.1919913
5. unemployed  |    -1.21542    .5813912     -2.09    0.037     -2.354926    -.0759139
               |
         occ6w |    2.350151    .6368333      3.69    0.000       1.10198     3.598321
          deaw |    .1599767    .1448374      1.10    0.269     -.1238994     .4438527
         accdw |    .1124141    .2956617      0.38    0.704     -.4670722     .6919004
         cataw |    .2375506    .8154059      0.29    0.771     -1.360616     1.835717
          illw |    .1401114    .1254943      1.12    0.264     -.1058528     .3860757
         movew |   -.5872783    .2202989     -2.67    0.008     -1.019056    -.1555003
        shfamw |   -.0119568     .003189     -3.75    0.000      -.018207    -.0057065
         shhlw |    .0108796    .0042811      2.54    0.011      .0024888     .0192704
          skin |    .0026422    .0040692      0.65    0.516     -.0053333     .0106177
         woman |    .0018899    .0039103      0.48    0.629     -.0057741     .0095539
        chsize |    .0007167    .0041532      0.17    0.863     -.0074234     .0088567
         WHPel |   -.0039771    .0041754     -0.95    0.341     -.0121608     .0042066
       WHPpain |    .0033505     .010558      0.32    0.751     -.0173429     .0240439
         WHPer |    .0228451    .0099847      2.29    0.022      .0032755     .0424147
     WHPsociso |    .0099825      .01081      0.92    0.356     -.0112047     .0311698
        fdferw |    .0057231    .0056128      1.02    0.308     -.0052778      .016724
        trrepw |    .0096792    .0038983      2.48    0.013      .0020387     .0173197
         defnw |   -.0045094    .0048463     -0.93    0.352     -.0140079     .0049891
        efradw |    .0091297    .0038205      2.39    0.017      .0016416     .0166177
          radw |    .0038457    .0043952      0.87    0.382     -.0047688     .0124602
        radtlw |    .0026102    .0043776      0.60    0.551     -.0059698     .0111901
               |
    cumdosewgp |
         high  |    .1132606    .2702529      0.42    0.675     -.4164253     .6429465
               |
    percRiskgp |
       medium  |    .0762102    .3204734      0.24    0.812     -.5519062     .7043265
         high  |   -.7337439    .3211644     -2.28    0.022     -1.363215    -.1042732
               |
   fcrisis2008 |   -1.934026    .5157066     -3.75    0.000     -2.944792    -.9232592
         y2009 |    .8849341    .5199195      1.70    0.089     -.1340893     1.903957
---------------+----------------------------------------------------------------

.           est store mcoxregepi2

.           local NR2 1 - (exp(-2*(e(ll)-e(ll_0))/e(N_sub)))

.           di "NR2 = ",`NR2'
NR2 =  .51853461

.           estadd scalar NR2 = `NR2'

added scalar:
                e(NR2) =  .51853461

.           estat phtest, detail

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |       rho            chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      0b.agegp    |            .            .        1             .
      1.agegp     |      0.04431         0.31        1         0.5793
      2.agegp     |     -0.11404         0.83        1         0.3629
      married     |      0.05963         0.37        1         0.5429
      childw      |     -0.06779         0.70        1         0.4043
      1b.emplw    |            .            .        1             .
      2.emplw     |     -0.16515         4.92        1         0.0266
      4.emplw     |     -0.07803         0.70        1         0.4036
      5.emplw     |     -0.05785         0.36        1         0.5469
      occ6w       |     -0.14301         3.79        1         0.0515
      deaw        |     -0.07564         1.19        1         0.2752
      accdw       |     -0.15690         5.88        1         0.0153
      cataw       |     -0.17397         6.42        1         0.0113
      illw        |     -0.05992         0.70        1         0.4014
      movew       |     -0.26041         7.46        1         0.0063
      shfamw      |      0.04472         0.22        1         0.6388
      shhlw       |      0.19245        11.12        1         0.0009
      skin        |      0.22751        13.96        1         0.0002
      woman       |     -0.00095         0.00        1         0.9927
      chsize      |     -0.19583         4.79        1         0.0287
      WHPel       |     -0.14310         2.84        1         0.0920
      WHPpain     |     -0.06514         0.72        1         0.3966
      WHPer       |     -0.08550         1.26        1         0.2611
      WHPsociso   |      0.21524        11.33        1         0.0008
      fdferw      |     -0.12876         5.54        1         0.0186
      trrepw      |     -0.05813         0.27        1         0.6016
      defnw       |      0.11940         2.15        1         0.1428
      efradw      |     -0.08219         1.26        1         0.2617
      radw        |     -0.12884         2.44        1         0.1186
      radtlw      |      0.13812         4.08        1         0.0433
      0b.cumdose~p |           .            .        1             .
      1.cumdosewgp |     0.05655         0.44        1         0.5083
      0b.percRis~p |           .            .        1             .
      1.percRiskgp |     0.07665         0.92        1         0.3387
      2.percRiskgp |    -0.06541         0.48        1         0.4874
      fcrisis2008 |     -0.07848         0.63        1         0.4278
      y2009       |     -0.10943         2.12        1         0.1450
      ------------+---------------------------------------------------
      global test |                     29.70       33         0.6323
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

.           estat phtest

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |                      chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      global test |                     29.70       33         0.6323
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

.           stcurve, hazard  at1(y2009=0) at2(y2009=1) title(Male hazard in episode 2 in year 2009)

.           stcurve, hazard  at1(percRiskgp=0) at2(percRiskgp=1) at3(percRiskgp=2) ///
>              title(Male hazard in episode 2 for level of perceived risk)

.
.           set more off

.
.
.                 * Male model episode 3   probably insufficient power
. set more off

. title(Trimmed at .10)


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                              (Trimmed                               *****
*****                                 at                                  *****
*****                                .10)                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:30:06  *****
*******************************************************************************
*******************************************************************************


.         stcox i.agegp married childw i.emplw occ6w  ///
>      deaw  accdw ///
>          cataw illw movew shfamw shhlw  ///
>           skin woman  chsize WHPel-WHPer WHPsociso ///
>           fdferw  trrepw-efradw radw radtlw i.cumdosewgp i.percRiskgp ///
>       fcrisis2008 y2009 if gender==1 & depinr == 3, nolog nohr vce(robust)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Cox regression -- Breslow method for ties

No. of subjects      =           51                Number of obs   =        51
No. of failures      =           51
Time at risk         =          660
                                                   Wald chi2(33)   =    232.43
Log pseudolikelihood =   -100.69623                Prob > chi2     =    0.0000

(Std. Err. adjusted for 51 clusters in id)
---------------+----------------------------------------------------------------
               |               Robust
             _t |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
---------------+----------------------------------------------------------------
         agegp |
   43 thru 55  |    1.245363    .8808172      1.41    0.157     -.4810064     2.971733
   56 thru 84  |    2.305958    1.196751      1.93    0.054     -.0396309     4.651548
               |
       married |   -.0653013    .7711526     -0.08    0.933     -1.576733      1.44613
        childw |   -.5851302    .6472568     -0.90    0.366      -1.85373     .6834699
               |
         emplw |
 2. part time  |    .2950799    1.116937      0.26    0.792     -1.894077     2.484237
   4. retired  |   -.6230063     .571575     -1.09    0.276     -1.743273     .4972601
5. unemployed  |    1.200592    1.030085      1.17    0.244     -.8183372     3.219522
               |
         occ6w |    4.453866    2.921625      1.52    0.127     -1.272413     10.18015
          deaw |   -.0973418    .1500051     -0.65    0.516     -.3913464     .1966627
         accdw |     .721019    .2967374      2.43    0.015      .1394244     1.302614
         cataw |    -1.32875    .9411473     -1.41    0.158     -3.173365     .5158643
          illw |     .198124    .2020627      0.98    0.327     -.1979116     .5941596
         movew |     .252337    .4010786      0.63    0.529     -.5337626     1.038437
        shfamw |   -.0214378    .0085586     -2.50    0.012     -.0382123    -.0046633
         shhlw |   -.0086955    .0077148     -1.13    0.260     -.0238163     .0064253
          skin |   -.0196238    .0066633     -2.95    0.003     -.0326836     -.006564
         woman |   -.0130632    .0149089     -0.88    0.381     -.0422841     .0161576
        chsize |    .0335227    .0149609      2.24    0.025      .0041999     .0628455
         WHPel |    .0073594    .0080927      0.91    0.363      -.008502     .0232207
       WHPpain |   -.0189951    .0174598     -1.09    0.277     -.0532156     .0152254
         WHPer |    .0259378    .0193613      1.34    0.180     -.0120096     .0638853
     WHPsociso |    .0133445      .00895      1.49    0.136     -.0041971     .0308861
        fdferw |   -.0040284    .0097687     -0.41    0.680     -.0231746     .0151178
        trrepw |    .0034191    .0099866      0.34    0.732     -.0161542     .0229924
         defnw |    .0017767    .0108247      0.16    0.870     -.0194393     .0229928
        efradw |    .0155366    .0057253      2.71    0.007      .0043153      .026758
          radw |    .0160701    .0089371      1.80    0.072     -.0014463     .0335866
        radtlw |   -.0123112    .0067072     -1.84    0.066     -.0254571     .0008347
               |
    cumdosewgp |
         high  |   -.3112097    .4800637     -0.65    0.517     -1.252117     .6296978
               |
    percRiskgp |
       medium  |    .0587848    .6933334      0.08    0.932     -1.300124     1.417693
         high  |   -.3087738    .8404949     -0.37    0.713     -1.956114     1.338566
               |
   fcrisis2008 |   -4.078581    1.058213     -3.85    0.000     -6.152639    -2.004522
         y2009 |   -2.044896      1.7197     -1.19    0.234     -5.415446     1.325654
---------------+----------------------------------------------------------------

.           est store malespell3

.           local NR2 1 - (exp(-2*(e(ll)-e(ll_0))/e(N_sub)))

.           di "NR2 = ",`NR2'
NR2 =  .70037292

.           estadd scalar NR2 = `NR2'

added scalar:
                e(NR2) =  .70037292

.           estat phtest, detail

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |       rho            chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      0b.agegp    |            .            .        1             .
      1.agegp     |     -0.17389         6.40        1         0.0114
      2.agegp     |     -0.16418         6.59        1         0.0103
      married     |     -0.12761         2.32        1         0.1274
      childw      |      0.13873         4.47        1         0.0344
      1b.emplw    |            .            .        1             .
      2.emplw     |      0.00890         0.02        1         0.8995
      4.emplw     |      0.20157         6.25        1         0.0124
      5.emplw     |      0.01653         0.02        1         0.8785
      occ6w       |     -0.14355         5.80        1         0.0160
      deaw        |      0.17863         1.30        1         0.2535
      accdw       |     -0.06811         0.38        1         0.5369
      cataw       |      0.21936         7.84        1         0.0051
      illw        |     -0.15221         2.37        1         0.1235
      movew       |     -0.02861         0.08        1         0.7768
      shfamw      |      0.25606         6.35        1         0.0117
      shhlw       |      0.21072         5.99        1         0.0144
      skin        |      0.08809         0.88        1         0.3473
      woman       |      0.18315         2.45        1         0.1175
      chsize      |     -0.23871        10.41        1         0.0013
      WHPel       |      0.04726         0.21        1         0.6479
      WHPpain     |     -0.05666         0.51        1         0.4761
      WHPer       |      0.08784         0.99        1         0.3189
      WHPsociso   |     -0.15295         2.95        1         0.0857
      fdferw      |     -0.17525         2.58        1         0.1083
      trrepw      |      0.07995         1.03        1         0.3095
      defnw       |     -0.15784         2.45        1         0.1172
      efradw      |     -0.11241         1.66        1         0.1977
      radw        |     -0.27003        12.94        1         0.0003
      radtlw      |      0.05923         0.52        1         0.4707
      0b.cumdose~p |           .            .        1             .
      1.cumdosewgp |     0.07895         1.37        1         0.2424
      0b.percRis~p |           .            .        1             .
      1.percRiskgp |     0.12162         3.43        1         0.0641
      2.percRiskgp |     0.20022         9.11        1         0.0025
      fcrisis2008 |      0.17329         3.29        1         0.0696
      y2009       |      0.04132         0.53        1         0.4668
      ------------+---------------------------------------------------
      global test |                     19.98       33         0.9637
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

.           estat phtest

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |                      chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      global test |                     19.98       33         0.9637
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

.           stcurve, hazard  at1(y2009=0) at2(y2009=1) title(Male hazard in episode 3 in year 2009)

.           stcurve, hazard  at1(percRiskgp=0) at2(percRiskgp=1) at3(percRiskgp=2) ///
>              title(Male hazard in episode 3 for level of perceived risk)

.
. set more off

. estout *, cells(b(star fmt(3)) t(par fmt(2)) p(par fmt(3)))     ///
>       stats(NR2 ll_0 ll df_m risk N_sub N_fail, star ///
>           labels(Nagelkerke-R2 LL_0 LL num_x "time_at_risk_half_yrs" n_subjects n_depressed )) ///
>            starlevels(# .1 * .05 ** 0.01 *** 0.001) legend ///
>            mlabels("Malespell1" "Malespell2" "Malespell3") ///
>            varwidth(23) ///
>           title(Cox regression of male recurrent depression by spell number)

Cox regression of male recurrent depression by spell number
-------------------------------------------------------
                          Malespell1      Malespell2
                               b/t/p           b/t/p
-------------------------------------------------------
0b.agegp                       0.000           0.000
                                 (.)             (.)
                                 (.)             (.)
1.agegp                        0.597#          1.245
                              (1.88)          (1.41)
                             (0.061)         (0.157)
2.agegp                        0.897**         2.306#
                              (2.89)          (1.93)
                             (0.004)         (0.054)
married                       -0.053          -0.065
                             (-0.19)         (-0.08)
                             (0.847)         (0.933)
childw                        -0.309*         -0.585
                             (-2.00)         (-0.90)
                             (0.046)         (0.366)
1b.emplw                       0.000           0.000
                                 (.)             (.)
                                 (.)             (.)
2.emplw                        0.625*          0.295
                              (2.02)          (0.26)
                             (0.044)         (0.792)
4.emplw                       -0.891*         -0.623
                             (-2.50)         (-1.09)
                             (0.012)         (0.276)
5.emplw                       -1.215*          1.201
                             (-2.09)          (1.17)
                             (0.037)         (0.244)
occ6w                          2.350***        4.454
                              (3.69)          (1.52)
                             (0.000)         (0.127)
deaw                           0.160          -0.097
                              (1.10)         (-0.65)
                             (0.269)         (0.516)
accdw                          0.112           0.721*
                              (0.38)          (2.43)
                             (0.704)         (0.015)
cataw                          0.238          -1.329
                              (0.29)         (-1.41)
                             (0.771)         (0.158)
illw                           0.140           0.198
                              (1.12)          (0.98)
                             (0.264)         (0.327)
movew                         -0.587**         0.252
                             (-2.67)          (0.63)
                             (0.008)         (0.529)
shfamw                        -0.012***       -0.021*
                             (-3.75)         (-2.50)
                             (0.000)         (0.012)
shhlw                          0.011*         -0.009
                              (2.54)         (-1.13)
                             (0.011)         (0.260)
skin                           0.003          -0.020**
                              (0.65)         (-2.95)
                             (0.516)         (0.003)
woman                          0.002          -0.013
                              (0.48)         (-0.88)
                             (0.629)         (0.381)
chsize                         0.001           0.034*
                              (0.17)          (2.24)
                             (0.863)         (0.025)
WHPel                         -0.004           0.007
                             (-0.95)          (0.91)
                             (0.341)         (0.363)
WHPpain                        0.003          -0.019
                              (0.32)         (-1.09)
                             (0.751)         (0.277)
WHPer                          0.023*          0.026
                              (2.29)          (1.34)
                             (0.022)         (0.180)
WHPsociso                      0.010           0.013
                              (0.92)          (1.49)
                             (0.356)         (0.136)
fdferw                         0.006          -0.004
                              (1.02)         (-0.41)
                             (0.308)         (0.680)
trrepw                         0.010*          0.003
                              (2.48)          (0.34)
                             (0.013)         (0.732)
defnw                         -0.005           0.002
                             (-0.93)          (0.16)
                             (0.352)         (0.870)
efradw                         0.009*          0.016**
                              (2.39)          (2.71)
                             (0.017)         (0.007)
radw                           0.004           0.016#
                              (0.87)          (1.80)
                             (0.382)         (0.072)
radtlw                         0.003          -0.012#
                              (0.60)         (-1.84)
                             (0.551)         (0.066)
0b.cumdosewgp                  0.000           0.000
                                 (.)             (.)
                                 (.)             (.)
1.cumdosewgp                   0.113          -0.311
                              (0.42)         (-0.65)
                             (0.675)         (0.517)
0b.percRiskgp                  0.000           0.000
                                 (.)             (.)
                                 (.)             (.)
1.percRiskgp                   0.076           0.059
                              (0.24)          (0.08)
                             (0.812)         (0.932)
2.percRiskgp                  -0.734*         -0.309
                             (-2.28)         (-0.37)
                             (0.022)         (0.713)
fcrisis2008                   -1.934***       -4.079***
                             (-3.75)         (-3.85)
                             (0.000)         (0.000)
y2009                          0.885#         -2.045
                              (1.70)         (-1.19)
                             (0.089)         (0.234)
-------------------------------------------------------
Nagelkerke-R2                  0.519***        0.700***
LL_0                        -274.975        -131.429
LL                          -242.449        -100.696
num_x                         33.000          33.000
time_at_risk_half_yrs       1341.000         660.000
n_subjects                    89.000          51.000
n_depressed                   89.000          51.000
-------------------------------------------------------
# p<.1, * p<.05, ** p<0.01, *** p<0.001

. *---------------------------------------------------------------------------
.
. save stdep28aug2013, replace
file stdep28aug2013.dta saved

. use stdep28aug2013, clear

. est clear

.
. stset endepdate, id(id) failure(outcome==1) time0(startdate) exit(time .)

                id:  id
     failure event:  outcome == 1
obs. time interval:  (startdate, endepdate]
 exit on or before:  time .

------------------------------------------------------------------------------
     1210  total observations
        0  exclusions
------------------------------------------------------------------------------
     1210  observations remaining, representing
      683  subjects
      980  failures in multiple-failure-per-subject data
    29853  total analysis time at risk and under observation
                                              at risk from t =         0
                                   earliest observed entry t =        40
                                        last observed exit t =       101

.
.
. /* Nagelkerke(1991) R2  =   1 - exp(-X^2/n) where n= number of uncensored obs  */
. /* and X =  2(ll - ll_0)   P. Royston  Explained variation for survival analysis
> Stat Journal 2006 Vol 6 Number 1, 83-96     */
.
.
.
.
. est clear

.
. tab depinr if gender==2

 Depression |
    episode |
   sequence |
     number |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        100       14.62       14.62
          1 |        252       36.84       51.46
          2 |        132       19.30       70.76
          3 |         82       11.99       82.75
          4 |         49        7.16       89.91
          5 |         32        4.68       94.59
          6 |         20        2.92       97.51
          7 |         10        1.46       98.98
          8 |          6        0.88       99.85
          9 |          1        0.15      100.00
------------+-----------------------------------
      Total |        684      100.00

.
. title  Female models


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                               Female                                *****
*****                               models                                *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:30:12  *****
*******************************************************************************
*******************************************************************************


.          title Full female Cox Regression model trimmed at .15 with Major negative life events & stressors


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                                Full                                 *****
*****                               female                                *****
*****                                Cox                                  *****
*****                             Regression                              *****
*****                               model                                 *****
*****                              trimmed                                *****
*****                                 at                                  *****
*****                                .15                                  *****
*****                                with                                 *****
*****                               Major                                 *****
*****                              negative                               *****
*****                                life                                 *****
*****                               events                                *****
*****                                 &                                   *****
*****                             stressors                               *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:30:12  *****
*******************************************************************************
*******************************************************************************


. set more off

. stcox i.agegp  i.marrw  i.emplw   ///
>     inc1w inc2w inc3w  accdw ///
>          cataw illw  shjobw  shhlw shhousw  suprtw suchrw   ///
>          healthef carcin woman chsize icdxcnt WHPel  HP2vacatn ///
>          fdferw trrepw   ///
>          i.cumdosewgp i.percRiskgp fcrisis2008 y2009 ///
>          if gender==2 ,  nolog vce(robust)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Cox regression -- Breslow method for ties

No. of subjects      =          261                Number of obs   =       574
No. of failures      =          509
Time at risk         =        11557
                                                   Wald chi2(35)   =    667.62
Log pseudolikelihood =   -2278.6041                Prob > chi2     =    0.0000

(Std. Err. adjusted for 261 clusters in id)
-----------------+----------------------------------------------------------------
                 |               Robust
               _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-----------------+----------------------------------------------------------------
           agegp |
     43 thru 55  |    1.319787    .1668591      2.19    0.028       1.03012     1.690909
     56 thru 84  |    1.277959      .18687      1.68    0.093      .9595106     1.702097
                 |
           marrw |
2. cohabitating  |     .546087    .1607451     -2.06    0.040       .306693     .9723438
     3. married  |    .7181884    .1157604     -2.05    0.040      .5236468     .9850049
   4. separated  |    .3495469     .138422     -2.65    0.008      .1608519     .7595996
    5. divorced  |    .6639476     .141925     -1.92    0.055      .4366983     1.009453
     6. widowed  |    .3920647    .0840168     -4.37    0.000      .2576031     .5967115
                 |
           emplw |
   2. part time  |    .7202066     .119249     -1.98    0.047      .5206172     .9963127
     4. retired  |    .8995851    .1263761     -0.75    0.451      .6830668     1.184735
  5. unemployed  |    .8463326    .1595816     -0.88    0.376      .5848459     1.224731
                 |
           inc1w |    1.932425     .570258      2.23    0.026      1.083711     3.445815
           inc2w |    2.053202    .5907004      2.50    0.012       1.16827     3.608444
           inc3w |    1.959916    .5877143      2.24    0.025      1.088905     3.527644
           accdw |     1.17557    .1006607      1.89    0.059      .9939449     1.390383
           cataw |    1.606102       .3341      2.28    0.023      1.068334     2.414568
            illw |    1.034917    .0395317      0.90    0.369      .9602654     1.115371
          shjobw |    1.000991    .0015369      0.65    0.519      .9979837     1.004008
           shhlw |    1.004601     .001656      2.78    0.005       1.00136     1.007852
         shhousw |    1.003236    .0012398      2.61    0.009      1.000809     1.005669
          suprtw |    .9942585    .0013628     -4.20    0.000       .991591     .9969332
          suchrw |    1.002657    .0011566      2.30    0.021      1.000392     1.004926
        healthef |    .9779286    .0075385     -2.90    0.004      .9632645     .9928159
          carcin |    1.024826    .0076197      3.30    0.001          1.01     1.039869
           woman |    1.003585    .0021388      1.68    0.093      .9994014     1.007785
          chsize |    1.007082    .0022079      3.22    0.001      1.002764     1.011418
         icdxcnt |    1.070217    .0224977      3.23    0.001      1.027019     1.115233
           WHPel |    1.005646    .0012476      4.54    0.000      1.003204     1.008094
       HP2vacatn |    1.353573    .1517448      2.70    0.007      1.086566     1.686193
          fdferw |    1.007178    .0015447      4.66    0.000      1.004155      1.01021
          trrepw |    1.007386    .0012166      6.09    0.000      1.005004     1.009773
                 |
      cumdosewgp |
           high  |    .6703647    .0647582     -4.14    0.000      .5547328     .8100996
                 |
      percRiskgp |
         medium  |    .4590861    .0633815     -5.64    0.000      .3502493     .6017431
           high  |    .3593794    .0563545     -6.53    0.000      .2642871     .4886867
                 |
     fcrisis2008 |    .1893406    .0334495     -9.42    0.000      .1339268     .2676824
           y2009 |    .4082296     .074231     -4.93    0.000      .2858414     .5830206
-----------------+----------------------------------------------------------------

.          estat phtest

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |                      chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      global test |                     37.22       35         0.3674
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

.           stphplot if depinr < 4, by(depinr) title(Female survival prob by ln(analysis time)) xline(52 96 98) nolntime ///
>             text(-1.25 51 "1986 Chornobyl" .5 95 "2008 financial crisis" .5 97 "2009 Russian gas-shutoff" , orientation(vertical)) ///
>            caption(depinr=depression episode number)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

.           graph save fcreha1.gph, replace
(file fcreha1.gph saved)

.         graph export fcreha1.eps, replace
(file fcreha1.eps written in EPS format)

. stcoxkm if depinr < 4, by(depinr) title("Female recurrent depression by analysis time") ///
>     xline(52 96 98)  text(50 -.25 "1986 Chornobyl" , orientation(vertical)) ///
>            caption(depinr=depression episode number)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

.          graph save fcreha2.gph, replace
(file fcreha2.gph saved)

.      graph export fcreha2.eps, replace
(file fcreha2.eps written in EPS format)

.         * stcurve, hazard  at1(y2009=0) at2(y2009=1)
.         * stcurve, hazard  at1(percRiskgp=0) at2(percRiskgp=1) at3(percRiskgp=2)
.         *stpower cox, hr
. // est store fullexpf
. est clear

.
. // est store trcoxf1
. title  Female Cox regression episode 1


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                               Female                                *****
*****                                Cox                                  *****
*****                             regression                              *****
*****                              episode                                *****
*****                                 1                                   *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:30:20  *****
*******************************************************************************
*******************************************************************************


.          title Full female Cox Regression model trimmed at .15 with Major negative life events & stressors


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                                Full                                 *****
*****                               female                                *****
*****                                Cox                                  *****
*****                             Regression                              *****
*****                               model                                 *****
*****                              trimmed                                *****
*****                                 at                                  *****
*****                                .15                                  *****
*****                                with                                 *****
*****                               Major                                 *****
*****                              negative                               *****
*****                                life                                 *****
*****                               events                                *****
*****                                 &                                   *****
*****                             stressors                               *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:30:20  *****
*******************************************************************************
*******************************************************************************


. set more off

. stcox i.agegp  i.marrw  i.emplw   ///
>     inc1w inc2w inc3w  accdw ///
>          cataw illw  shjobw  shhlw shhousw  suprtw suchrw   ///
>          healthef carcin woman chsize icdxcnt WHPel  HP2vacatn ///
>          fdferw trrepw   ///
>          i.cumdosewgp i.percRiskgp fcrisis2008 y2009 ///
>          if gender==2 & depinr==1 ,  nolog vce(robust)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id

Cox regression -- Breslow method for ties

No. of subjects      =          193                Number of obs   =       193
No. of failures      =          193
Time at risk         =         4663
                                                   Wald chi2(35)   =    352.16
Log pseudolikelihood =   -744.70812                Prob > chi2     =    0.0000

(Std. Err. adjusted for 193 clusters in id)
-----------------+----------------------------------------------------------------
                 |               Robust
               _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-----------------+----------------------------------------------------------------
           agegp |
     43 thru 55  |    1.563065    .2965232      2.35    0.019      1.077702      2.26702
     56 thru 84  |    1.518187    .3208285      1.98    0.048      1.003336     2.297228
                 |
           marrw |
2. cohabitating  |    .5103004     .153166     -2.24    0.025      .2833603     .9189945
     3. married  |    .5994244    .1358078     -2.26    0.024      .3844882     .9345138
   4. separated  |    .1159185    .0439778     -5.68    0.000      .0551086     .2438296
    5. divorced  |    .3717393    .1192631     -3.08    0.002      .1982221     .6971476
     6. widowed  |    .1491768    .0713164     -3.98    0.000      .0584481     .3807432
                 |
           emplw |
   2. part time  |    .7824228    .2012817     -0.95    0.340      .4725701     1.295438
     4. retired  |    .4170407    .1215076     -3.00    0.003      .2355999     .7382131
  5. unemployed  |    .7395959    .2016183     -1.11    0.268      .4334628     1.261936
                 |
           inc1w |    3.958076     1.88645      2.89    0.004      1.555231     10.07334
           inc2w |    2.067615    .9122343      1.65    0.100      .8707998     4.909315
           inc3w |    1.617568      .70685      1.10    0.271      .6869131     3.809108
           accdw |    .9638947    .1863605     -0.19    0.849      .6598684     1.407997
           cataw |    1.373807      .37108      1.18    0.240      .8091086     2.332622
            illw |    .9415611    .0752647     -0.75    0.451      .8050202     1.101261
          shjobw |     .998296    .0028137     -0.61    0.545      .9927965     1.003826
           shhlw |      1.0016    .0026569      0.60    0.547      .9964058     1.006821
         shhousw |    1.007857    .0021838      3.61    0.000      1.003586     1.012147
          suprtw |    .9956474    .0023037     -1.89    0.059      .9911425     1.000173
          suchrw |     .998972    .0018519     -0.55    0.579      .9953488     1.002608
        healthef |    .9872564    .0079189     -1.60    0.110      .9718569       1.0029
          carcin |    1.012142    .0075362      1.62    0.105       .997479     1.027021
           woman |    1.002476    .0031449      0.79    0.431      .9963305     1.008659
          chsize |    1.006776    .0033274      2.04    0.041      1.000276     1.013319
         icdxcnt |    1.155761    .0362053      4.62    0.000      1.086934     1.228946
           WHPel |    1.007081    .0020394      3.48    0.000      1.003092     1.011086
       HP2vacatn |    1.409785    .3227212      1.50    0.134      .9001189     2.208034
          fdferw |    1.006582    .0024403      2.71    0.007       1.00181     1.011376
          trrepw |    1.004175    .0020842      2.01    0.045      1.000099     1.008269
                 |
      cumdosewgp |
           high  |     .597178    .0904265     -3.40    0.001      .4438256     .8035173
                 |
      percRiskgp |
         medium  |    .4163171    .0807415     -4.52    0.000      .2846691      .608847
           high  |    .3475347     .070737     -5.19    0.000      .2332089     .5179063
                 |
     fcrisis2008 |    .1421394    .0524478     -5.29    0.000      .0689653     .2929531
           y2009 |     1.11284    .4599337      0.26    0.796      .4950324     2.501681
-----------------+----------------------------------------------------------------

.          local NR2 1 - (exp(-2*(e(ll)-e(ll_0))/e(N_sub)))

.          di "NR2 = ",`NR2'
NR2 =  .63219617

.          estadd scalar NR2 = `NR2'

added scalar:
                e(NR2) =  .63219617

.          est store fcoxepi1

.          estat phtest

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |                      chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      global test |                     24.33       35         0.9119
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

.          stcurve, hazard  at1(y2009=0) at2(y2009=1) title(Female hazard in episode one in year 2009)

.         stcurve, hazard  at1(percRiskgp=0) at2(percRiskgp=1) at3(percRiskgp=2)

.
. // est store fullexpf
. // est store trcoxf2
. title  Female Cox regression episode 2


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                               Female                                *****
*****                                Cox                                  *****
*****                             regression                              *****
*****                              episode                                *****
*****                                 2                                   *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:30:25  *****
*******************************************************************************
*******************************************************************************


.          title Full female Cox Regression model trimmed at .15 with Major negative life events & stressors


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                                Full                                 *****
*****                               female                                *****
*****                                Cox                                  *****
*****                             Regression                              *****
*****                               model                                 *****
*****                              trimmed                                *****
*****                                 at                                  *****
*****                                .15                                  *****
*****                                with                                 *****
*****                               Major                                 *****
*****                              negative                               *****
*****                                life                                 *****
*****                               events                                *****
*****                                 &                                   *****
*****                             stressors                               *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:30:25  *****
*******************************************************************************
*******************************************************************************


. set more off

. stcox i.agegp  i.marrw  i.emplw   ///
>     inc1w inc2w inc3w  accdw ///
>          cataw illw  shjobw  shhlw shhousw  suprtw suchrw   ///
>          healthef carcin woman chsize icdxcnt WHPel  HP2vacatn ///
>          fdferw trrepw   ///
>          i.cumdosewgp i.percRiskgp fcrisis2008 y2009 ///
>          if gender==2 & depinr==2 ,  nolog vce(robust)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id
note: cataw omitted because of collinearity

Cox regression -- Breslow method for ties

No. of subjects      =          123                Number of obs   =       123
No. of failures      =          123
Time at risk         =         1538
                                                   Wald chi2(34)   =    358.86
Log pseudolikelihood =   -341.48597                Prob > chi2     =    0.0000

(Std. Err. adjusted for 123 clusters in id)
-----------------+----------------------------------------------------------------
                 |               Robust
               _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-----------------+----------------------------------------------------------------
           agegp |
     43 thru 55  |      1.6604    .3378594      2.49    0.013      1.114319     2.474092
     56 thru 84  |    2.105185    .6228933      2.52    0.012      1.178778     3.759657
                 |
           marrw |
2. cohabitating  |    1.137851    .5825363      0.25    0.801        .41716     3.103617
     3. married  |      .61207    .1954874     -1.54    0.124       .327294     1.144627
   4. separated  |    .9664922    .6989987     -0.05    0.962      .2341971     3.988551
    5. divorced  |    .4499122     .261395     -1.37    0.169      .1440745     1.404974
     6. widowed  |    .2586108    .1141858     -3.06    0.002      .1088457     .6144439
                 |
           emplw |
   2. part time  |    .3815732    .1171416     -3.14    0.002      .2090557     .6964559
     4. retired  |    .6181559    .2187344     -1.36    0.174      .3089587     1.236789
  5. unemployed  |      .58282    .2404156     -1.31    0.191      .2596632     1.308153
                 |
           inc1w |    3.275316    2.389625      1.63    0.104      .7838415     13.68605
           inc2w |    2.370673    1.626795      1.26    0.208      .6176792     9.098717
           inc3w |    4.637253    3.332327      2.13    0.033      1.133934     18.96417
           accdw |     1.84202    .4317423      2.61    0.009      1.163551     2.916107
           cataw |           1   (omitted)
            illw |    .9704243    .0727576     -0.40    0.689      .8378048     1.124037
          shjobw |    1.002938    .0037079      0.79    0.427       .995697     1.010232
           shhlw |    1.007102    .0042369      1.68    0.093      .9988323     1.015441
         shhousw |    1.002217    .0034156      0.65    0.516      .9955452     1.008934
          suprtw |    .9955829     .003306     -1.33    0.182      .9891243     1.002084
          suchrw |    1.006373    .0027235      2.35    0.019      1.001049     1.011726
        healthef |     .978894    .0285589     -0.73    0.465      .9244898       1.0365
          carcin |    1.020493    .0300088      0.69    0.490      .9633396     1.081037
           woman |    .9995537     .003595     -0.12    0.901      .9925324     1.006625
          chsize |     1.01095    .0054089      2.04    0.042      1.000404     1.021607
         icdxcnt |    1.128429    .0474734      2.87    0.004      1.039116     1.225419
           WHPel |    1.003871    .0027459      1.41    0.158      .9985034     1.009267
       HP2vacatn |    1.331696    .3323046      1.15    0.251      .8165831     2.171748
          fdferw |    1.008766    .0032967      2.67    0.008      1.002326     1.015249
          trrepw |    1.014266    .0033217      4.33    0.000      1.007777     1.020798
                 |
      cumdosewgp |
           high  |    .4283983    .0982175     -3.70    0.000      .2733352     .6714288
                 |
      percRiskgp |
         medium  |    .2256005    .0693972     -4.84    0.000      .1234528     .4122675
           high  |    .1939896    .0671653     -4.74    0.000      .0984159     .3823766
                 |
     fcrisis2008 |    .0707522    .0326577     -5.74    0.000      .0286314     .1748384
           y2009 |    2.052451    .9128751      1.62    0.106      .8583834     4.907546
-----------------+----------------------------------------------------------------

.          local NR2 1 - (exp(-2*(e(ll)-e(ll_0))/e(N_sub)))

.          di "NR2 = ",`NR2'
NR2 =  .63015823

.          estadd scalar NR2 = `NR2'

added scalar:
                e(NR2) =  .63015823

.          est store fcoxepi2

.          estat phtest

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |                      chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      global test |                     25.04       34         0.8680
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

.          stcurve, hazard  at1(y2009=0) at2(y2009=1) title(Female hazard in episode 2 in year 2009)

.         stcurve, hazard  at1(percRiskgp=0) at2(percRiskgp=1) at3(percRiskgp=2)

.
.
.
. // est store trcoxf3
. title  Female Cox regression episode 3


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                               Female                                *****
*****                                Cox                                  *****
*****                             regression                              *****
*****                              episode                                *****
*****                                 3                                   *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:30:31  *****
*******************************************************************************
*******************************************************************************


.          title Full female Cox Regression model trimmed at .15 with Major negative life events & stressors


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                                Full                                 *****
*****                               female                                *****
*****                                Cox                                  *****
*****                             Regression                              *****
*****                               model                                 *****
*****                              trimmed                                *****
*****                                 at                                  *****
*****                                .15                                  *****
*****                                with                                 *****
*****                               Major                                 *****
*****                              negative                               *****
*****                                life                                 *****
*****                               events                                *****
*****                                 &                                   *****
*****                             stressors                               *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:30:31  *****
*******************************************************************************
*******************************************************************************


. set more off

. stcox i.agegp  i.marrw  i.emplw   ///
>     inc1w inc2w inc3w  accdw ///
>          cataw illw  shjobw  shhlw shhousw  suprtw suchrw   ///
>          healthef carcin woman chsize icdxcnt WHPel  HP2vacatn ///
>          fdferw trrepw   ///
>          i.cumdosewgp i.percRiskgp fcrisis2008 y2009 ///
>          if gender==2 & depinr==3 ,  nolog vce(robust)

         failure _d:  outcome == 1
   analysis time _t:  endepdate
  exit on or before:  time .
                 id:  id
note: cataw omitted because of collinearity

Cox regression -- Breslow method for ties

No. of subjects      =           79                Number of obs   =        79
No. of failures      =           79
Time at risk         =          719
                                                   Wald chi2(34)   =    319.35
Log pseudolikelihood =   -180.02984                Prob > chi2     =    0.0000

(Std. Err. adjusted for 79 clusters in id)
-----------------+----------------------------------------------------------------
                 |               Robust
               _t | Haz. Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-----------------+----------------------------------------------------------------
           agegp |
     43 thru 55  |    1.933409    .9109393      1.40    0.162      .7678462     4.868255
     56 thru 84  |    1.676321    .8514314      1.02    0.309      .6194667     4.536247
                 |
           marrw |
2. cohabitating  |    .5665567    .4724336     -0.68    0.496      .1105232     2.904245
     3. married  |    .7985372    .4609298     -0.39    0.697      .2576123     2.475277
   4. separated  |    .5519626    .5739153     -0.57    0.568      .0719207      4.23609
    5. divorced  |    1.043122    .7339267      0.06    0.952      .2626883     4.142182
     6. widowed  |    .5981978    .4016284     -0.77    0.444      .1604539     2.230176
                 |
           emplw |
   2. part time  |    .8986784    .2744492     -0.35    0.726      .4939173     1.635138
     4. retired  |    .6908366    .4767039     -0.54    0.592      .1786543     2.671389
  5. unemployed  |    1.327965    .6958372      0.54    0.588      .4755188     3.708563
                 |
           inc1w |    .7149909    .8212398     -0.29    0.770      .0752678     6.791913
           inc2w |    .9747561    1.020322     -0.02    0.981      .1252864      7.58382
           inc3w |    1.598378    1.484908      0.50    0.614       .258765       9.8731
           accdw |    1.278846    .3139545      1.00    0.316      .7904051     2.069125
           cataw |           1   (omitted)
            illw |    1.041371    .1302316      0.32    0.746      .8149973     1.330623
          shjobw |    .9960675    .0042213     -0.93    0.352      .9878282     1.004376
           shhlw |    .9962573    .0051315     -0.73    0.467      .9862504     1.006366
         shhousw |    .9994364     .005507     -0.10    0.919      .9887009     1.010288
          suprtw |    .9954656    .0047491     -0.95    0.341      .9862009     1.004817
          suchrw |    1.006582    .0047198      1.40    0.162      .9973733     1.015875
        healthef |    .9849613    .0495364     -0.30    0.763      .8925035     1.086997
          carcin |    1.026867    .0512513      0.53    0.595      .9311727     1.132394
           woman |    1.008457    .0070411      1.21    0.228      .9947504     1.022352
          chsize |    1.012236     .007225      1.70    0.088      .9981735     1.026496
         icdxcnt |    1.088787    .0810043      1.14    0.253      .9410545     1.259712
           WHPel |    1.012953    .0040575      3.21    0.001      1.005032     1.020937
       HP2vacatn |    .9090465    .3050357     -0.28    0.776      .4709345     1.754735
          fdferw |    .9969141    .0055357     -0.56    0.578      .9861232     1.007823
          trrepw |    1.008228    .0051128      1.62    0.106      .9982565     1.018299
                 |
      cumdosewgp |
           high  |    .7368276    .2216761     -1.02    0.310      .4085829     1.328775
                 |
      percRiskgp |
         medium  |    .1612646    .1192949     -2.47    0.014      .0378326     .6874041
           high  |    .1292744    .0933113     -2.83    0.005      .0314129     .5320058
                 |
     fcrisis2008 |    .1094075    .0830274     -2.92    0.004      .0247221      .484182
           y2009 |     .357004    .1756496     -2.09    0.036      .1361047     .9364249
-----------------+----------------------------------------------------------------

.          local NR2 1 - (exp(-2*(e(ll)-e(ll_0))/e(N_sub)))

.          di "NR2 = ",`NR2'
NR2 =  .53577937

.          estadd scalar NR2 = `NR2'

added scalar:
                e(NR2) =  .53577937

.          est store fcoxepi3

.          estat phtest

      Test of proportional-hazards assumption

      Time:  Time
      ------------+---------------------------------------------------
                  |                      chi2       df       Prob>chi2
      ------------+---------------------------------------------------
      global test |                     15.95       34         0.9964
      ------------+---------------------------------------------------

note: robust variance-covariance matrix used.

.          stcurve, hazard  at1(y2009=0) at2(y2009=1) title(Female hazard in episode 3 in year 2009)

.          stcurve, hazard  at1(percRiskgp=0) at2(percRiskgp=1) at3(percRiskgp=2)

.
. title female cox regression strata comparison


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                               female                                *****
*****                                cox                                  *****
*****                             regression                              *****
*****                               strata                                *****
*****                             comparison                              *****
*****                                                                     *****
*****                                                                     *****
*****                                             2 Sep 2013    13:30:36  *****
*******************************************************************************
*******************************************************************************


. est stats _all

Akaike's information criterion and Bayesian information criterion

-------------+---------------------------------------------------------------
       Model |    Obs    ll(null)   ll(model)     df          AIC         BIC
-------------+---------------------------------------------------------------
fcoxepi1     |    193    -841.228   -744.7081     35     1559.416     1673.61
fcoxepi2     |    123   -402.6588    -341.486     34     750.9719    846.5862
fcoxepi3     |     79    -210.342   -180.0298     34     428.0597    508.6209
-------------+---------------------------------------------------------------


Note:  N=Obs used in calculating BIC; see [R] BIC note


.
. set more off

. estout *, cells(b(star fmt(3)) t(par fmt(2)) p(par fmt(3)))     ///
>       stats(NR2 ll_0 ll df_m risk N_sub N_fail, star ///
>           labels("Nagelkerke R2" LL_0 LL num_x "time_at_risk_half_yrs" n_subjects n_depressed )) ///
>                   mlabels("Femspell1" "Femspell2" "Femspell3") ///
>           starlevels(# .1 * .05 ** 0.01 *** 0.001) legend ///
>           varwidth(23) ///
>           title(Cox regression of female recurrent depression by spell number)

Cox regression of female recurrent depression by spell number
-----------------------------------------------------------------------
                           Femspell1       Femspell2       Femspell3
                               b/t/p           b/t/p           b/t/p
-----------------------------------------------------------------------
0b.agegp                       0.000           0.000           0.000
                                 (.)             (.)             (.)
                                 (.)             (.)             (.)
1.agegp                        0.447*          0.507*          0.659
                              (2.35)          (2.49)          (1.40)
                             (0.019)         (0.013)         (0.162)
2.agegp                        0.418*          0.744*          0.517
                              (1.98)          (2.52)          (1.02)
                             (0.048)         (0.012)         (0.309)
1b.marrw                       0.000           0.000           0.000
                                 (.)             (.)             (.)
                                 (.)             (.)             (.)
2.marrw                       -0.673*          0.129          -0.568
                             (-2.24)          (0.25)         (-0.68)
                             (0.025)         (0.801)         (0.496)
3.marrw                       -0.512*         -0.491          -0.225
                             (-2.26)         (-1.54)         (-0.39)
                             (0.024)         (0.124)         (0.697)
4.marrw                       -2.155***       -0.034          -0.594
                             (-5.68)         (-0.05)         (-0.57)
                             (0.000)         (0.962)         (0.568)
5.marrw                       -0.990**        -0.799           0.042
                             (-3.08)         (-1.37)          (0.06)
                             (0.002)         (0.169)         (0.952)
6.marrw                       -1.903***       -1.352**        -0.514
                             (-3.98)         (-3.06)         (-0.77)
                             (0.000)         (0.002)         (0.444)
1b.emplw                       0.000           0.000           0.000
                                 (.)             (.)             (.)
                                 (.)             (.)             (.)
2.emplw                       -0.245          -0.963**        -0.107
                             (-0.95)         (-3.14)         (-0.35)
                             (0.340)         (0.002)         (0.726)
4.emplw                       -0.875**        -0.481          -0.370
                             (-3.00)         (-1.36)         (-0.54)
                             (0.003)         (0.174)         (0.592)
5.emplw                       -0.302          -0.540           0.284
                             (-1.11)         (-1.31)          (0.54)
                             (0.268)         (0.191)         (0.588)
inc1w                          1.376**         1.186          -0.335
                              (2.89)          (1.63)         (-0.29)
                             (0.004)         (0.104)         (0.770)
inc2w                          0.726#          0.863          -0.026
                              (1.65)          (1.26)         (-0.02)
                             (0.100)         (0.208)         (0.981)
inc3w                          0.481           1.534*          0.469
                              (1.10)          (2.13)          (0.50)
                             (0.271)         (0.033)         (0.614)
accdw                         -0.037           0.611**         0.246
                             (-0.19)          (2.61)          (1.00)
                             (0.849)         (0.009)         (0.316)
cataw                          0.318
                              (1.18)
                             (0.240)
illw                          -0.060          -0.030           0.041
                             (-0.75)         (-0.40)          (0.32)
                             (0.451)         (0.689)         (0.746)
shjobw                        -0.002           0.003          -0.004
                             (-0.61)          (0.79)         (-0.93)
                             (0.545)         (0.427)         (0.352)
shhlw                          0.002           0.007#         -0.004
                              (0.60)          (1.68)         (-0.73)
                             (0.547)         (0.093)         (0.467)
shhousw                        0.008***        0.002          -0.001
                              (3.61)          (0.65)         (-0.10)
                             (0.000)         (0.516)         (0.919)
suprtw                        -0.004#         -0.004          -0.005
                             (-1.89)         (-1.33)         (-0.95)
                             (0.059)         (0.182)         (0.341)
suchrw                        -0.001           0.006*          0.007
                             (-0.55)          (2.35)          (1.40)
                             (0.579)         (0.019)         (0.162)
healthef                      -0.013          -0.021          -0.015
                             (-1.60)         (-0.73)         (-0.30)
                             (0.110)         (0.465)         (0.763)
carcin                         0.012           0.020           0.027
                              (1.62)          (0.69)          (0.53)
                             (0.105)         (0.490)         (0.595)
woman                          0.002          -0.000           0.008
                              (0.79)         (-0.12)          (1.21)
                             (0.431)         (0.901)         (0.228)
chsize                         0.007*          0.011*          0.012#
                              (2.04)          (2.04)          (1.70)
                             (0.041)         (0.042)         (0.088)
icdxcnt                        0.145***        0.121**         0.085
                              (4.62)          (2.87)          (1.14)
                             (0.000)         (0.004)         (0.253)
WHPel                          0.007***        0.004           0.013**
                              (3.48)          (1.41)          (3.21)
                             (0.000)         (0.158)         (0.001)
HP2vacatn                      0.343           0.286          -0.095
                              (1.50)          (1.15)         (-0.28)
                             (0.134)         (0.251)         (0.776)
fdferw                         0.007**         0.009**        -0.003
                              (2.71)          (2.67)         (-0.56)
                             (0.007)         (0.008)         (0.578)
trrepw                         0.004*          0.014***        0.008
                              (2.01)          (4.33)          (1.62)
                             (0.045)         (0.000)         (0.106)
0b.cumdosewgp                  0.000           0.000           0.000
                                 (.)             (.)             (.)
                                 (.)             (.)             (.)
1.cumdosewgp                  -0.516***       -0.848***       -0.305
                             (-3.40)         (-3.70)         (-1.02)
                             (0.001)         (0.000)         (0.310)
0b.percRiskgp                  0.000           0.000           0.000
                                 (.)             (.)             (.)
                                 (.)             (.)             (.)
1.percRiskgp                  -0.876***       -1.489***       -1.825*
                             (-4.52)         (-4.84)         (-2.47)
                             (0.000)         (0.000)         (0.014)
2.percRiskgp                  -1.057***       -1.640***       -2.046**
                             (-5.19)         (-4.74)         (-2.83)
                             (0.000)         (0.000)         (0.005)
fcrisis2008                   -1.951***       -2.649***       -2.213**
                             (-5.29)         (-5.74)         (-2.92)
                             (0.000)         (0.000)         (0.004)
y2009                          0.107           0.719          -1.030*
                              (0.26)          (1.62)         (-2.09)
                             (0.796)         (0.106)         (0.036)
o.cataw                                        0.000           0.000
                                                 (.)             (.)
                                                 (.)             (.)
-----------------------------------------------------------------------
Nagelkerke R2                  0.632***        0.630***        0.536***
LL_0                        -841.228        -402.659        -210.342
LL                          -744.708        -341.486        -180.030
num_x                         35.000          34.000          34.000
time_at_risk_half_yrs       4663.000        1538.000         719.000
n_subjects                   193.000         123.000          79.000
n_depressed                  193.000         123.000          79.000
-----------------------------------------------------------------------
# p<.1, * p<.05, ** p<0.01, *** p<0.001

.
. save stdep2sep2013f, replace
file stdep2sep2013f.dta saved

.
.
. /* insufficient data for episode 4
> title Trimmed Stratified Log Normal model with Major Negative Life events and stressors
> title2 "log normal female model depression depisode 4"
> set more off
> streg  i.agegp  i.marrw childw  ///
>      jsw  dvcew sepaw cataw movew shjobw shhlw skin near cloud world healthef carcin   ///
>           saferad kzunder icdxcnt WHPel WHPer HP2inthob trrepw defnw efradw medw ///
>            if gender==2 & depinr==4, dist(lnormal) nolog vce(robust) collinear
>
> */
.
.
.         sjlog close, replace