.
. global user "Robert Alan Yaffee"

. di c(current_date)
22 Sep 2013

. di c(current_time)
16:04:42

. di c(os)
MacOSX

. di c(osdtl)
10.6.8

. di c(filename)
stptsddata20sep2013d.dta

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

.
. cd /Users/robertyaffee/Documents/data/research/chwk/phase4/survival/ptsd/dataPrep
/Users/robertyaffee/Documents/data/research/chwk/phase4/survival/ptsd/dataPrep

.
. use finalptsddata18sep2013, clear

. cd /Users/robertyaffee/Documents/data/research/chwk/phase4/survival/ptsd/CoxModelWk
/Users/robertyaffee/Documents/data/research/chwk/phase4/survival/ptsd/coxModelWk

.
. save stptsddata21sep2013c, replace
file stptsddata21sep2013c.dta saved

. di "$user"
Robert Alan Yaffee

. di c(current_date)
22 Sep 2013

. di c(current_time)
16:04:42

. di c(os)
MacOSX

. di c(osdtl)
10.6.8

. di c(filename)
stptsddata21sep2013c.dta

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

. stset endate, failure(event=1) id(id) entry(bgdate) exit(time .)

                id:  id
     failure event:  event == 1
obs. time interval:  (endate[_n-1], endate]
 enter on or after:  time bgdate
 exit on or before:  time .

------------------------------------------------------------------------------
      498  total observations
      272  observations end on or before enter()
------------------------------------------------------------------------------
      226  observations remaining, representing
      144  subjects
      226  failures in multiple-failure-per-subject data
     2854  total analysis time at risk and under observation
                                              at risk from t =         0
                                   earliest observed entry t =        45
                                        last observed exit t =       100

. di _N
498

.
. title Analysis of PTSD after Chornobyl in Zhitomyr and Kiev Oblasts


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                              Analysis                               *****
*****                                 of                                  *****
*****                                PTSD                                 *****
*****                               after                                 *****
*****                             Chornobyl                               *****
*****                                 in                                  *****
*****                              Zhitomyr                               *****
*****                                and                                  *****
*****                                Kiev                                 *****
*****                              Oblasts                                *****
*****                                                                     *****
*****                                                                     *****
*****                                            22 Sep 2013    16:04:42  *****
*******************************************************************************
*******************************************************************************


. title2 "Some data description"
-------------
title2: Some data description
                                       Date and time:  22 Sep 2013    16:04:42
                                       Working directory:  /Users/robertyaffee/Documents/data/research/chwk/phase4/survival/ptsd/coxModelWk
                                       Stata data file:  stptsddata21sep2013c.dta  has  1932  variables and  498  observations

Some data description
-------------

.
.  // illness group   low = 0 or 1  medium 2-4  high 5-6
.  cap drop illwgp

.
.  by id: g illwgp = 1 if illw <= 2
(68 missing values generated)

.  by id: replace illwgp = 2 if illw >=2 & illw <= 4
(111 real changes made)

.  by id: replace illwgp = 3 if illw >=4 & illw <= 6
(34 real changes made)

. cap label define srill 1 "less than 2" 2 "two to four" 3 "four to six"

.  label values illwgp srill

. label var illwgp "Self-reported number of illnesses per period"

.
. tab illwgp

Self-report |
  ed number |
         of |
  illnesses |
 per period |      Freq.     Percent        Cum.
------------+-----------------------------------
less than 2 |        375       75.30       75.30
two to four |         89       17.87       93.17
four to six |         34        6.83      100.00
------------+-----------------------------------
      Total |        498      100.00

.
. stpower exponential 0.38 0.618, n(144)
Note: input parameters are hazard rates.


Estimated power for two-sample comparison of survivor functions


Exponential test, hazard difference, conditional


Ho: h2-h1 = 0

Input parameters:

alpha =      0.0500  (two sided)
h1 =      0.3800
h2 =      0.6180
h2-h1 =      0.2380
N =         144
p1 =      0.5000

Estimated power:

power =      0.8098

.
. stdes

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

                                   +-------------- per subject --------------+
Category                   total        mean         min     median        max
------------------------------------------------------------------------------
no. of subjects              144
no. of records               226    1.569444           1          1          5

(first) entry time                     70.25          45         71         95
(final) exit time                   90.06944          56         94        100

subjects with gap              0
time on gap if gap             0           .           .          .          .
time at risk                2854    19.81944           3         17         53

failures                     226    1.569444           1          1          5
------------------------------------------------------------------------------

. stci if ptsdepinr < 4, by(ptsdepinr gender)

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

ptsdepinr    |    no. of
gender       |  subjects         50%     Std. Err.     [95% Conf. Interval]
-------------+-------------------------------------------------------------
   3 1. male |        55          70      8.654765           58         78
  3 2. femal |        89          60      3.181045           50         72
-------------+-------------------------------------------------------------
       total |       144          60      2.760462           50         72

. stci if mxptsdepinr < 4, by(mxptsdepinr gender)

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

mxptsdepinr  |    no. of
gender       |  subjects         50%     Std. Err.     [95% Conf. Interval]
-------------+-------------------------------------------------------------
   3 1. male |        31          80      6.262747           64         92
  3 2. femal |        59          68      17.22177           56         86
-------------+-------------------------------------------------------------
       total |        90          72      16.77451           56         86

. stci, by(gender)

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

             |    no. of
gender       |  subjects         50%     Std. Err.     [95% Conf. Interval]
-------------+-------------------------------------------------------------
     1. male |        55          72      7.241808           58         80
    2. femal |        89          60      3.366914           50         72
-------------+-------------------------------------------------------------
       total |       144          60      3.059945           50         72

. stci, by(agegp)

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

             |    no. of
agegp        |  subjects         50%     Std. Err.     [95% Conf. Interval]
-------------+-------------------------------------------------------------
     28 thru |        20          72             .           72         86
     43 thru |        57          58      5.160929           50         74
     56 thru |        67          60      2.876602           52         74
-------------+-------------------------------------------------------------
       total |       144          60      3.059945           50         72

