I am new to survival analysis using Stata and am trying to estimate a standard cox proportional hazard regression. For some reason though one of the standard errors is not estimated. Here is the dataex:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long case_number float(event tot type tot_cat male) byte(Black Hispanic Other age2534 age3544 age4554 age55plus edulhs edulcol educol edupg edumiss) 100064 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 100076 1 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 100079 1 1 1 1 0 0 0 0 1 0 0 0 0 1 0 0 0 100092 1 0 0 0 1 1 0 0 0 0 1 0 0 0 1 0 0 100095 1 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 100124 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 100127 1 5 1 3 0 0 0 0 0 1 0 0 1 0 0 0 0 100154 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 100181 1 0 0 0 1 1 0 0 0 0 1 0 0 0 1 0 0 100191 1 4 1 2 1 0 0 0 0 0 1 0 1 0 0 0 0 100195 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 100197 1 6 1 3 0 0 0 0 0 0 1 0 1 0 0 0 0 100210 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 100227 1 0 0 0 1 1 0 0 0 0 1 0 1 0 0 0 0 100256 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 100264 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 100269 1 2 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 100289 1 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 100302 1 2 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 100319 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 100330 1 1 1 1 1 0 0 0 1 0 0 0 0 1 0 0 0 100332 1 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 100337 1 1 1 1 1 0 0 0 1 0 0 0 0 0 1 0 0 100338 1 1 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 100339 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 100343 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 100344 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 100346 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 100357 1 3 1 2 0 0 0 0 0 0 0 1 0 0 1 0 0 100359 1 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 100372 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 1 100377 1 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 100386 1 1 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 100402 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 100408 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 100417 1 1 1 1 0 1 0 0 0 0 1 0 0 0 1 0 0 100423 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 100432 1 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 100438 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 100447 1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 100455 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 100461 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 100480 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 100487 1 9 1 4 1 0 0 0 0 0 0 0 0 0 0 0 0 100502 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 100507 1 4 1 2 1 0 0 0 1 0 0 0 0 1 0 0 0 100530 1 3 1 2 0 0 0 0 0 0 1 0 0 0 0 0 0 100540 1 1 1 1 1 0 0 0 1 0 0 0 0 1 0 0 0 100544 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 100562 1 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 100563 1 3 1 2 1 0 0 0 0 0 0 0 1 0 0 0 0 100568 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 100580 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 100595 1 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 100605 1 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 100618 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 100636 1 2 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 100638 1 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 100644 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 100652 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 100678 1 1 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 100691 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 100696 1 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 100710 1 5 1 3 1 0 0 0 0 0 1 0 0 0 0 0 0 100713 1 1 1 1 1 0 0 0 0 1 0 0 0 0 0 1 0 100715 1 2 1 1 1 0 0 0 0 1 0 0 1 0 0 0 0 100732 1 3 1 2 1 0 0 0 0 0 1 0 0 0 0 0 0 100734 1 0 0 0 1 1 0 0 0 0 1 0 0 0 1 0 0 100737 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 100761 1 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 100772 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 100794 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 100802 1 1 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 100840 1 2 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 100857 1 2 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 100861 1 3 1 2 0 0 0 0 0 1 0 0 0 0 0 0 0 100862 1 2 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 100864 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 100872 1 2 1 1 0 0 0 0 1 0 0 0 0 0 0 0 1 100882 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 100884 1 1 1 1 0 1 0 0 0 0 0 1 0 0 0 0 1 100891 1 5 1 3 1 0 0 0 0 1 0 0 0 0 0 0 0 100896 1 1 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 100908 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 100928 1 3 1 2 1 0 0 0 0 1 0 0 0 0 0 0 1 100933 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 100954 1 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 100965 1 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 100985 1 3 1 2 0 0 0 0 0 0 1 0 0 0 0 0 0 100996 1 1 1 1 0 1 0 0 0 1 0 0 0 0 0 0 1 101007 1 3 1 2 1 0 0 0 1 0 0 0 0 0 0 0 0 101013 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 101024 1 2 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 101029 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 0 0 101071 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 101082 1 2 1 1 1 0 0 0 1 0 0 0 0 1 0 0 0 101084 1 3 1 2 1 1 0 0 1 0 0 0 0 1 0 0 0 101085 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 101091 1 12 1 4 0 0 0 0 0 0 0 1 0 1 0 0 0 101112 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 end
tot | Freq. Percent Cum.
------------+-----------------------------------
0 | 871 38.66 38.66
1 | 542 24.06 62.72
2 | 316 14.03 76.74
3 | 189 8.39 85.13
4 | 114 5.06 90.19
5 | 65 2.89 93.08
6 | 41 1.82 94.90
7 | 38 1.69 96.58
8 | 27 1.20 97.78
9 | 8 0.36 98.14
10 | 5 0.22 98.36
11 | 9 0.40 98.76
12 | 6 0.27 99.02
13 | 3 0.13 99.16
14 | 5 0.22 99.38
15 | 2 0.09 99.47
16 | 4 0.18 99.64
17 | 2 0.09 99.73
19 | 2 0.09 99.82
20 | 1 0.04 99.87
21 | 1 0.04 99.91
22 | 1 0.04 99.96
38 | 1 0.04 100.00
------------+-----------------------------------
Total | 2,253 100.00
------------+-----------------------------------
0 | 871 38.66 38.66
1 | 542 24.06 62.72
2 | 316 14.03 76.74
3 | 189 8.39 85.13
4 | 114 5.06 90.19
5 | 65 2.89 93.08
6 | 41 1.82 94.90
7 | 38 1.69 96.58
8 | 27 1.20 97.78
9 | 8 0.36 98.14
10 | 5 0.22 98.36
11 | 9 0.40 98.76
12 | 6 0.27 99.02
13 | 3 0.13 99.16
14 | 5 0.22 99.38
15 | 2 0.09 99.47
16 | 4 0.18 99.64
17 | 2 0.09 99.73
19 | 2 0.09 99.82
20 | 1 0.04 99.87
21 | 1 0.04 99.91
22 | 1 0.04 99.96
38 | 1 0.04 100.00
------------+-----------------------------------
Total | 2,253 100.00
Code:
gen type=(tot>0)
Code:
recode tot (1/2=1) (3/4=2) (5/8=3) (9/38=4), gen(tot_cat)recotype tot_cat
Code:
. stset dur, id(case_number) failure(event==1) scale(1)
id: case_number
failure event: event == 1
obs. time interval: (dur[_n-1], dur]
exit on or before: failure
------------------------------------------------------------------------------
2,253 total observations
281 observations end on or before enter()
------------------------------------------------------------------------------
1,972 observations remaining, representing
1,972 subjects
1,972 failures in single-failure-per-subject data
78,376 total analysis time at risk and under observation
at risk from t = 0
earliest observed entry t = 0
last observed exit t = 52
.
end of do-file
. do "C:\Users\Sumedha\AppData\Local\Temp\STD3208_000000.tmp"
. stcox tot male Black Hispanic Other age2534 age3544 age4554 age55plus edulhs edulcol educol edupg edumiss empstud, no
> hr
failure _d: event == 1
analysis time _t: dur
id: case_number
Iteration 0: log likelihood = -13445.298
Iteration 1: log likelihood = -13325.559
Iteration 2: log likelihood = -13316.82
Iteration 3: log likelihood = -13316.713
Iteration 4: log likelihood = -13316.713
Refining estimates:
Iteration 0: log likelihood = -13316.713
Cox regression -- Breslow method for ties
No. of subjects = 1,918 Number of obs = 1,918
No. of failures = 1,918
Time at risk = 76464
LR chi2(15) = 257.17
Log likelihood = -13316.713 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
_t | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
tot | .0960208 .0049154 19.53 0.000 .0863868 .1056548
male | -.0705655 .0489316 -1.44 0.149 -.1664697 .0253387
Black | -.0197382 .0607501 -0.32 0.745 -.1388062 .0993299
Hispanic | -.0635071 .204539 -0.31 0.756 -.4643962 .337382
Other | -.147056 .1756267 -0.84 0.402 -.491278 .197166
age2534 | .0619619 .0853876 0.73 0.468 -.1053947 .2293185
age3544 | -.0508297 .0882918 -0.58 0.565 -.2238785 .1222192
age4554 | -.1089686 .0886928 -1.23 0.219 -.2828033 .064866
age55plus | -.120924 .0961707 -1.26 0.209 -.3094151 .067567
edulhs | -.0368119 .0586314 -0.63 0.530 -.1517273 .0781035
edulcol | -.0177244 .0746792 -0.24 0.812 -.164093 .1286442
educol | -.0496405 .0942559 -0.53 0.598 -.2343786 .1350976
edupg | -.0267162 .2407701 -0.11 0.912 -.498617 .4451846
edumiss | -.0141879 .0757348 -0.19 0.851 -.1626254 .1342496
empstud | -.1566901 .0507535 -3.09 0.002 -.2561652 -.057215
------------------------------------------------------------------------------
. stcox i.tot_cat male Black Hispanic Other age2534 age3544 age4554 age55plus edulhs edulcol educol edupg edumiss, nohr
failure _d: event == 1
analysis time _t: dur
id: case_number
Iteration 0: log likelihood = -13871.757
Iteration 1: log likelihood = -12734.904
Iteration 2: log likelihood = -12569.655
Iteration 3: log likelihood = -12534.636
Iteration 4: log likelihood = -12527.617
Iteration 5: log likelihood = -12525.127
Iteration 6: log likelihood = -12524.22
Iteration 7: log likelihood = -12523.888
Iteration 8: log likelihood = -12523.766
Iteration 9: log likelihood = -12523.721
Iteration 10: log likelihood = -12523.704
Iteration 11: log likelihood = -12523.698
Iteration 12: log likelihood = -12523.696
Iteration 13: log likelihood = -12523.695
Iteration 14: log likelihood = -12523.695
Iteration 15: log likelihood = -12523.695
Iteration 16: log likelihood = -12523.695 (backed up)
Iteration 17: log likelihood = -12523.695
Iteration 18: log likelihood = -12523.694
Iteration 19: log likelihood = -12523.694
Iteration 20: log likelihood = -12523.693
Iteration 21: log likelihood = -12523.696 (backed up)
Refining estimates:
Iteration 0: log likelihood = -12523.695
Iteration 1: log likelihood = -12523.695
Iteration 2: log likelihood = -12523.695
Iteration 3: log likelihood = -12523.695
Iteration 4: log likelihood = -12523.695
Iteration 5: log likelihood = -12523.695
Iteration 6: log likelihood = -12523.695
Cox regression -- Breslow method for ties
No. of subjects = 1,972 Number of obs = 1,972
No. of failures = 1,972
Time at risk = 78376
LR chi2(16) = 2696.13
Log likelihood = -12523.695 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
_t | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
tot_cat |
1 | 26.23135 .1499912 174.89 0.000 25.93737 26.52533
2 | 25.82186 .1547281 166.89 0.000 25.5186 26.12512
3 | 25.34002 .1617857 156.63 0.000 25.02293 25.65712
4 | 25.09946 . . . . .
|
male | .0789911 .0483001 1.64 0.102 -.0156753 .1736575
Black | -.037212 .0600565 -0.62 0.536 -.1549206 .0804966
Hispanic | .0511079 .2037287 0.25 0.802 -.3481929 .4504087
Other | .0108578 .1729652 0.06 0.950 -.3281478 .3498634
age2534 | -.1162275 .084623 -1.37 0.170 -.2820855 .0496304
age3544 | -.0931516 .0868272 -1.07 0.283 -.2633297 .0770265
age4554 | -.0696997 .087131 -0.80 0.424 -.2404734 .101074
age55plus | -.0783454 .0943127 -0.83 0.406 -.2631948 .1065041
edulhs | -.0138597 .0576137 -0.24 0.810 -.1267805 .0990611
edulcol | .042249 .0745802 0.57 0.571 -.1039254 .1884234
educol | .049197 .0942711 0.52 0.602 -.135571 .2339649
edupg | -.057499 .2402637 -0.24 0.811 -.5284072 .4134093
edumiss | .0892369 .0683832 1.30 0.192 -.0447918 .2232656
------------------------------------------------------------------------------
. stcox type male Black Hispanic Other age2534 age3544 age4554 age55plus edulhs edulcol educol edupg edumiss empstud, n
> ohr
failure _d: event == 1
analysis time _t: dur
id: case_number
Iteration 0: log likelihood = -13445.298
Iteration 1: log likelihood = -12336.382
Iteration 2: log likelihood = -12247.619
Iteration 3: log likelihood = -12220.996
Iteration 4: log likelihood = -12211.957
Iteration 5: log likelihood = -12208.731
Iteration 6: log likelihood = -12207.558
Iteration 7: log likelihood = -12207.128
Iteration 8: log likelihood = -12206.97
Iteration 9: log likelihood = -12206.912
Iteration 10: log likelihood = -12206.89
Iteration 11: log likelihood = -12206.883
Iteration 12: log likelihood = -12206.88
Iteration 13: log likelihood = -12206.879
Iteration 14: log likelihood = -12206.878
Iteration 15: log likelihood = -12206.878
Iteration 16: log likelihood = -12206.878
Iteration 17: log likelihood = -12206.878
Iteration 18: log likelihood = -12206.878
Iteration 19: log likelihood = -12206.878
Refining estimates:
Iteration 0: log likelihood = -12206.878
Iteration 1: log likelihood = -12206.878
Iteration 2: log likelihood = -12206.878
Iteration 3: log likelihood = -12206.878
Iteration 4: log likelihood = -12206.878
Iteration 5: log likelihood = -12206.878
Iteration 6: log likelihood = -12206.878
Iteration 7: log likelihood = -12206.878
Iteration 8: log likelihood = -12206.878
Iteration 9: log likelihood = -12206.878
Iteration 10: log likelihood = -12206.878
Iteration 11: log likelihood = -12206.878
Iteration 12: log likelihood = -12206.878
Iteration 13: log likelihood = -12206.878
Iteration 14: log likelihood = -12206.878
Iteration 15: log likelihood = -12206.878
Iteration 16: log likelihood = -12206.878
Iteration 17: log likelihood = -12206.878
Iteration 18: log likelihood = -12206.878
Iteration 19: log likelihood = -12206.878
Iteration 20: log likelihood = -12206.878
Iteration 21: log likelihood = -12206.878
Iteration 22: log likelihood = -12206.878
Iteration 23: log likelihood = -12206.878
Cox regression -- Breslow method for ties
No. of subjects = 1,918 Number of obs = 1,918
No. of failures = 1,918
Time at risk = 76464
LR chi2(14) = 2476.84
Log likelihood = -12206.878 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
_t | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
type | 41.42786 . . . . .
male | .0959389 .048961 1.96 0.050 -.0000229 .1919007
Black | -.0421008 .0608911 -0.69 0.489 -.1614451 .0772436
Hispanic | .067613 .2037077 0.33 0.740 -.3316468 .4668728
Other | -.0025301 .1757478 -0.01 0.989 -.3469895 .3419294
age2534 | -.0763014 .0853566 -0.89 0.371 -.2435973 .0909945
age3544 | -.0684269 .0875539 -0.78 0.434 -.2400293 .1031756
age4554 | -.0872988 .0882541 -0.99 0.323 -.2602736 .085676
age55plus | -.0830078 .0955541 -0.87 0.385 -.2702904 .1042747
edulhs | -.0107608 .0583419 -0.18 0.854 -.1251088 .1035873
edulcol | .0899122 .0747195 1.20 0.229 -.0565353 .2363597
educol | .1073924 .0945303 1.14 0.256 -.0778835 .2926684
edupg | .0172314 .2404049 0.07 0.943 -.4539536 .4884164
edumiss | .0313791 .076609 0.41 0.682 -.1187718 .1815301
empstud | -.0228335 .0514697 -0.44 0.657 -.1237123 .0780453
------------------------------------------------------------------------------Sincerely,
Sumedha.
0 Response to Missing SE in cox regression.
Post a Comment