Announcement

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

  • Cox Proportional Hazard Model for Financial Data with Pre and Post Period

    I have quarterly panel data of firms from 2003-2019 these firms have quarterly impairments. My duration variable is measuring how many quarters it takes for a firm to impair and it is increasing every quarter.
    In 2011 there was a law change retlated to simplifying impairment and I am trying to see how this law change is impacting my duration variable. Is it taking less time (less quarters for the firms to impair). My covariates are time varying. However, I do not know how to split my duration variable for the two periods (2003-2010) and (2011-2019). My current code is attached below. I have included only 300 observations but my real dataset has around 110,000 firm-quarters.
    Question 1. How do I compare the duration in the pre and post period. My current duration measure is not defined based on period. It is depending on the start date of the intangible asset and the date when the firm impairs.
    Question 2. Is my code correct?
    Question 3. Should I interact the post variable with the other covariates?

    drop _d _t _t0
    stset duration, failure(impair==1) id(firm_id)
    stcox post return_on_assets book_to_market log_market_cap i.fama_french_industry, tvc(return_on_assets book_to_market log_market_cap) texp(log(_t)) vce(cluster firm_id)
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(book_to_market return_on_assets) int post float(impair duration) long firm_id float(fama_french_industry log_market_cap) byte(_st _d _t _t0)
      .8966172    .06447939 1 0  1 1272  8 4.1390324 1 0  1  0
       .835613   .007337708 1 0  2 1272  8 4.2039876 1 0  2  1
      .8032083 -.0046543106 1 0  3 1272  8 4.2274594 1 0  3  2
      .8596072   .034196347 1 0  4 1272  8  4.462892 1 0  4  3
      .8044139      .053599 1 0  5 1272  8  4.570695 1 0  5  4
      .8091924   .007400956 1 0  6 1272  8 4.5555134 1 0  6  5
      .8400197  -.004185582 1 0  7 1272  8 4.5064707 1 0  7  6
      .8029753   .017764313 1 0  8 1272  8 4.5445566 1 0  8  7
      .8095508    .03933277 2 0  9 1272  8  4.565257 1 0  9  8
      .9121972  .0020047089 2 0 10 1272  8 4.4234767 1 0 10  9
       .909099 -.0030678534 2 0 11 1272  8 4.4330506 1 0 11 10
      .9776149    .02575004 2 0 12 1272  8  4.370613 1 0 12 11
      .9367127    .04936608 2 0 13 1272  8 4.4610457 1 0 13 12
      .9131064  -.005053317 2 0 14 1272  8 4.5005217 1 0 14 13
      .8968622  -.005792429 2 0 15 1272  8 4.6709056 1 0 15 14
     1.1614501    .02156837 2 1 16 1272  8  4.441822 1 1 16 15
      .6236374   .004072385 1 0  1 1736 11  5.258449 1 0  1  0
      .6104081  .0043324702 1 0  2 1736 11  5.259243 1 0  2  1
     .58445483   .004157374 1 0  3 1736 11  5.331042 1 0  3  2
      .4524945   .005186505 1 0  4 1736 11  5.602196 1 0  4  3
      .5491767   .004712553 1 0  5 1736 11  5.411846 1 0  5  4
      .5853973   .005328792 1 0  6 1736 11  5.379725 1 0  6  5
      .6058356    .00544325 1 0  7 1736 11  5.368611 1 0  7  6
      .5882831   .006371038 1 0  8 1736 11  5.410522 1 0  8  7
     .54273826   .006046484 1 0  9 1736 11  5.507405 1 0  9  8
     .51905286    .00600804 1 0 10 1736 11  5.565961 1 0 10  9
       .448052   .005475581 1 0 11 1736 11  5.738169 1 0 11 10
      .4887904   .004042889 1 0 12 1736 11   5.65038 1 0 12 11
      .5980867   .002978339 1 0 14 1736 11  5.457988 1 0 14 12
      .7984604  .0041178544 1 0 15 1736 11  5.184542 1 0 15 14
     1.1835785  .0015741757 1 0 16 1736 11  5.355729 1 0 16 15
     1.3391635   .003119492 1 0 17 1736 11  5.238935 1 0 17 16
     2.1547086    .00244545 1 0 18 1736 11   4.75304 1 0 18 17
     1.0764625   .002651175 1 0 19 1736 11  5.438007 1 0 19 18
      .9404865 -.0009106873 1 0 20 1736 11  5.555421 1 0 20 19
      2.111146   -.00164302 1 0 21 1736 11 4.7186375 1 0 21 20
     2.2050111  -.007882987 1 1 22 1736 11  3.977203 1 1 22 21
      .7585808            . 1 0  1 1141  6  3.422335 1 0  1  0
      .8853176   -.09684549 1 0  2 1141  6   3.22632 1 0  2  1
      .3473555   -.06350658 1 0  3 1141  6  3.736258 1 0  3  2
      .3508258    -.1004477 1 0  4 1141  6  3.390408 1 0  4  3
      .5111542   -.10408749 1 0  5 1141  6   2.98066 1 0  5  4
      .7119354    -.1393006 1 0  6 1141  6 2.4779425 1 0  6  5
     .55459034   -.13609467 1 0  7 1141  6  2.590815 1 0  7  6
     .12120446   -.14483991 1 1  8 1141  6  2.555093 1 1  8  7
     1.1522253   .006174172 1 0  1 1140  3  3.987811 1 0  1  0
     1.0715232   .009435218 1 0  2 1140  3  4.072171 1 0  2  1
      .9977745    .00640859 1 0  3 1140  3  4.176104 1 0  3  2
      .8206759   .022610845 1 0  4 1140  3  4.132403 1 0  4  3
      .6185091            . 1 0  5 1140  3 4.5158253 1 0  5  4
     .51677954   .033925563 1 0  6 1140  3  4.615332 1 0  6  5
      .4935582   .018328913 1 0  7 1140  3 4.5054965 1 0  7  6
     .52021694    .02412995 1 0  8 1140  3 4.5428615 1 0  8  7
      .2956222    .01493111 1 0  9 1140  3  5.075408 1 0  9  8
    .070015855    .02166516 1 0 10 1140  3  5.072267 1 0 10  9
     .10516728    .04519248 1 0 11 1140  3  5.127019 1 0 11 10
     .03568016   .036449004 1 0 12 1140  3  5.162646 1 0 12 11
    .070225924    .04987798 1 0 13 1140  3  5.412003 1 0 13 12
     .13389821    .06470325 1 0 14 1140  3  5.724513 1 0 14 13
      .1630947    .04778165 1 0 15 1140  3  5.955989 1 0 15 14
     .13863318    .04445805 1 0 16 1140  3  6.031729 1 0 16 15
     .18719344    .06171638 1 0 17 1140  3  5.916352 1 0 17 16
       .219412    .03557954 1 0 18 1140  3  5.814163 1 0 18 17
     .13552389    .02725355 1 0 19 1140  3  5.618901 1 0 19 18
      .1552171   .032451123 1 0 20 1140  3  5.613028 1 0 20 19
     .21170333   .018743357 1 0 21 1140  3  5.329682 1 0 21 20
      .2050699  .0024723054 1 0 22 1140  3  5.254867 1 0 22 21
     .28497255  -.012790396 1 0 23 1140  3  4.776621 1 0 23 22
     .30386645    .02354799 1 0 24 1140  3  4.891082 1 0 24 23
     .53506744    .06664678 1 0 25 1140  3 4.5863867 1 0 25 24
      .4687672    .05191504 1 0 26 1140  3  4.932571 1 0 26 25
       .334272   .033547994 1 0 27 1140  3  5.386633 1 0 27 26
      .3171578    .01961908 1 0 28 1140  3  5.480629 1 0 28 27
     .29300883  -.011758676 1 0 29 1140  3   5.48105 1 0 29 28
      .3654765   .003356959 1 0 30 1140  3  5.248275 1 0 30 29
      .3556077   .027581057 1 0 31 1140  3  5.269317 1 0 31 30
      .3782775    .02448991 1 0 32 1140  3  5.015324 1 0 32 31
      .3400678   .014174514 1 0 33 1140  3  5.142085 1 0 33 32
      .3105861   .011531192 1 0 34 1140  3  5.231832 1 0 34 33
     .27789885    .02348499 1 0 35 1140  3  5.008428 1 0 35 34
      .3368449   .019493556 1 0 36 1140  3  5.006592 1 0 36 35
     .27842396   .013771587 2 0 37 1140  3  5.208678 1 0 37 36
     .29067072   .030721795 2 0 38 1140  3  5.265187 1 0 38 37
     .26252562    .06013305 2 0 39 1140  3   5.56267 1 0 39 38
      .2085115   .030909864 2 0 40 1140  3  5.870982 1 0 40 39
     .22685486   .031206975 2 0 41 1140  3  5.878336 1 0 41 40
      .1915423   .012913926 2 0 42 1140  3  6.069649 1 0 42 41
      .1883736    .01478589 2 0 43 1140  3  6.115894 1 0 43 42
     .25664082    .01532986 2 0 44 1140  3  5.810576 1 0 44 43
      .3268628  -.003553817 2 0 45 1140  3  5.512267 1 0 45 44
     .32256225  .0041005802 2 0 46 1140  3  5.203926 1 0 46 45
       .288707   .009520662 2 0 47 1140  3  5.337782 1 0 47 46
        .25547   .007112143 2 0 48 1140  3  5.458202 1 0 48 47
     .23357622    .01268231 2 0 49 1140  3  5.544041 1 0 49 48
     .28427175    .04849245 2 0 50 1140  3  5.547753 1 0 50 49
      .3192396    .03726658 2 0 51 1140  3   5.51234 1 0 51 50
     .21959633    .04442048 2 0 52 1140  3  6.014302 1 0 52 51
     .22232403    .03886994 2 0 53 1140  3   6.07133 1 0 53 52
      .3473236    .05928068 2 0 54 1140  3  5.756299 1 0 54 53
     .27777803    .02968854 2 0 55 1140  3   6.02217 1 0 55 54
    end
    label values post period
    label def period 1 "Post SFAS142", modify
    label def period 2 "Post ASU2011", modify
    label values firm_id gvkey_num
    label def gvkey_num 1140 "011903", modify
    label def gvkey_num 1141 "011907", modify
    label def gvkey_num 1272 "012994", modify
    label def gvkey_num 1736 "019049", modify
    label values fama_french_industry ff12_ind
    label def ff12_ind 3 "Manufacturing -- Machinery, Trucks, Planes, Off Furn, Paper, Com Printing", modify
    label def ff12_ind 6 "Business Equipment -- Computers, Software, and Electronic Equipment", modify
    label def ff12_ind 8 "Utilities", modify
    label def ff12_ind 11 "Finance", modify

  • #2
    I don't think there is any way to do this with the data shown. You say that you have quarterly data from 2003 through 2019, but the example data you show is not consistent with that. If it were, there would be 68 observations for each firm. Yet the largest number of observations is 55. Moreover, at least in firm 019049, there is a gap in the sequence of the duration variable.

    If you did have a complete balanced 2003-2019 panel, then we could assume that duration = 1 corresponds to 2003q1, and duration 68 corresponds to 2019q4, and from that we could infer that the last quarter of 2010 corresponds to duration = 32 and we could set an indicator for duration between 1 and 32 vs 33 through 68. But with this data, I don't see that there is any information that tells us what the correspondence between duration and calendar quarter is.

    Comment


    • #3
      Dear Clyde, I am sorry but my dataset is huge and I cannot replicate it with a small subsample. My duration variable is dependent on another variable which is when the firm first acquires goodwill. So if goodwill was available in 2003q1 that'w when I start measuring duration. I heard there is a way to split the data using stsplit. How can I apply stsplit for a Cox Proportional Hazard Model?

      Comment


      • #4
        My duration variable is dependent on another variable which is when the firm first acquires goodwill. So if goodwill was available in 2003q1 that'w when I start measuring duration.
        Well, that suggests an approach that could get what you want. But with no details, it's hard to say more. I suggest you post back with an example data set that includes both the duration and goodwill variables, using -dataex-, and the code you used to calculate duration from this other variable.

        As for using -stsplit-, you won't need to do that. Your data is already split. It's just a question of getting the right variables setup and slotting them into the appropriate places in your -stset- command.

        Comment

        Working...
        X