. stci, by(cumdosewgp)

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

             |    no. of
cumdosewgp   |  subjects         50%     Std. Err.     [95% Conf. Interval]
-------------+-------------------------------------------------------------
         low |        54          60      7.414469           50         76
        high |        92          60      6.522773           52         74
-------------+-------------------------------------------------------------
       total |       144          60      3.059945           50         72

. stci, by(percRiskgp)

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

             |    no. of
percRiskgp   |  subjects         50%     Std. Err.     [95% Conf. Interval]
-------------+-------------------------------------------------------------
         low |        23          50             .            .          .
      medium |        56          64      8.944708           52         78
        high |        69          60      1.870829           56         76
-------------+-------------------------------------------------------------
       total |       144          60      3.059945           50         72

. stci, by(illwgp)

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

             |    no. of
illwgp       |  subjects         50%     Std. Err.     [95% Conf. Interval]
-------------+-------------------------------------------------------------
    less tha |       103          60      4.187599           50         72
    two to f |        35          60             8           52         80
     four to |        12          82      4.849657           72         90
-------------+-------------------------------------------------------------
       total |       144          60      3.059945           50         72

.
. foreach type in logrank wilcoxon {
  2. set more off
  3. sts test gender, `type'
  4. set more off
  5. sts test agegp, `type'
  6. set more off
  7. sts test cumdosewgp, `type'
  8. set more off
  9. sts test percRiskgp, `type'
 10. set more off
 11. sts test illwgp, `type'
 12. }

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


          |   Events         Events
gender    |  observed       expected
----------+-------------------------
1. male   |        94          96.78
2. female |       132         129.22
----------+-------------------------
Total     |       226         226.00

                chi2(1) =       0.19
                Pr>chi2 =     0.6595

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


           |   Events         Events
agegp      |  observed       expected
-----------+-------------------------
28 thru 42 |        31          27.51
43 thru 55 |        95          97.14
56 thru 84 |       100         101.35
-----------+-------------------------
Total      |       226         226.00

                 chi2(2) =       0.71
                 Pr>chi2 =     0.7005

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


           |   Events         Events
cumdosewgp |  observed       expected
-----------+-------------------------
low        |        80          76.80
high       |       146         149.20
-----------+-------------------------
Total      |       226         226.00

                 chi2(1) =       0.28
                 Pr>chi2 =     0.5975

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


           |   Events         Events
percRiskgp |  observed       expected
-----------+-------------------------
low        |        44          36.98
medium     |        77          71.91
high       |       105         117.11
-----------+-------------------------
Total      |       226         226.00

                 chi2(2) =       4.10
                 Pr>chi2 =     0.1286

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


            |   Events         Events
illwgp      |  observed       expected
------------+-------------------------
less than 2 |       159         162.36
two to four |        49          47.09
four to six |        18          16.55
------------+-------------------------
Total       |       226         226.00

                  chi2(2) =       0.37
                  Pr>chi2 =     0.8313

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  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   |        94          96.78          -42
2. female |       132         129.22           42
----------+--------------------------------------
Total     |       226         226.00            0

                chi2(1) =       0.01
                Pr>chi2 =     0.9312

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  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 |        31          27.51          356
43 thru 55 |        95          97.14         -427
56 thru 84 |       100         101.35           71
-----------+--------------------------------------
Total      |       226         226.00            0

                 chi2(2) =       1.47
                 Pr>chi2 =     0.4784

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


           |   Events         Events        Sum of
cumdosewgp |  observed       expected        ranks
-----------+--------------------------------------
low        |        80          76.80          186
high       |       146         149.20         -186
-----------+--------------------------------------
Total      |       226         226.00            0

                 chi2(1) =       0.16
                 Pr>chi2 =     0.6896

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


           |   Events         Events        Sum of
percRiskgp |  observed       expected        ranks
-----------+--------------------------------------
low        |        44          36.98          577
medium     |        77          71.91          415
high       |       105         117.11         -992
-----------+--------------------------------------
Total      |       226         226.00            0

                 chi2(2) =       4.58
                 Pr>chi2 =     0.1014

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


            |   Events         Events        Sum of
illwgp      |  observed       expected        ranks
------------+--------------------------------------
less than 2 |       159         162.36         -211
two to four |        49          47.09          136
four to six |        18          16.55           75
------------+--------------------------------------
Total       |       226         226.00            0

                  chi2(2) =       0.22
                  Pr>chi2 =     0.8954

.
.
. stsum

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

         |               incidence       no. of    +------ Survival time -----+
         | time at risk     rate        subjects        25%       50%       75%
---------+---------------------------------------------------------------------
   total |         2854   .0791871           144         56        60        78

. set more off

. sts list, by(gender)

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

           Beg.          Net            Survivor      Std.
  Time    Total   Fail   Lost           Function     Error     [95% Conf. Int.]
-------------------------------------------------------------------------------
1. male
    47        0      0     -2             1.0000         .          .         .
    53        2      0     -4             1.0000         .          .         .
    57        6      0     -1             1.0000         .          .         .
    58        7      1     -1             0.8571    0.1323     0.3341    0.9786
    59        7      0     -5             0.8571    0.1323     0.3341    0.9786
    60       12      3     -3             0.6429    0.1460     0.2982    0.8510
    61       12      0     -5             0.6429    0.1460     0.2982    0.8510
    62       17      1     -1             0.6050    0.1422     0.2845    0.8180
    63       17      0     -4             0.6050    0.1422     0.2845    0.8180
    64       21      2     -1             0.5474    0.1344     0.2621    0.7625
    65       20      0     -5             0.5474    0.1344     0.2621    0.7625
    67       25      0     -1             0.5474    0.1344     0.2621    0.7625
    69       26      0     -2             0.5474    0.1344     0.2621    0.7625
    70       28      1     -1             0.5279    0.1310     0.2546    0.7420
    71       28      0     -4             0.5279    0.1310     0.2546    0.7420
    72       32      5     -4             0.4454    0.1156     0.2193    0.6497
    73       31      0     -2             0.4454    0.1156     0.2193    0.6497
    74       33      2     -2             0.4184    0.1102     0.2069    0.6176
    75       33      0     -3             0.4184    0.1102     0.2069    0.6176
    76       36      4     -3             0.3719    0.1004     0.1848    0.5602
    77       35      0     -1             0.3719    0.1004     0.1848    0.5602
    78       36      4     -2             0.3306    0.0913     0.1645    0.5073
    79       34      0     -2             0.3306    0.0913     0.1645    0.5073
    80       36      8     -4             0.2571    0.0746     0.1269    0.4092
    81       32      0     -4             0.2571    0.0746     0.1269    0.4092
    82       36      2     -2             0.2428    0.0712     0.1196    0.3893
    83       36      0     -2             0.2428    0.0712     0.1196    0.3893
    84       38      4     -3             0.2173    0.0648     0.1066    0.3531
    85       37      0     -4             0.2173    0.0648     0.1066    0.3531
    86       41      3     -1             0.2014    0.0607     0.0986    0.3301
    88       39      9     -5             0.1549    0.0486     0.0747    0.2616
    89       35      0     -2             0.1549    0.0486     0.0747    0.2616
    90       37      7     -2             0.1256    0.0407     0.0598    0.2170
    91       32      0     -1             0.1256    0.0407     0.0598    0.2170
    92       33      7     -2             0.0990    0.0333     0.0462    0.1756
    93       28      0     -1             0.0990    0.0333     0.0462    0.1756
    94       29      1      0             0.0955    0.0323     0.0444    0.1702
    96       28     14     -2             0.0478    0.0185     0.0202    0.0935
    98       16      8      0             0.0239    0.0110     0.0086    0.0533
   100        8      8      0             0.0000         .          .         .
2. female
    45        0      0     -4             1.0000         .          .         .
    47        4      0     -2             1.0000         .          .         .
    49        6      0     -1             1.0000         .          .         .
    50        7      1     -1             0.8571    0.1323     0.3341    0.9786
    51        7      0     -1             0.8571    0.1323     0.3341    0.9786
    52        8      1     -1             0.7500    0.1531     0.3148    0.9309
    53        8      0     -3             0.7500    0.1531     0.3148    0.9309
    55       11      0     -1             0.7500    0.1531     0.3148    0.9309
    56       12      3      0             0.5625    0.1482     0.2437    0.7910
    57        9      0     -3             0.5625    0.1482     0.2437    0.7910
    59       12      0     -3             0.5625    0.1482     0.2437    0.7910
    60       15      4     -3             0.4125    0.1263     0.1749    0.6378
    61       14      0     -3             0.4125    0.1263     0.1749    0.6378
    63       17      0     -5             0.4125    0.1263     0.1749    0.6378
    64       22      1     -1             0.3938    0.1219     0.1674    0.6150
    65       22      0     -4             0.3938    0.1219     0.1674    0.6150
    66       26      2     -2             0.3635    0.1144     0.1554    0.5768
    67       26      0     -5             0.3635    0.1144     0.1554    0.5768
    68       31      2     -1             0.3400    0.1082     0.1461    0.5460
    69       30      0     -4             0.3400    0.1082     0.1461    0.5460
    70       34      3     -2             0.3100    0.1000     0.1340    0.5054
    71       33      0    -10             0.3100    0.1000     0.1340    0.5054
    72       43      5     -3             0.2740    0.0897     0.1194    0.4544
    73       41      0     -4             0.2740    0.0897     0.1194    0.4544
    74       45      3     -1             0.2557    0.0843     0.1118    0.4279
    75       43      0     -3             0.2557    0.0843     0.1118    0.4279
    76       46      6     -5             0.2223    0.0744     0.0977    0.3784
    77       45      0     -5             0.2223    0.0744     0.0977    0.3784
    78       50      4     -2             0.2046    0.0690     0.0901    0.3513
    79       48      0     -3             0.2046    0.0690     0.0901    0.3513
    80       51      8     -4             0.1725    0.0591     0.0761    0.3014
    81       47      0     -8             0.1725    0.0591     0.0761    0.3014
    82       55     10     -4             0.1411    0.0492     0.0623    0.2512
    83       49      0     -6             0.1411    0.0492     0.0623    0.2512
    84       55      4     -2             0.1309    0.0459     0.0578    0.2344
    85       53      0     -1             0.1309    0.0459     0.0578    0.2344
    86       54      4     -3             0.1212    0.0427     0.0535    0.2184
    87       53      0     -1             0.1212    0.0427     0.0535    0.2184
    88       54      8     -1             0.1032    0.0369     0.0455    0.1885
    89       47      0     -5             0.1032    0.0369     0.0455    0.1885
    90       52      6     -2             0.0913    0.0329     0.0401    0.1684
    91       48      0     -1             0.0913    0.0329     0.0401    0.1684
    92       49     10     -3             0.0727    0.0267     0.0317    0.1365
    93       42      0     -2             0.0727    0.0267     0.0317    0.1365
    94       44     10     -2             0.0562    0.0212     0.0242    0.1077
    95       36      0     -1             0.0562    0.0212     0.0242    0.1077
    96       37     17      0             0.0304    0.0123     0.0124    0.0619
    98       20     13      0             0.0106    0.0054     0.0035    0.0260
   100        7      7      0             0.0000         .          .         .
-------------------------------------------------------------------------------

.
. sts graph, by(gender) xline(52) text(.5 51 "Chornobyl", orientation(vertical))

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

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

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

.
. sts graph, by(mxptsdepinr) xline(52) text(.5 51 "Chornobyl", orientation(vertical))

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

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

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

.
. sts graph, surv by(agegp) xline(52) text(.5 51 "Chornobyl", orientation(vertical)) ci  ///
>  subtitle(Survival function by age group)

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

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

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

.
. tab ptsdepinr gender, row col

+-------------------+
| Key               |
+-------------------+
|     frequency     |
|  row percentage   |
| column percentage |
+-------------------+

      ptsd |
   episode | respondent's gender
    number |   1. male  2. female |     Total
-----------+----------------------+----------
         2 |       116        156 |       272
           |     42.65      57.35 |    100.00
           |     55.24      54.17 |     54.62
-----------+----------------------+----------
         3 |        55         89 |       144
           |     38.19      61.81 |    100.00
           |     26.19      30.90 |     28.92
-----------+----------------------+----------
         4 |        24         30 |        54
           |     44.44      55.56 |    100.00
           |     11.43      10.42 |     10.84
-----------+----------------------+----------
         5 |         9          9 |        18
           |     50.00      50.00 |    100.00
           |      4.29       3.12 |      3.61
-----------+----------------------+----------
         6 |         4          3 |         7
           |     57.14      42.86 |    100.00
           |      1.90       1.04 |      1.41
-----------+----------------------+----------
         7 |         2          1 |         3
           |     66.67      33.33 |    100.00
           |      0.95       0.35 |      0.60
-----------+----------------------+----------
     Total |       210        288 |       498
           |     42.17      57.83 |    100.00
           |    100.00     100.00 |    100.00


. hist ptsdepinr if gender==1, freq title(Male ptsd episodes)  ///
>   ytitle(total time in half-year units)
(bin=14, start=2, width=.35714286)

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

.
. hist ptsdepinr if gender==2, freq title(Female ptsd episodes)  ///
>   ytitle(total time in half-year units)
(bin=16, start=2, width=.3125)

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

. graph combine mnumep.gph fnumep.gph, col(2) title(Number of spells)

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

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

.
.
. ttest ptsdepinr, by(gender) welch

Two-sample t test with unequal variances
---------+--------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
 1. male |     210    2.742857    .0724084    1.049298    2.600113    2.885602
2. femal |     288    2.670139    .0531689    .9023068    2.565488    2.774789
---------+--------------------------------------------------------------------
combined |     498    2.700803    .0433174    .9666675    2.615695    2.785911
---------+--------------------------------------------------------------------
    diff |            .0727183    .0898327               -.1038714    .2493079
---------+--------------------------------------------------------------------
    diff = mean(1. male) - mean(2. femal)                         t =   0.8095
Ho: diff = 0                             Welch's degrees of freedom =  410.354

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.7906         Pr(|T| > |t|) = 0.4187          Pr(T > t) = 0.2094

. ranksum ptsdepinr, by(gender)

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

      gender |      obs    rank sum    expected
-------------+---------------------------------
     1. male |      210       52703       52395
   2. female |      288       71548       71856
-------------+---------------------------------
    combined |      498      124251      124251

unadjusted variance  2514960.00
adjustment for ties  -473907.35
                     ----------
adjusted variance    2041052.65

Ho: ptsdep~r(gender==1. male) = ptsdep~r(gender==2. female)
             z =   0.216
    Prob > |z| =   0.8293

.
. tab ptsdhyrs

  Number of |
       ptsd |
 half-years |
experienced |      Freq.     Percent        Cum.
------------+-----------------------------------
          3 |          4        0.80        0.80
          4 |        195       39.16       39.96
          5 |          1        0.20       40.16
          6 |        133       26.71       66.87
          7 |          3        0.60       67.47
          8 |         80       16.06       83.53
          9 |          2        0.40       83.94
         10 |         32        6.43       90.36
         11 |          1        0.20       90.56
         12 |         12        2.41       92.97
         13 |          1        0.20       93.17
         14 |         12        2.41       95.58
         15 |          1        0.20       95.78
         16 |         10        2.01       97.79
         17 |          1        0.20       97.99
         18 |          1        0.20       98.19
         20 |          2        0.40       98.59
         21 |          1        0.20       98.80
         22 |          2        0.40       99.20
         28 |          2        0.40       99.60
         32 |          1        0.20       99.80
         34 |          1        0.20      100.00
------------+-----------------------------------
      Total |        498      100.00

. tab ptsdhyrs if gender==1

  Number of |
       ptsd |
 half-years |
experienced |      Freq.     Percent        Cum.
------------+-----------------------------------
          3 |          2        0.95        0.95
          4 |         81       38.57       39.52
          6 |         53       25.24       64.76
          8 |         32       15.24       80.00
         10 |         13        6.19       86.19
         12 |          7        3.33       89.52
         14 |          8        3.81       93.33
         16 |          6        2.86       96.19
         17 |          1        0.48       96.67
         18 |          1        0.48       97.14
         22 |          2        0.95       98.10
         28 |          2        0.95       99.05
         32 |          1        0.48       99.52
         34 |          1        0.48      100.00
------------+-----------------------------------
      Total |        210      100.00

. tab ptsdhyrs if gender==2

  Number of |
       ptsd |
 half-years |
experienced |      Freq.     Percent        Cum.
------------+-----------------------------------
          3 |          2        0.69        0.69
          4 |        114       39.58       40.28
          5 |          1        0.35       40.62
          6 |         80       27.78       68.40
          7 |          3        1.04       69.44
          8 |         48       16.67       86.11
          9 |          2        0.69       86.81
         10 |         19        6.60       93.40
         11 |          1        0.35       93.75
         12 |          5        1.74       95.49
         13 |          1        0.35       95.83
         14 |          4        1.39       97.22
         15 |          1        0.35       97.57
         16 |          4        1.39       98.96
         20 |          2        0.69       99.65
         21 |          1        0.35      100.00
------------+-----------------------------------
      Total |        288      100.00

. ttest ptsdyrs, by(gender) welch

Two-sample t test with unequal variances
---------+--------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
 1. male |     210    3.635714    .1671932     2.42286    3.306113    3.965316
2. femal |     288    3.194444    .0879328    1.492269    3.021369    3.367519
---------+--------------------------------------------------------------------
combined |     498    3.380522    .0873769    1.949896    3.208848    3.552196
---------+--------------------------------------------------------------------
    diff |            .4412698    .1889067                .0696299    .8129098
---------+--------------------------------------------------------------------
    diff = mean(1. male) - mean(2. femal)                         t =   2.3359
Ho: diff = 0                             Welch's degrees of freedom =   323.68

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9899         Pr(|T| > |t|) = 0.0201          Pr(T > t) = 0.0101

.
. ranksum ptsdyrs, by(gender)

Two-sample Wilcoxon rank-sum (Mann-Whitney) test

      gender |      obs    rank sum    expected
-------------+---------------------------------
     1. male |      210       53926       52395
   2. female |      288       70325       71856
-------------+---------------------------------
    combined |      498      124251      124251

unadjusted variance  2514960.00
adjustment for ties  -210073.71
                     ----------
adjusted variance    2304886.29

Ho: ptsdyrs(gender==1. male) = ptsdyrs(gender==2. female)
             z =   1.008
    Prob > |z| =   0.3132

.
. set more off

. ltable endate

                 Beg.                                 Std.
   Interval     Total   Deaths   Lost    Survival    Error     [95% Conf. Int.]
-------------------------------------------------------------------------------
   44    45       498        4      0     0.9920    0.0040     0.9787    0.9970
   46    47       494        4      0     0.9839    0.0056     0.9681    0.9919
   48    49       490        1      0     0.9819    0.0060     0.9656    0.9906
   50    51       489        4      0     0.9739    0.0071     0.9555    0.9848
   52    53       485       13      0     0.9478    0.0100     0.9243    0.9642
   56    57       472       10      0     0.9277    0.0116     0.9012    0.9473
   58    59       462       10      0     0.9076    0.0130     0.8786    0.9300
   60    61       452       20      0     0.8675    0.0152     0.8344    0.8943
   62    63       432       14      0     0.8394    0.0165     0.8041    0.8688
   64    65       418       12      0     0.8153    0.0174     0.7783    0.8467
   66    67       406       12      0     0.7912    0.0182     0.7528    0.8243
   68    69       394       15      0     0.7610    0.0191     0.7211    0.7961
   70    71       379       15      0     0.7309    0.0199     0.6897    0.7676
   72    73       364       18      0     0.6948    0.0206     0.6523    0.7332
   74    75       346       16      0     0.6627    0.0212     0.6193    0.7023
   76    77       330       19      0     0.6245    0.0217     0.5804    0.6654
   78    79       311       14      0     0.5964    0.0220     0.5519    0.6380
   80    81       297       34      0     0.5281    0.0224     0.4833    0.5709
   82    83       263       27      0     0.4739    0.0224     0.4294    0.5170
   84    85       236       15      0     0.4438    0.0223     0.3997    0.4868
   86    87       221       15      0     0.4137    0.0221     0.3702    0.4565
   88    89       206       28      0     0.3574    0.0215     0.3155    0.3995
   90    91       178       27      0     0.3032    0.0206     0.2634    0.3439
   92    93       151       25      0     0.2530    0.0195     0.2157    0.2919
   94    95       126       21      0     0.2108    0.0183     0.1762    0.2477
   96    97       105       51      0     0.1084    0.0139     0.0831    0.1376
   98    99        54       35      0     0.0382    0.0086     0.0238    0.0576
  100   101        19       19      0     0.0000         .          .         .
-------------------------------------------------------------------------------

. set more off

. ltable endate, by(gender)

                 Beg.                                 Std.
   Interval     Total   Deaths   Lost    Survival    Error     [95% Conf. Int.]
-------------------------------------------------------------------------------
1. male
   46    47       210        2      0     0.9905    0.0067     0.9625    0.9976
   50    51       208        1      0     0.9857    0.0082     0.9564    0.9954
   52    53       207        6      0     0.9571    0.0140     0.9193    0.9775
   56    57       201        4      0     0.9381    0.0166     0.8958    0.9636
   58    59       197        6      0     0.9095    0.0198     0.8618    0.9413
   60    61       191        9      0     0.8667    0.0235     0.8128    0.9059
   62    63       182        7      0     0.8333    0.0257     0.7757    0.8774
   64    65       175        6      0     0.8048    0.0274     0.7444    0.8523
   66    67       169        6      0     0.7762    0.0288     0.7136    0.8268
   68    69       163        2      0     0.7667    0.0292     0.7034    0.8182
   70    71       161        3      0     0.7524    0.0298     0.6882    0.8053
   72    73       158        9      0     0.7095    0.0313     0.6430    0.7659
   74    75       149        8      0     0.6714    0.0324     0.6034    0.7304
   76    77       141        7      0     0.6381    0.0332     0.5692    0.6990
   78    79       134        7      0     0.6048    0.0337     0.5352    0.6672
   80    81       127       13      0     0.5429    0.0344     0.4731    0.6074
   82    83       114        9      0     0.5000    0.0345     0.4306    0.5654
   84    85       105        7      0     0.4667    0.0344     0.3980    0.5324
   86    87        98        5      0     0.4429    0.0343     0.3748    0.5086
   88    89        93       15      0     0.3714    0.0333     0.3064    0.4364
   90    91        78       13      0     0.3095    0.0319     0.2483    0.3726
   92    93        65       13      0     0.2476    0.0298     0.1915    0.3076
   94    95        52        7      0     0.2143    0.0283     0.1616    0.2720
   96    97        45       20      0     0.1190    0.0223     0.0797    0.1669
   98    99        25       14      0     0.0524    0.0154     0.0278    0.0883
  100   101        11       11      0     0.0000         .          .         .
2. female
   44    45       288        4      0     0.9861    0.0069     0.9634    0.9948
   46    47       284        2      0     0.9792    0.0084     0.9542    0.9906
   48    49       282        1      0     0.9757    0.0091     0.9497    0.9883
   50    51       281        3      0     0.9653    0.0108     0.9364    0.9812
   52    53       278        7      0     0.9410    0.0139     0.9068    0.9629
   56    57       271        6      0     0.9201    0.0160     0.8823    0.9462
   58    59       265        4      0     0.9063    0.0172     0.8663    0.9347
   60    61       261       11      0     0.8681    0.0199     0.8232    0.9022
   62    63       250        7      0     0.8438    0.0214     0.7964    0.8809
   64    65       243        6      0     0.8229    0.0225     0.7737    0.8624
   66    67       237        6      0     0.8021    0.0235     0.7512    0.8436
   68    69       231       13      0     0.7569    0.0253     0.7031    0.8024
   70    71       218       12      0     0.7153    0.0266     0.6594    0.7637
   72    73       206        9      0     0.6840    0.0274     0.6269    0.7343
   74    75       197        8      0     0.6563    0.0280     0.5983    0.7079
   76    77       189       12      0     0.6146    0.0287     0.5558    0.6680
   78    79       177        7      0     0.5903    0.0290     0.5311    0.6445
   80    81       170       21      0     0.5174    0.0294     0.4581    0.5733
   82    83       149       18      0     0.4549    0.0293     0.3966    0.5112
   84    85       131        8      0     0.4271    0.0291     0.3695    0.4834
   86    87       123       10      0     0.3924    0.0288     0.3359    0.4483
   88    89       113       13      0     0.3472    0.0281     0.2927    0.4022
   90    91       100       14      0     0.2986    0.0270     0.2468    0.3521
   92    93        86       12      0     0.2569    0.0257     0.2080    0.3085
   94    95        74       14      0     0.2083    0.0239     0.1635    0.2569
   96    97        60       31      0     0.1007    0.0177     0.0694    0.1387
   98    99        29       21      0     0.0278    0.0097     0.0131    0.0517
  100   101         8        8      0     0.0000         .          .         .
-------------------------------------------------------------------------------

.
. subtitle("Life table for males")
-------------
                                       Date and time:  22 Sep 2013    16:04:58
                                       Stata version:  13
                                       Operating system:  MacOSX   10.6.8  on  Macintosh (Intel 64-bit)  with  4  processors
                                       using  33554432 bytes of memory
                                       Working directory:  /Users/robertyaffee/Documents/data/research/chwk/phase4/survival/ptsd/coxModelWk
                                       Stata data file:  stptsddata21sep2013c.dta
                                        data file has  1933  variables
                                         and  498  observations

(
-------------

. ltable endate if gender==1, intervals(2)

                 Beg.                                 Std.
   Interval     Total   Deaths   Lost    Survival    Error     [95% Conf. Int.]
-------------------------------------------------------------------------------
   46    48       210        2      0     0.9905    0.0067     0.9625    0.9976
   50    52       208        1      0     0.9857    0.0082     0.9564    0.9954
   52    54       207        6      0     0.9571    0.0140     0.9193    0.9775
   56    58       201        4      0     0.9381    0.0166     0.8958    0.9636
   58    60       197        6      0     0.9095    0.0198     0.8618    0.9413
   60    62       191        9      0     0.8667    0.0235     0.8128    0.9059
   62    64       182        7      0     0.8333    0.0257     0.7757    0.8774
   64    66       175        6      0     0.8048    0.0274     0.7444    0.8523
   66    68       169        6      0     0.7762    0.0288     0.7136    0.8268
   68    70       163        2      0     0.7667    0.0292     0.7034    0.8182
   70    72       161        3      0     0.7524    0.0298     0.6882    0.8053
   72    74       158        9      0     0.7095    0.0313     0.6430    0.7659
   74    76       149        8      0     0.6714    0.0324     0.6034    0.7304
   76    78       141        7      0     0.6381    0.0332     0.5692    0.6990
   78    80       134        7      0     0.6048    0.0337     0.5352    0.6672
   80    82       127       13      0     0.5429    0.0344     0.4731    0.6074
   82    84       114        9      0     0.5000    0.0345     0.4306    0.5654
   84    86       105        7      0     0.4667    0.0344     0.3980    0.5324
   86    88        98        5      0     0.4429    0.0343     0.3748    0.5086
   88    90        93       15      0     0.3714    0.0333     0.3064    0.4364
   90    92        78       13      0     0.3095    0.0319     0.2483    0.3726
   92    94        65       13      0     0.2476    0.0298     0.1915    0.3076
   94    96        52        7      0     0.2143    0.0283     0.1616    0.2720
   96    98        45       20      0     0.1190    0.0223     0.0797    0.1669
   98   100        25       14      0     0.0524    0.0154     0.0278    0.0883
  100   102        11       11      0     0.0000         .          .         .
-------------------------------------------------------------------------------

. sts graph if gender==1, surv xline(52) ///
>   text(.5 51 "Chornobyl", orientation(vertical)) ///
>   ytitle(Conditional probability of no PTSD)

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

.     subtitle("Life table for females")  ///
> ltable endate if gender==2, intervals(2)
-------------
                                       Date and time:  22 Sep 2013    16:04:59
                                       Stata version:  13
                                       Operating system:  MacOSX   10.6.8  on  Macintosh (Intel 64-bit)  with  4  processors
                                       using  33554432 bytes of memory
                                       Working directory:  /Users/robertyaffee/Documents/data/research/chwk/phase4/survival/ptsd/coxModelWk
                                       Stata data file:  stptsddata21sep2013c.dta
                                        data file has  1933  variables
                                         and  498  observations

(
-------------

. sts graph if gender==2, surv xline(52) ///
>   text(.5 51 "Chornobyl", orientation(vertical))  ///
>   ytitle(Conditional probability of no PTSD)

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

. subtitle("Life table for gender")
-------------
                                       Date and time:  22 Sep 2013    16:05:00
                                       Stata version:  13
                                       Operating system:  MacOSX   10.6.8  on  Macintosh (Intel 64-bit)  with  4  processors
                                       using  33554432 bytes of memory
                                       Working directory:  /Users/robertyaffee/Documents/data/research/chwk/phase4/survival/ptsd/coxModelWk
                                       Stata data file:  stptsddata21sep2013c.dta
                                        data file has  1933  variables
                                         and  498  observations

(
-------------

. sts graph, surv by(gender) xline(52) ci ///
>   text(.5 51 "Chornobyl", orientation(vertical)) ///
>    title(Probability of no PTSD by gender)  ///
>    ytitle(Conditional probability of no PTSD) ///
>    note("Stata analysis time 40 = 1980, 52=1986, 60=1990, 80=2000, 100=2010")

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

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

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

.
. title Some discrete tests


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                                Some                                 *****
*****                              discrete                               *****
*****                               tests                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                            22 Sep 2013    16:05:02  *****
*******************************************************************************
*******************************************************************************


.
.  subtitle("Power for testing males")
-------------
                                       Date and time:  22 Sep 2013    16:05:02
                                       Stata version:  13
                                       Operating system:  MacOSX   10.6.8  on  Macintosh (Intel 64-bit)  with  4  processors
                                       using  33554432 bytes of memory
                                       Working directory:  /Users/robertyaffee/Documents/data/research/chwk/phase4/survival/ptsd/coxModelWk
                                       Stata data file:  stptsddata21sep2013c.dta
                                        data file has  1933  variables
                                         and  498  observations

(
-------------

.  forv p= 755(5)950 {
  2.      local pwr = .001*`p'
  3.     stpower logrank, alpha(.05) power(`pwr') p1(.415) hratio(.711) table onesided
  4. }


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.755   186   77   109   186   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.76   189   78   111   189   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.765   191   79   112   191   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.77   194   80   114   194   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.775   197   81   116   197   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.78   199   82   117   199   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.785   202   83   119   202   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.79   205   85   120   205   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.795   208   86   122   208   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.8   211   87   124   211   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.805   214   88   126   214   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.81   217   90   127   217   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.815   220   91   129   220   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.82   224   92   132   224   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.825   227   94   133   227   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.83   231   95   136   231   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.835   234   97   137   234   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.84   238   98   140   238   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.845   241   100   141   241   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.85   245   101   144   245   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.855   249   103   146   249   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.86   253   104   149   253   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.865   258   107   151   258   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.87   262   108   154   262   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.875   267   110   157   267   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.88   271   112   159   271   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.885   276   114   162   276   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.89   281   116   165   281   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.895   287   119   168   287   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.9   292   121   171   292   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.905   298   123   175   298   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.91   304   126   178   304   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.915   310   128   182   310   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.92   317   131   186   317   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.925   324   134   190   324   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.93   332   137   195   332   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.935   340   141   199   340   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.94   349   144   205   349   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.945   359   148   211   359   .711   .05   |
  +---------------------------------------------------------------+
  * one sided


Estimated sample sizes for two-sample comparison of survivor functions


Log-rank test, Freedman method


Ho: S1(t) = S2(t)

  +---------------------------------------------------------------+
  |Power   N   N1   N2   E   HR   Alpha*  |
  +---------------------------------------------------------------+
  |.95   369   153   216   369   .711   .05   |
  +---------------------------------------------------------------+
  * one sided

. ** our power for this one-sided test is approx .83
.  foreach testype in logrank wilcoxon  {
  2.    sts test gender, `testype'
  3.  }

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


          |   Events         Events
gender    |  observed       expected
----------+-------------------------
1. male   |        94          96.78
2. female |       132         129.22
----------+-------------------------
Total     |       226         226.00

                chi2(1) =       0.19
                Pr>chi2 =     0.6595

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  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   |        94          96.78          -42
2. female |       132         129.22           42
----------+--------------------------------------
Total     |       226         226.00            0

                chi2(1) =       0.01
                Pr>chi2 =     0.9312

.
.  sts test cumdosewgp, logrank

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


           |   Events         Events
cumdosewgp |  observed       expected
-----------+-------------------------
low        |        80          76.80
high       |       146         149.20
-----------+-------------------------
Total      |       226         226.00

                 chi2(1) =       0.28
                 Pr>chi2 =     0.5975

.  sts test cumdosewgp, wilcoxon

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


           |   Events         Events        Sum of
cumdosewgp |  observed       expected        ranks
-----------+--------------------------------------
low        |        80          76.80          186
high       |       146         149.20         -186
-----------+--------------------------------------
Total      |       226         226.00            0

                 chi2(1) =       0.16
                 Pr>chi2 =     0.6896

.
.  title Analysis of survival probability by external exposure group


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                              Analysis                               *****
*****                                 of                                  *****
*****                              survival                               *****
*****                            probability                              *****
*****                                 by                                  *****
*****                              external                               *****
*****                              exposure                               *****
*****                               group                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                            22 Sep 2013    16:05:03  *****
*******************************************************************************
*******************************************************************************


.  sts graph, surv by(cumdosewgp) xline(52) ///
>   text(.5 51 "Chornobyl", orientation(vertical)) ///
>    title(Probability of no PTSD by external dose)  ///
>    ytitle(Conditional probability of no PTSD) ///
>    note("Stata analysis time 40 = 1980, 52=1986, 60=1990, 80=2000, 100=2010")  ///
>    legend(rows(6)) ci

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

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

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

.
.
.  title Analysis of survival probability by perceived risk group


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                              Analysis                               *****
*****                                 of                                  *****
*****                              survival                               *****
*****                            probability                              *****
*****                                 by                                  *****
*****                             perceived                               *****
*****                                risk                                 *****
*****                               group                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                            22 Sep 2013    16:05:04  *****
*******************************************************************************
*******************************************************************************


.  sts graph, surv by(percRiskgp) xline(52) ///
>   text(.5 51 "Chornobyl", orientation(vertical)) ///
>    title(Probability of no PTSD by gender)  ///
>    ytitle(Conditional probability of no PTSD) ///
>    note("Stata analysis time 40 = 1980, 52=1986, 60=1990, 80=2000, 100=2010")  ///
>    legend(rows(6)) ci

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

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

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

.
.   sts test percRiskgp, logrank

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


           |   Events         Events
percRiskgp |  observed       expected
-----------+-------------------------
low        |        44          36.98
medium     |        77          71.91
high       |       105         117.11
-----------+-------------------------
Total      |       226         226.00

                 chi2(2) =       4.10
                 Pr>chi2 =     0.1286

.   sts test percRiskgp, wilcoxon

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


           |   Events         Events        Sum of
percRiskgp |  observed       expected        ranks
-----------+--------------------------------------
low        |        44          36.98          577
medium     |        77          71.91          415
high       |       105         117.11         -992
-----------+--------------------------------------
Total      |       226         226.00            0

                 chi2(2) =       4.58
                 Pr>chi2 =     0.1014

.
.
. sts test illwgp, logrank

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Log-rank test for equality of survivor functions


            |   Events         Events
illwgp      |  observed       expected
------------+-------------------------
less than 2 |       159         162.36
two to four |        49          47.09
four to six |        18          16.55
------------+-------------------------
Total       |       226         226.00

                  chi2(2) =       0.37
                  Pr>chi2 =     0.8313

. sts test illwgp, wilcoxon

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id


Wilcoxon (Breslow) test for equality of survivor functions


            |   Events         Events        Sum of
illwgp      |  observed       expected        ranks
------------+--------------------------------------
less than 2 |       159         162.36         -211
two to four |        49          47.09          136
four to six |        18          16.55           75
------------+--------------------------------------
Total       |       226         226.00            0

                  chi2(2) =       0.22
                  Pr>chi2 =     0.8954

.
.
. title Analysis of survival probability by self-reported illness group


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                              Analysis                               *****
*****                                 of                                  *****
*****                              survival                               *****
*****                            probability                              *****
*****                                 by                                  *****
*****                           self-reported                             *****
*****                              illness                                *****
*****                               group                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                            22 Sep 2013    16:05:06  *****
*******************************************************************************
*******************************************************************************


.  sts graph, surv by(illwgp) xline(52) ///
>   text(.5 51 "Chornobyl", orientation(vertical)) ///
>    title(Probability of no PTSD by number of illnesses self-reported)  ///
>    ytitle(Conditional prob. of no PTSD) ///
>    note("Stata analysis time 40 = 1980, 52=1986, 60=1990, 80=2000, 100=2010")  ///
>    legend(rows(6)) ci

         failure _d:  event == 1
   analysis time _t:  endate
  enter on or after:  time bgdate
  exit on or before:  time .
                 id:  id

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

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

.
.
.
.
.
. g mptsdyrs = ptsdhyrs/2 if gender==1
(288 missing values generated)

. g fptsdyrs = - ptsdhyrs/2 if gender==2
(210 missing values generated)

. g zero = 0

.
. title spine plot of years of ptsd reported


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                               spine                                 *****
*****                                plot                                 *****
*****                                 of                                  *****
*****                               years                                 *****
*****                                 of                                  *****
*****                                ptsd                                 *****
*****                              reported                               *****
*****                                                                     *****
*****                                                                     *****
*****                                            22 Sep 2013    16:05:08  *****
*******************************************************************************
*******************************************************************************


.
. twoway (bar mptsdyrs agegp, horizontal) || (bar fptsdyrs agegp, horizontal) || ///
>   (scatter agegp zero , msymbol(i) mlabel(agegp) ylabel(0 1 2, nogrid) legend(order(1 "male" 2 "female")) ///
>   mlabcolor(black) title(Years of PTSD reported by age group by gender) ytitle(Age range in years) ///
>   xlabel(-20 "20" -15 "15" -10 "10" -5 "5" 0 "0" 5 "5" 10 "10" 15 "15" 20 "20") ///
>   xtitle(Number of years respondent reported suffering PTSD) bcolor(sand sienna))

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

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

.
. graph box ptsdyrs, over(gender) title(Box Plots of PTSD years by gender)

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

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

.
.  title 3 way tabular analysis with extended MH test


*******************************************************************************
*******************************************************************************
*****                                                                     *****
*****                                                                     *****
*****                                 3                                   *****
*****                                way                                  *****
*****                              tabular                                *****
*****                              analysis                               *****
*****                                with                                 *****
*****                              extended                               *****
*****                                 MH                                  *****
*****                                test                                 *****
*****                                                                     *****
*****                                                                     *****
*****                                            22 Sep 2013    16:05:11  *****
*******************************************************************************
*******************************************************************************


.
. tab3way ptsdyrs agegp gender, rowpct


Table entries are cell frequencies and row percentages
Missing categories ignored

----------+-------------------------------------------------------------------------
          |                    respondent's gender and Age group
          | ------------- 1. male ------------    ------------ 2. female -----------
  ptsdyrs | 28 thru 42  43 thru 55  56 thru 84    28 thru 42  43 thru 55  56 thru 84
----------+-------------------------------------------------------------------------
        1 |          1                       1                                     2
          |      50.00                   50.00                                100.00
          |
        2 |         20          32          29            21          42          52
          |      24.69       39.51       35.80         18.26       36.52       45.22
          |
        3 |         10          19          24            12          32          39
          |      18.87       35.85       45.28         14.46       38.55       46.99
          |
        4 |          5           9          18             8          27          15
          |      15.62       28.12       56.25         16.00       54.00       30.00
          |
        5 |          2           3           8             5           8           7
          |      15.38       23.08       61.54         25.00       40.00       35.00
          |
        6 |                      3           4                         3           3
          |                  42.86       57.14                     50.00       50.00
          |
        7 |          2           2           4                         2           3
          |      25.00       25.00       50.00                     40.00       60.00
          |
        8 |          1           2           4                         2           2
          |      14.29       28.57       57.14                     50.00       50.00
          |
        9 |                                  1
          |                             100.00
          |
       10 |                                                            2           1
          |                                                        66.67       33.33
          |
       11 |                      2
          |                 100.00
          |
       14 |                      2
          |                 100.00
          |
       16 |                      1
          |                 100.00
          |
       17 |                                  1
          |                             100.00
----------+-------------------------------------------------------------------------

. emh ptsdyrs agegp, s(gender)

Extended Mantel-Haenszel (Cochran-Mantel-Haenszel) Stratified Test of Association

Correlation Statistic:
Q (1) =  1.3914, P = 0.2382
Transformation: Table Scores (Untransformed Data)


.
.