Announcement

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

  • Bootstrapped clustered standard errors on time variables in panel

    Dear Stata Forum,

    I have the following panel dataset (some obs. as example) with daily observations per inidvidual (150 tsd obs.):
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    id Date Event Y x1 x2)
    1 15701 1             . 15.397253 .
    1 15702 .   -.018936556 15.397253 .
    1 15703 1    -.02018093 15.397253 .
    1 15704 .  -.0032356484 15.397253 .
    2 15701 1  -.01185882 15.397253 .
    2 15702.    -.01520142 15.397253 .
    2 15703 1   -.004738005 15.397253 .
    2 15704    -.008229594 15.397253 .
    3 15701 1 -.0012361676 15.397253 .
    3 15702.    .001859542 15.397253 .
    3 15703 1  -.034577988 15.397253 .
    3 15704.      .0473593 15.397253 .
    3 15701.    .020564953 15.397253 .
    4 15701 1    .025506055 15.397253 .
    4 15702.  -.0046083163 15.397253 .
    .
    .
    .
    end
    format %td Date

    Where Event is dummy variable that equals 1 in the case there is an event happing, Y is my dependent variable, x1 ,x2 are my indpendent variables.

    I estimate the following regression:

    Code:
    reg Y x1 x2
    I now want to obtain "bootstrapped standard errors clustered by Event".

    If we want this for clustering on id level the procedure would be:
    Code:
    gen newid = id
    xtset newid Date
    
    bootstrap , reps (50) cluster(id) idcluster(newid):  reg Y x1 x2
    However I don't know how to do this on the Event - so the time variable? Do you have any suggestions how to do this?


    Many thanks and Regards,

    John
Working...
X