Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cox-Snell residuals for survival data after using streg

    Dear all,

    I am currently working on my master's thesis about venture capital investments in biotech companies. I'm using Stata 12 for my analysis. I am trying to measure the effect of several factors on the time to exit (DURATION) of an investment using a competing risks model. I am considering three different exit possibilities for the venture capital companies: IPO (value for exit = 1), TRADESALE (value for exit = 2) and LIQUIDATION (value for exit = 3). Investments that have not been excited have been assigned the value 0 for the variable EXIT. I used the following code in order to declare my data set to be survival data (in this case IPO is the exit of interest):

    stset DURATION, failure(EXIT==1) id(CompanyID) exit(EXITDATE)
    I use the id function because some firms received several investments from venture capital companies. I then used the Akaike Information Criterion to find the parametric model that fits my data the best. I got the lowest AIC value for the log-normal model and decided to use it for my analysis with the following code:

    streg EARLY USAHQ AMOUNT SYNSIZE CVC AGE IPOACTIVITY, dist(ln)
    Afterwards i wanted to use Cox-Snell residuals to assess the overall model fit. I followed the instructions from the Survival Analysis Reference Manual and used the following code:

    predict double cs, csnell partial

    stset cs, failure (EXIT==1)

    sts generate km=s

    generate double H=-ln(km)

    line H cs cs, sort
    I used "csnell partial" because i have several observations for some firms and i read in the forum that you need to use partial in that case when calculating the Cox-Snell residuals. Stata gives me the attached graph and there appears to be a problem, since the cumulative hazard function at some point is just a horizontal line. I also tried using a Cox Proportional Hazards Model with stxoc, but the result is similar. Can someone please help me and explain to me what is happening here? Here is some of the data i'm using:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str9 CompanyID byte EXIT int(EXITDATE DealDate DURATION) byte(EARLY USAHQ) double AMOUNT byte(SYNSIZE CVC) int(AGE IPOACTIVITY)
    "12868-93" 2 17714 15139 2575 1 0             13.59  5 0 17  80
    "12673-90" 2 18374 17702  672 0 0              28.9  2 0 24  21
    "12673-90" 2 18374 16184 2190 1 0             10.05  2 0 21 174
    "12673-90" 2 18374 16120 2254 1 0              2.59  1 0 20 174
    "12673-90" 2 18374 15179 3195 1 0              4.94  1 0 17  80
    "59167-72" 2 17198 16040 1158 0 0             35.62 10 1 23  63
    "59167-72" 2 17198 14797 2401 1 0             17.82  7 1 20 381
    "54859-78" 2 17034 16929  105 0 0                 4  3 0 22 157
    "11376-10" 2 16707 16485  222 1 0                .7  5 0 21 161
    "61635-79" 2 16420 16120  300 1 0              26.7  3 0 20 174
    "61635-79" 2 16420 15193 1227 1 0                30  9 1 17  80
    "11025-46" 0 20667 17205 3462 0 0                40  7 0 23 159
    "11025-46" 0 20667 16112 4555 1 0                14  7 0 20 174
    "56626-93" 2 18141 16938 1203 0 0              11.7  7 1 24 157
    "56626-93" 2 18141 14930 3211 1 0              17.5  5 1 18 381
    "57078-64" 0 20667 16215 4452 1 0               9.8  7 0 20 174
    "57078-64" 0 20667 14915 5752 1 0              28.6  6 0 16 381
    "56582-47" 2 18544 15810 2734 0 0               4.3  3 0 31  63
    "52914-61" 0 20667 19807  860 1 1             10.85  6 1 29 206
    "52914-61" 0 20667 18906 1761 1 1             29.24  6 1 26  81
    "52914-61" 0 20667 17646 3021 1 1              2.82  2 0  9  21
    "52914-61" 0 20667 17501 3166 1 1               5.5  2 0  8 159
    "51390-37" 2 20251 17778 2473 0 1              2.78  1 0  6  21
    "51390-37" 2 20251 17330 2921 1 1              5.96  2 0 11 159
    "51390-37" 2 20251 16915 3336 1 1              2.19  2 0 10 157
    "51390-37" 2 20251 16222 4029 1 1               .71  1 0  2 174
    "54105-58" 2 19074 18903  171 1 1             10.95  2 0 10  81
    "54105-58" 2 19074 17889 1185 1 1              5.95  2 0  9  21
    "52856-83" 2 15355 12235 3120 1 1             12.81  7 0 20 509
    "40461-58" 0 20667 15278 5389 1 0              2.08  2 1 28  80
    "40461-58" 0 20667 16236 4431 1 0             15.06  4 0 31 174
    "40461-58" 0 20667 16894 3773 0 0             43.21  5 0 33 157
    "13366-81" 2 14322 12190 2132 1 1              7.26  3 0 20 509
    "54715-42" 2 14144 13362  782 1 1              9.39  3 0 23 675
    "54708-22" 2 19556 16754 2802 1 0              8.83  2 0 32 161
    "54708-22" 2 19556 17440 2116 0 0             22.49  5 1 34 159
    "52912-18" 2 13143 12732  411 1 1              9.39 11 0 25 403
    "52932-61" 2 16730 16056  674 1 1             13.28  6 0 30  63
    "50841-19" 1 13118 12596  522 1 1              8.79  8 0 29 403
    "53713-09" 2 20117 17171 2946 1 0              13.5  5 0 34 159
    "54709-30" 2 16272 15035 1237 1 1              4.07  3 0 28  80
    "42984-82" 2 17192 16343  849 1 1              11.8  4 0 31 174
    "13171-78" 0 20667 17489 3178 1 1              5.45  2 0 17 159
    "52896-70" 2 14791 13769 1022 0 1             10.52  6 0 28 473
    "42935-86" 0 20667 17485 3182 1 1                12  4 0 23 159
    "61021-81" 2 18168 16987 1181 0 1              5.01  4 0 26 157
    "61021-81" 2 18168 16420 1748 1 1             22.25  7 1 31 174
    "61021-81" 2 18168 15616 2552 1 1             19.48  6 1 22  66
    "55201-78" 2 19767 17181 2586 1 0             14.25  5 0 26 159
    "57256-48" 2 17073 14949 2124 1 0             16.27  3 0 19 381
    "59922-73" 0 20667 19680  987 1 0               .65  1 0 32 157
    "55170-46" 2 17884 17095  789 1 0             14.86  7 1 25 157
    "42705-28" 2 17098 16561  537 1 1 22.00772200772201  7 1 37 161
    "42705-28" 2 17098 16266  832 1 1              5.05  2 1  8 174
    "54076-42" 2 15007 14579  428 0 1              8.51  5 0 19 476
    "10826-56" 3 17348 15825 1523 0 1             28.55  8 1 31  63
    "10826-56" 3 17348 14914 2434 1 1             36.24  8 0 14 381
    "10826-56" 3 17348 14410 2938 1 1             10.59  4 0 10 476
    "53785-27" 0 20667 15327 5340 1 1              5.61  6 1 36  80
    "42935-86" 0 20667 16953 3714 1 1             17.92  4 0 25 157
    "52729-30" 2 17518 15404 2114 0 1             48.87  6 0 16  66
    "59167-90" 2 16561 16363  198 1 1                .8  1 0  8 174
    "59167-90" 2 16561 15852  709 1 1               .87  1 0  7  63
    "11969-65" 2 19633 16296 3337 1 1             16.15  5 1  8 174
    "40815-10" 2 16608 14670 1938 0 1             12.42 12 1 30 381
    "40815-10" 2 16608 14641 1967 0 1             48.77 11 1 27 381
    "41479-66" 1 16120 15455  665 1 1             32.33 21 0 34  66
    "54412-39" 3 16315 15091 1224 0 1             24.65  6 0 22  80
    "54412-39" 3 16315 14698 1617 1 1              9.32  3 0 21 381
    "13465-09" 0 20667 16280 4387 1 0                15 11 1 32 174
    "13465-09" 0 20667 15529 5138 1 0                20  9 0 30  66
    "42162-22" 2 18267 17126 1141 1 1             12.44  5 1 15 157
    "54964-18" 3 19007 17037 1970 0 1             24.21 11 1 16 157
    "54964-18" 3 19007 15642 3365 1 1             12.16  4 1 12  66
    "41450-86" 2 17709 14699 3010 1 1             25.81  4 0 28 381
    "11066-68" 0 20667 15820 4847 1 1             11.33  4 0 21  63
    "11066-68" 0 20667 15146 5521 1 1              8.47  3 0 19  80
    "52767-01" 2 16314 13717 2597 0 1             13.74 13 1 25 473
    "93471-49" 2 16771 16197  574 0 0             15.42  4 0 20 174
    "93471-49" 2 16771 14792 1979 1 0              40.7 11 0 18 381
    "93471-49" 2 16771 14488 2283 1 0              14.3  7 0 17 476
    "54788-59" 0 20667 15893 4774 1 0                10  4 0 23  63
    "54788-59" 0 20667 14985 5682 1 0              6.81  3 0 21  80
    "54717-22" 2 17702 16944  758 0 0                27  5 0 26 157
    "54717-22" 2 17702 15949 1753 1 0             13.25  6 0 23  63
    "54717-22" 2 17702 15269 2433 1 0                 5  4 0  7  80
    "54708-49" 2 16916 15364 1552 1 0                15  4 0 33  66
    "54708-49" 2 16916 14362 2554 1 0             15.86  3 0 30 476
    "54277-21" 1 15519 14774  745 1 0             42.65  7 1 31 381
    "57043-27" 2 16614 15389 1225 0 0              41.7  4 0 33  66
    "57043-27" 2 16614 14403 2211 1 0             13.84  2 0 30 476
    "60042-52" 2 17257 16406  851 1 0              31.5  8 0 35 174
    "54536-32" 1 17232 16385  847 1 0             18.07  4 0 35 174
    "54536-32" 1 17232 15431 1801 1 0             16.14  3 0 33  66
    "52795-45" 0 20667 14610 6057 1 0                15  2 0 31 381
    "42020-38" 1 16226 16145   81 0 1              8.15  9 1 31 174
    "42020-38" 1 16226 15560  666 0 1             15.85  4 0 22  66
    "52856-83" 2 15355 11870 3485 1 1              2.13  5 0 20 411
    "52958-80" 3 19083 14474 4609 0 1             10.84  5 0 13 476
    "51592-33" 1 19632 17499 2133 1 1              8.18  4 0 38 159
    end
    format %td EXITDATE
    format %td DealDate
    Thank you very much and best regards,
    Konstantin



    Attached Files
Working...
X