Using your preferred software package, if you need to (e.g., as in STATA with the stset command or load the survival, eha, or asaur packages in R), specify (1) the variable that measures the time each person was exposed to the risk of death before dying/being censored for other reasons; (2) the variable that indicates whether the event occurred or not (i.e., whether the person died in the interval); as well as (3) the time in which the person entered and exited the risk set.

  1. The time at risk is calculated using the interview date (yrint, moint) and the censoring date (yrcensor, mocensor).

  2. The variable that indicates whether the the event occurred or not is died0124.

  3. The time in which the person entered/exited the risk set is shown as exposure_months (I think?).

After doing this (or, without it, if your package does not require it):

Obtain a table with the Kaplan-Meier survival function as well as its standard errors and the cumulative hazard function.

##            time       surv      std_err cumulative_hazard
## 1   -0.66666667 0.99989368 0.0001063208      0.0001063151
## 2   -0.50000000 0.99978737 0.0001503683      0.0002126415
## 3   -0.16666667 0.99957474 0.0002126755      0.0004253170
## 4   -0.08333333 0.99946842 0.0002377910      0.0005316773
## 5    0.00000000 0.99787370 0.0004759620      0.0021272523
## 6    0.08333333 0.99734212 0.0005322834      0.0026599606
## 7    0.16666667 0.99596003 0.0006566983      0.0040457403
## 8    0.25000000 0.99415267 0.0007907694      0.0058604286
## 9    0.33333333 0.99298320 0.0008667544      0.0070367734
## 10   0.41666667 0.99106953 0.0009787744      0.0089639683
## 11   0.50000000 0.98926217 0.0010742368      0.0107876113
## 12   0.58333333 0.98819902 0.0011267675      0.0118623023
## 13   0.66666667 0.98628535 0.0012158741      0.0137988273
## 14   0.75000000 0.98490325 0.0012765635      0.0152001424
## 15   0.83333333 0.98309492 0.0013521384      0.0170361938
## 16   0.91666667 0.98138816 0.0014202063      0.0187723049
## 17   1.00000000 0.97879846 0.0015191749      0.0214111174
## 18   1.08333333 0.97660875 0.0015995913      0.0236482539
## 19   1.16666667 0.97474206 0.0016655368      0.0255596549
## 20   1.25000000 0.97232634 0.0017475384      0.0280379696
## 21   1.33333333 0.97013024 0.0018192125      0.0302965806
## 22   1.41666667 0.96892238 0.0018575877      0.0315416287
## 23   1.50000000 0.96716549 0.0019121962      0.0333548653
## 24   1.58333333 0.96540861 0.0019654786      0.0351713957
## 25   1.66666667 0.96376097 0.0020143539      0.0368780745
## 26   1.75000000 0.96156386 0.0020779971      0.0391577964
## 27   1.83333333 0.95738506 0.0021948233      0.0435036335
## 28   1.91666667 0.95284139 0.0023171596      0.0482495532
## 29   2.00000000 0.94911361 0.0024155464      0.0521618235
## 30   2.08333333 0.94600930 0.0024964732      0.0554325685
## 31   2.16666667 0.94519936 0.0025173766      0.0562887329
## 32   2.25000000 0.94404146 0.0025470456      0.0575137727
## 33   2.33333333 0.94299934 0.0025735165      0.0586176608
## 34   2.41666667 0.94126248 0.0026171673      0.0604595076
## 35   2.50000000 0.94033616 0.0026402174      0.0614436385
## 36   2.58333333 0.93917825 0.0026688131      0.0626750139
## 37   2.66666667 0.93744139 0.0027112709      0.0645243543
## 38   2.75000000 0.93663085 0.0027309117      0.0653889789
## 39   2.83333333 0.93524137 0.0027643350      0.0668724750
## 40   2.91666667 0.93396767 0.0027947078      0.0682343667
## 41   3.00000000 0.93269397 0.0028248356      0.0695981158
## 42   3.08333333 0.93072553 0.0028709337      0.0717086062
## 43   3.16666667 0.92922025 0.0029058209      0.0733259239
## 44   3.25000000 0.92759918 0.0029430536      0.0750704722
## 45   3.33333333 0.92574653 0.0029851930      0.0770677260
## 46   3.41666667 0.92458862 0.0030113151      0.0783185077
## 47   3.50000000 0.92366230 0.0030320974      0.0793203863
## 48   3.58333333 0.92227281 0.0030630837      0.0808247112
## 49   3.66666667 0.92053595 0.0031015104      0.0827079504
## 50   3.75000000 0.91787276 0.0031597994      0.0856010321
## 51   3.83333333 0.91659907 0.0031874176      0.0869886945
## 52   3.91666667 0.91532537 0.0032148744      0.0883782852
## 53   4.00000000 0.91266218 0.0032717818      0.0912878362
## 54   4.08333333 0.91115690 0.0033036577      0.0929371637
## 55   4.16666667 0.90930425 0.0033426148      0.0949704590
## 56   4.25000000 0.90698844 0.0033909011      0.0975172564
## 57   4.33333333 0.90455683 0.0034411329      0.1001982215
## 58   4.41666667 0.90305156 0.0034719980      0.1018623280
## 59   4.50000000 0.90154628 0.0035026928      0.1035292084
## 60   4.58333333 0.89969363 0.0035402446      0.1055841788
## 61   4.66666667 0.89876730 0.0035589294      0.1066137799
## 62   4.75000000 0.89691465 0.0035961220      0.1086751043
## 63   4.83333333 0.89529358 0.0036284772      0.1104824887
## 64   4.91666667 0.89367251 0.0036606623      0.1122931457
## 65   5.00000000 0.89193565 0.0036949634      0.1142366544
## 66   5.08333333 0.88996721 0.0037336163      0.1164435868
## 67   5.16666667 0.88904088 0.0037517268      0.1174844403
## 68   5.25000000 0.88660928 0.0037990334      0.1202195275
## 69   5.33333333 0.88452505 0.0038393216      0.1225703177
## 70   5.41666667 0.88209344 0.0038860330      0.1253193686
## 71   5.50000000 0.87989342 0.0039280359      0.1278134615
## 72   5.58333333 0.87815656 0.0039610281      0.1297874055
## 73   5.66666667 0.87618812 0.0039982461      0.1320289667
## 74   5.75000000 0.87456705 0.0040287624      0.1338791054
## 75   5.83333333 0.87352493 0.0040483178      0.1350706849
## 76   5.91666667 0.87086174 0.0040980783      0.1381194654
## 77   6.00000000 0.86912488 0.0041303699      0.1401138810
## 78   6.08333333 0.86715644 0.0041668189      0.1423787358
## 79   6.16666667 0.86495642 0.0042073759      0.1449157902
## 80   6.25000000 0.86345114 0.0042350194      0.1466560847
## 81   6.33333333 0.86194485 0.0042626161      0.1484005828
## 82   6.41666667 0.85939506 0.0043091579      0.1513587649
## 83   6.50000000 0.85742450 0.0043449772      0.1536517241
## 84   6.58333333 0.85603352 0.0043701830      0.1552740034
## 85   6.66666667 0.85383113 0.0044099634      0.1578467861
## 86   6.75000000 0.85081734 0.0044641536      0.1613765173
## 87   6.83333333 0.84896270 0.0044973655      0.1635563538
## 88   6.91666667 0.84699214 0.0045325441      0.1658774898
## 89   7.00000000 0.84432609 0.0045799662      0.1690251564
## 90   7.08333333 0.84200779 0.0046210479      0.1717709005
## 91   7.16666667 0.83968948 0.0046619914      0.1745242045
## 92   7.25000000 0.83644386 0.0047190906      0.1783894723
## 93   7.33333333 0.83400964 0.0047617530      0.1812996718
## 94   7.41666667 0.83261866 0.0047860717      0.1829674967
## 95   7.50000000 0.83111176 0.0048123694      0.1847773255
## 96   7.58333333 0.82867754 0.0048547491      0.1877061958
## 97   7.66666667 0.82659107 0.0048909786      0.1902240304
## 98   7.75000000 0.82404094 0.0049351439      0.1933091517
## 99   7.83333333 0.82264995 0.0049591827      0.1949971529
## 100  7.91666667 0.82056348 0.0049951752      0.1975334358
## 101  8.00000000 0.81789743 0.0050410556      0.2007824823
## 102  8.08333333 0.81581096 0.0050768795      0.2033335027
## 103  8.16666667 0.81395632 0.0051086647      0.2056068758
## 104  8.25000000 0.81117435 0.0051562444      0.2090247055
## 105  8.33333333 0.80897196 0.0051938318      0.2117397669
## 106  8.41666667 0.80561042 0.0052510739      0.2158950900
## 107  8.50000000 0.80282846 0.0052983363      0.2193483275
## 108  8.58333333 0.79981467 0.0053494319      0.2231022980
## 109  8.66666667 0.79761228 0.0053867058      0.2258559212
## 110  8.75000000 0.79633721 0.0054082615      0.2274545260
## 111  8.83333333 0.79448257 0.0054395854      0.2297834926
## 112  8.91666667 0.79251201 0.0054728298      0.2322637960
## 113  9.00000000 0.78949822 0.0055236042      0.2360666335
## 114  9.08333333 0.78764357 0.0055548105      0.2384157746
## 115  9.16666667 0.78520935 0.0055957261      0.2415062824
## 116  9.25000000 0.78242739 0.0056424315      0.2450492407
## 117  9.33333333 0.77929768 0.0056949105      0.2490492407
## 118  9.41666667 0.77639980 0.0057434470      0.2527678187
## 119  9.50000000 0.77373375 0.0057880583      0.2562016796
## 120  9.58333333 0.77199502 0.0058171329      0.2584488706
## 121  9.66666667 0.76990855 0.0058520036      0.2611515733
## 122  9.75000000 0.76816982 0.0058810481      0.2634099292
## 123  9.83333333 0.76619927 0.0059139509      0.2659751925
## 124  9.91666667 0.76434462 0.0059449056      0.2683957674
## 125 10.00000000 0.76283773 0.0059700482      0.2703672567
## 126 10.08333333 0.75959210 0.0060241802      0.2746219292
## 127 10.16666667 0.75727380 0.0060628310      0.2776739664
## 128 10.25000000 0.75402817 0.0061169263      0.2819598994
## 129 10.33333333 0.75159396 0.0061574891      0.2851881853
## 130 10.41666667 0.74962340 0.0061903223      0.2878100237
## 131 10.50000000 0.74788467 0.0062192914      0.2901294918
## 132 10.58333333 0.74452313 0.0062752986      0.2946242221
## 133 10.66666667 0.74243666 0.0063100642      0.2974266509
## 134 10.75000000 0.74000244 0.0063506290      0.3007053394
## 135 10.83333333 0.73745230 0.0063931339      0.3041514547
## 136 10.91666667 0.73536583 0.0064279189      0.3069807536
## 137 11.00000000 0.73374302 0.0064549801      0.3091875632
## 138 11.08333333 0.73130880 0.0064955839      0.3125050988
## 139 11.16666667 0.72922200 0.0065304111      0.3153586181
## 140 11.25000000 0.72608481 0.0065829109      0.3196607214
## 141 11.33333333 0.72338735 0.0066285013      0.3233757916
## 142 11.41666667 0.72102450 0.0066687508      0.3266421643
## 143 11.50000000 0.71877684 0.0067071075      0.3297594736
## 144 11.58333333 0.71581940 0.0067576082      0.3338740226
## 145 11.66666667 0.71191558 0.0068243308      0.3393276667
## 146 11.75000000 0.71037771 0.0068506366      0.3414878528
## 147 11.83333333 0.70907643 0.0068729054      0.3433196596
## 148 11.91666667 0.70765686 0.0068972096      0.3453216616
## 149 12.00000000 0.70611899 0.0069235525      0.3474948478
## 150 12.08333333 0.70422623 0.0069559944      0.3501753638
## 151 12.16666667 0.70245176 0.0069864297      0.3526951018
## 152 12.25000000 0.70115049 0.0070087623      0.3545475773
## 153 12.33333333 0.69842872 0.0070555274      0.3584294339
## 154 12.41666667 0.69523198 0.0071105511      0.3630064808
## 155 12.50000000 0.69239043 0.0071595280      0.3670936743
## 156 12.58333333 0.69037767 0.0071942602      0.3700006510
## 157 12.66666667 0.68777292 0.0072392595      0.3737735888
## 158 12.75000000 0.68552336 0.0072781716      0.3770443755
## 159 12.83333333 0.68398419 0.0073048227      0.3792896259
## 160 12.91666667 0.68280021 0.0073253390      0.3810206282
## 161 13.00000000 0.68137943 0.0073499766      0.3831014328
## 162 13.08333333 0.67877468 0.0073951981      0.3869241956
## 163 13.16666667 0.67711711 0.0074240120      0.3893661980
## 164 13.25000000 0.67557794 0.0074507938      0.3916393227
## 165 13.33333333 0.67131562 0.0075250949      0.3979484710
## 166 13.41666667 0.66444855 0.0076452471      0.4081777479
## 167 13.50000000 0.65663429 0.0077826951      0.4199382610
## 168 13.58333333 0.64503130 0.0079883545      0.4376086541
## 169 13.66666667 0.63544108 0.0081599044      0.4524764955
## 170 13.75000000 0.62750843 0.0083029787      0.4649601922
## 171 13.83333333 0.62028616 0.0084342356      0.4764696262
## 172 13.91666667 0.61152472 0.0085948270      0.4905944591
## 173 14.00000000 0.60169770 0.0087768521      0.5066641590
## 174 14.08333333 0.59565823 0.0088898054      0.5167015533
## 175 14.16666667 0.58688983 0.0090554226      0.5314220625
## 176 14.25000000 0.57856853 0.0092148739      0.5456007135
## 177 14.33333333 0.57289984 0.0093261242      0.5553985038
## 178 14.41666667 0.56958259 0.0093928468      0.5611887676
## 179 14.50000000 0.56896643 0.0094053110      0.5622705503
## 180 14.58333333 0.56847339 0.0094152943      0.5631371015
## 181 14.66666667 0.56724079 0.0094402819      0.5653053582
## 182 14.75000000 0.56674776 0.0094502887      0.5661745455
## 183 14.83333333 0.56662450 0.0094527915      0.5663920314
## 184 14.91666667 0.56637798 0.0094577984      0.5668270977
## 185 15.16666667 0.56613146 0.0094628069      0.5672623534
## 186 15.25000000 0.56600820 0.0094653119      0.5674800761
## 187 15.33333333 0.56576168 0.0094703230      0.5679156161
## 188 15.41666667 0.56551516 0.0094753358      0.5683513460
## 189 15.58333333 0.56539190 0.0094778429      0.5685693059
## 190 15.66666667 0.56514538 0.0094828583      0.5690053207
## 191 15.75000000 0.56477560 0.0094903847      0.5696596282
## 192 16.08333333 0.56465234 0.0094928943      0.5698778735
## 193 16.33333333 0.56440582 0.0094979149      0.5703144594
## 194 16.41666667 0.56391278 0.0095079613      0.5711880126
## 195 16.50000000 0.56378953 0.0095104740      0.5714065918
## 196 16.58333333 0.56255693 0.0095356249      0.5735928621
## 197 16.66666667 0.56206389 0.0095456974      0.5744692862
## 198 16.75000000 0.56157085 0.0095557771      0.5753464792
## 199 16.83333333 0.56144759 0.0095582981      0.5755659700
## 200 16.91666667 0.56107781 0.0095658638      0.5762245869
## 201 17.00000000 0.56070803 0.0095734334      0.5768836379
## 202 17.08333333 0.56046152 0.0095784821      0.5773232949
## 203 17.16666667 0.56009174 0.0095860584      0.5779830706
## 204 17.25000000 0.55935153 0.0096012499      0.5793046565
## 205 17.33333333 0.55749198 0.0096396713      0.5826291246
## 206 17.41666667 0.55499928 0.0096916132      0.5871003967
## 207 17.50000000 0.55199996 0.0097545304      0.5925045849
## 208 17.58333333 0.55024996 0.0097913767      0.5956748748
## 209 17.66666667 0.54849996 0.0098283186      0.5988552473
## 210 17.75000000 0.54662496 0.0098680066      0.6022736612
## 211 17.83333333 0.54424996 0.0099184400      0.6066185046
## 212 17.91666667 0.54224996 0.0099610525      0.6102932864
## 213 18.00000000 0.54087496 0.0099904250      0.6128290171
## 214 18.08333333 0.53999996 0.0100091493      0.6144467661
## 215 18.16666667 0.53762496 0.0100601023      0.6188449143
## 216 18.25000000 0.53562496 0.0101031588      0.6225649794
## 217 18.33333333 0.53312496 0.0101571737      0.6272324240
## 218 18.41666667 0.53049996 0.0102141253      0.6321562223
## 219 18.50000000 0.52812496 0.0102658648      0.6366331309
## 220 18.58333333 0.52574996 0.0103178087      0.6411301723
## 221 18.66666667 0.52324996 0.0103727109      0.6458852841
## 222 18.75000000 0.52087496 0.0104250847      0.6504242234
## 223 18.83333333 0.51749996 0.0104998801      0.6569037050
## 224 18.91666667 0.51399996 0.0105779133      0.6636669901
## 225 19.00000000 0.51024996 0.0106620608      0.6709627099
## 226 19.08333333 0.50587496 0.0107609574      0.6795369382
## 227 19.16666667 0.50274997 0.0108320871      0.6857143536
## 228 19.25000000 0.49937497 0.0109093758      0.6924274317
## 229 19.33333333 0.49474997 0.0110160993      0.7016890086
## 230 19.41666667 0.48662497 0.0112059313      0.7181114442
## 231 19.50000000 0.47649997 0.0114468806      0.7389180201
## 232 19.58333333 0.46937497 0.0116195169      0.7538708008
## 233 19.66666667 0.46212497 0.0117979310      0.7693168727
## 234 19.75000000 0.45387497 0.0120044914      0.7871691854
## 235 19.83333333 0.44574997 0.0122117909      0.8050705900
## 236 19.91666667 0.44012497 0.0123576621      0.8176897711
## 237 20.00000000 0.43212497 0.0125686014      0.8358664255
## 238 20.08333333 0.42474997 0.0127668457      0.8529332464
## 239 20.16666667 0.41724997 0.0129723620      0.8705906920
## 240 20.25000000 0.40987276 0.0131786144      0.8882712434
## 241 20.33333333 0.40397260 0.0133472538      0.9026663429
## 242 20.41666667 0.39926341 0.0134857414      0.9143235578
## 243 20.50000000 0.39601842 0.0135841482      0.9224509960
## 244 20.58333333 0.39457835 0.0136284839      0.9260873596
## 245 20.66666667 0.39300685 0.0136770871      0.9300701011
## 246 20.75000000 0.39182822 0.0137136812      0.9330691014
## 247 20.83333333 0.39091151 0.0137422279      0.9354086736
## 248 20.91666667 0.38947096 0.0137872380      0.9390937658
## 249 21.00000000 0.38750659 0.0138489156      0.9441374779
## 250 21.08333333 0.38619700 0.0138902286      0.9475169980
## 251 21.16666667 0.38410166 0.0139566575      0.9529425660
## 252 21.25000000 0.38226761 0.0140151578      0.9577174637
## 253 21.33333333 0.38082262 0.0140615991      0.9614975324
## 254 21.41666667 0.38016398 0.0140828919      0.9632270378
## 255 21.50000000 0.38003221 0.0140871584      0.9635736582
## 256 21.58333333 0.37990044 0.0140914265      0.9639203989
## 257 21.66666667 0.37884626 0.0141256320      0.9666952862
## 258 21.75000000 0.37871448 0.0141299152      0.9670431122
## 259 22.16666667 0.37871448 0.0141299152      0.9670431122
## 260 22.25000000 0.37871448 0.0141299152      0.9670431122
## 261 22.33333333 0.37871448 0.0141299152      0.9670431122
## 262 22.41666667 0.37871448 0.0141299152      0.9670431122
## 263 22.50000000 0.37871448 0.0141299152      0.9670431122
## 264 22.58333333 0.37871448 0.0141299152      0.9670431122
## 265 23.08333333 0.37853834 0.0141375719      0.9675082285
## 266 23.16666667 0.37836128 0.0141453105      0.9679759554
## 267 23.25000000 0.37692945 0.0142086847      0.9717602505
## 268 23.33333333 0.37362124 0.0143785882      0.9805369922
## 269 23.41666667 0.37327239 0.0144089008      0.9814706990
## 270 23.50000000 0.37327239 0.0144089008      0.9814706990
## 271 24.16666667 0.37327239 0.0144089008      0.9814706990
## 272 24.41666667 0.37327239 0.0144089008      0.9814706990
## 273 24.58333333 0.33179768 0.1187287047      1.0925818101
## 274 24.75000000 0.29032297 0.1787558339      1.2175818101
## 275 25.66666667 0.20737355 0.2984903773      1.5032960958
## 276 26.66666667 0.16589884 0.3729564389      1.7032960958
## 277 27.58333333 0.12442413 0.4716246799      1.9532960958
## 278 27.75000000 0.08294942 0.6237760057      2.2866294291
## 279 28.58333333 0.00000000          Inf      3.2866294291

EXTRA CREDIT: Using Excel, calculate the Kaplan-Meier function, its standard errors, and the cumulative hazard based on the output (from e.g., the sts function in Stata), which gives the timing of events and population at risk.

Using the built-in functions in your statistical software, graph the survival, cumulative hazard, and (smoothed, estimated) hazard.

Finally, graph the survival function by sex/gender, locality size, and schooling levels.

Do they appear to be different for these groups? Is there a more formal test (i.e., that provides statistical significance) to compare them (e.g., using the sts command) otherwise?

Write an interpretation of all of your findings if you have not done interpretation in each of the questions. If you did, you’re good to go.

Does this analysis adopt a truly longitudinal view or a synthetic cohort perspective? What makes you state that?