Announcement

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

  • Event study with repeated cross section data

    Hello, I am trying to generate an event study graph after running DID regression. My data is a repeated cross-section. The treatment is given all at once in year 2018.
    -outcome- variable is the outcome of interest. -rec_treat- identifies the group that receives treatment. -rec_treat*year- is the interaction term (= 1 if received treatment and year>=2018).

    The sample data is given below:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int(district_code outcome) float(rec_treat year rec_treat*year)
    1  8 1 2011 0
    1  . 1 2014 0
    1  . 1 2013 0
    1 42 1 2012 0
    1 33 1 2013 0
    1 22 1 2012 0
    1 22 1 2014 0
    1 11 1 2011 0
    1 14 1 2011 0
    1  3 1 2014 0
    1 17 1 2012 0
    1  6 1 2014 0
    1 18 1 2011 0
    1  4 1 2013 0
    1 29 1 2014 0
    1  6 1 2014 0
    1 14 1 2011 0
    1 37 1 2011 0
    1 19 1 2010 0
    1 10 1 2011 0
    1 16 1 2010 0
    1 11 1 2012 0
    1 14 1 2012 0
    1 28 1 2010 0
    1 25 1 2011 0
    1 25 1 2010 0
    1  . 1 2014 0
    1 23 1 2014 0
    1 19 1 2011 0
    1 41 1 2011 0
    1 26 1 2012 0
    1  5 1 2014 0
    1 25 1 2010 0
    1  9 1 2014 0
    1 11 1 2012 0
    1 26 1 2014 0
    1  5 1 2014 0
    1  4 1 2014 0
    1  7 1 2010 0
    1 29 1 2010 0
    1  5 1 2012 0
    1  . 1 2014 0
    1  9 1 2012 0
    1 65 1 2011 0
    1 21 1 2011 0
    1 34 1 2014 0
    1 11 1 2010 0
    1  9 1 2014 0
    1 20 1 2011 0
    1 14 1 2012 0
    551  6 1 2022 1
    551 12 1 2018 1
    551  7 1 2018 1
    551  7 1 2022 1
    551  8 1 2018 1
    551  . 1 2022 1
    551  . 1 2022 1
    551  6 1 2022 1
    551  5 1 2018 1
    551 29 1 2018 1
    551 24 1 2018 1
    551 11 1 2022 1
    544  2 1 2022 1
    544  8 1 2022 1
    544  9 1 2022 1
    544  6 1 2018 1
    544  9 1 2022 1
    544  7 1 2018 1
    544 16 1 2022 1
    544 12 1 2022 1
    544  . 1 2018 1
    544 17 1 2018 1
    544  3 1 2018 1
    544 21 1 2018 1
    544  1 1 2022 1
    544 17 1 2018 1
    544  3 1 2022 1
    544 22 1 2022 1
    544 10 1 2022 1
    544 17 1 2018 1
    544  . 1 2022 1
    544 14 1 2018 1
    544 10 1 2018 1
    544  8 1 2018 1
    544 11 1 2018 1
    544  9 1 2018 1
    544 13 1 2018 1
    544 26 1 2018 1
    544  6 1 2022 1
    544  3 1 2018 1
    544  7 1 2022 1
    544  5 1 2022 1
    544 24 1 2018 1
    544  9 1 2018 1
    544  8 1 2022 1
    544  6 1 2022 1
    544  6 1 2022 1
    544 18 1 2022 1
    544  . 1 2018 1
    544 10 1 2022 1
    544  . 1 2018 1
    544 10 1 2022 1
    544 19 1 2018 1
    544  1 1 2022 1
    end
    I am using -reghdfe- to run the DD regression and -coefplot- (ssc install ftools) for the event study graph. Please help in generating this.

  • #2
    Parul:
    why not considering -didregress- instead?
    Last edited by Carlo Lazzaro; 14 Mar 2025, 02:05.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      In addition to Carlo's helpful response, how about ssc install eventdd

      Comment


      • #4
        Carlo Lazzaro : I used -didregress- but I am unable to use -ptrends- after that. I get an error saying "treatment times vary", even though all treatment was given in the same period.

        Maxence Morlet: I tried that but I get the error "Lead or lag term not found in the range of the event study plot. Ensure that the indicated time var() has full coverage for all leads and lags, or attempt accumulating leads and lags using the accum option." I had created the -time_to_treat- variable as year-2018.


        Upon further search, I used the code in https://lost-stats.github.io/Model_E...ent_study.html. I got certain graphs (that look fairly good) but I am unclear how to interpret them. It looks like we are not using the "treated" variable/interaction at all while creating these plots. How does the graph, then, show the difference between the treatment and control groups? Also, what is a desirable graph? Should the coefficients be close to zero or negative before treatment?

        Edited to add: I have data for 2010, 2011, 2012, 2014, 2016, 2018 and 2022. Some years are missing. Is this causing failure of ptrends?
        Last edited by Parul Gupta; 14 Mar 2025, 02:49.

        Comment


        • #5
          Parul:
          there's something wrong in your did specification.
          See Example 1 in -didregress- entry, Stata .pdf manual.
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #6
            @Carlo: you are probably right. Could you see the following and comment on it pls?

            This is how I generate my DID variables:

            Code:
            gen rec_treat= 1 if _m==3 //whether observations are treated is indicated by another data file which I merge with this one
            replace rec_treat=0 if _m==1
            
            gen rec_treat*yr=rec_treat*(year>=2018) //treatment year is 2018.
            With this specification, estat ptrends does not work.

            However, since you mentioned that the DID specification might be incorrect, I redefined the interaction as
            Code:
            gen rec_treat*yr=rec_treat*(year==2018) //treatment year is 2018.
            Once I do this, -estat ptrends- works.

            However, I wonder if the latter is logical. The treated units continue to benefit from the treatment (the policy was launched in 2018 and is ongoing). So, shouldn't the interaction reflect that the units are still "treated"?

            Appreciate your help!

            Edited to add: My DID regression is the following:

            Code:
            didregress (outcome) (rec_treat*yr), group(district_code) time(year) vce(cluster district_code)
            Last edited by Parul Gupta; 14 Mar 2025, 06:29.

            Comment


            • #7
              Parul:
              it seems to me that, in your example, the group are not two, as expected.
              Kind regards,
              Carlo
              (StataNow 18.5)

              Comment


              • #8
                Could you explain further pls? For clarification, I have a household survey. Treatment is given at the district level. My understanding is that there are two groups: treated districts and untreated districts, as required. (All households within the district are assumed to be treated).

                Also, when i run didregress, i get the following values for control and treatment times:
                control: minimum 2010, maximum 2018
                treatment: minimum 2018, maximum 2022 , if I use gen rec_treat*yr=rec_treat*(year>=2018)

                Does that help you diagnose the issue better?

                I get the error in pretends even I drop the missing values. So it doesn't look like the missing values are causing a problem.

                Comment


                • #9
                  Correction: In #8, the control units have minimum 2010 and maximum 2022.

                  Comment


                  • #10
                    Parul:
                    in its basic setup, DID needs two groups (treated and control), a treatment, and two time periods (before and after the treatment).
                    When I code:
                    Code:
                    . bysort rec_treat_year: tab year if year==2018
                    Stata returns:
                    Code:
                    -> rec_treat_year = 0
                    no observations
                    
                    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                    -> rec_treat_year = 1
                    
                           year |      Freq.     Percent        Cum.
                    ------------+-----------------------------------
                           2018 |         27      100.00      100.00
                    ------------+-----------------------------------
                          Total |         27      100.00
                    
                    
                    .
                    I would expect the control group too to be followed post 2018, to create the counterfactual.
                    Kind regards,
                    Carlo
                    (StataNow 18.5)

                    Comment


                    • #11
                      That's just an issue with the sample data I shared. There are control observations in the full dataset.

                      Comment


                      • #12
                        Parul:
                        could you please share an example of your dataset that that aligns with the DID set up? Thanks.
                        Kind regards,
                        Carlo
                        (StataNow 18.5)

                        Comment


                        • #13
                          Apologies for the delay in response. Here is the data:

                          clear
                          input int district_code byte outcome float(rec_treat did year)
                          20 1 0 0 2012
                          3 1 0 0 2018
                          297 . 1 1 2018
                          2 . 0 0 2011
                          144 1 0 0 2016
                          44 1 0 0 2013
                          34 1 1 0 2012
                          35 0 0 0 2010
                          9 1 0 0 2013
                          8 1 0 0 2011
                          26 . 0 0 2014
                          24 1 0 0 2012
                          13 1 0 0 2013
                          10 1 0 0 2010
                          13 . 0 0 2012
                          29 0 1 0 2012
                          13 1 0 0 2014
                          1 . 0 0 2010
                          19 1 0 0 2013
                          379 1 0 0 2022
                          6 1 0 0 2011
                          529 1 0 0 2022
                          1 1 0 0 2013
                          4 1 0 0 2012
                          5 1 0 0 2010
                          7 0 0 0 2012
                          140 1 0 0 2018
                          22 1 0 0 2014
                          9 . 0 0 2011
                          13 1 0 0 2011
                          13 1 0 0 2011
                          12 1 0 0 2010
                          263 1 0 0 2018
                          37 0 1 0 2010
                          454 1 0 0 2016
                          37 0 0 0 2010
                          3 1 0 0 2016
                          6 1 0 0 2010
                          17 1 0 0 2012
                          102 1 0 0 2018
                          25 1 0 0 2011
                          4 1 0 0 2014
                          13 . 0 0 2014
                          21 1 0 0 2012
                          39 1 0 0 2013
                          8 1 0 0 2010
                          17 . 0 0 2010
                          314 1 0 0 2016
                          16 1 0 0 2014
                          8 . 0 0 2013
                          617 1 0 0 2018
                          63 1 0 0 2012
                          54 1 0 0 2022
                          6 0 0 0 2011
                          9 0 1 0 2014
                          294 0 0 0 2016
                          9 0 0 0 2010
                          18 0 0 0 2010
                          16 . 0 0 2012
                          316 1 0 0 2022
                          345 1 0 0 2018
                          5 1 0 0 2010
                          4 0 0 0 2010
                          18 . 1 0 2010
                          2 1 1 0 2014
                          6 0 0 0 2010
                          15 . 1 0 2010
                          583 1 0 0 2018
                          6 0 0 0 2011
                          5 1 0 0 2010
                          553 1 0 0 2022
                          4 1 0 0 2013
                          4 . 0 0 2011
                          284 1 0 0 2016
                          10 . 0 0 2013
                          24 . 0 0 2010
                          30 1 0 0 2011
                          21 1 0 0 2014
                          1 1 0 0 2011
                          305 1 0 0 2022
                          12 1 0 0 2010
                          21 . 0 0 2013
                          12 0 0 0 2010
                          10 1 0 0 2011
                          16 . 0 0 2010
                          29 1 1 0 2010
                          14 1 0 0 2018
                          4 1 0 0 2012
                          5 . 1 0 2012
                          15 1 0 0 2014
                          394 1 0 0 2018
                          549 1 0 0 2022
                          485 1 1 0 2016
                          571 1 0 0 2016
                          26 1 1 0 2011
                          10 . 0 0 2011
                          289 0 0 0 2022
                          3 1 1 0 2010
                          5 0 0 0 2014
                          4 1 0 0 2010
                          19 1 0 0 2013
                          5 0 0 0 2016
                          284 1 0 0 2022
                          7 0 1 0 2014
                          22 1 0 0 2013
                          479 1 0 0 2022
                          6 0 0 0 2016
                          648 1 0 0 2022
                          19 1 0 0 2013
                          20 . 1 0 2013
                          22 0 0 0 2010
                          11 1 0 0 2012
                          4 1 0 0 2010
                          292 0 0 0 2022
                          422 1 0 0 2018
                          530 1 0 0 2022
                          20 1 0 0 2014
                          6 1 0 0 2013
                          15 0 1 0 2010
                          32 0 0 0 2010
                          19 1 0 0 2012
                          7 . 0 0 2010
                          3 1 0 0 2012
                          3 . 0 0 2016
                          37 1 0 0 2010
                          331 1 1 1 2018
                          6 1 0 0 2013
                          264 1 0 0 2022
                          614 . 0 0 2018
                          281 1 1 1 2022
                          5 0 1 0 2010
                          480 1 0 0 2022
                          21 1 0 0 2014
                          39 0 0 0 2010
                          281 1 1 1 2022
                          1 1 0 0 2011
                          207 1 0 0 2022
                          5 0 1 0 2012
                          485 1 1 0 2016
                          553 1 0 0 2022
                          543 1 1 0 2016
                          17 . 0 0 2011
                          152 1 0 0 2022
                          242 1 0 0 2018
                          13 1 0 0 2014
                          335 1 0 0 2016
                          19 0 0 0 2014
                          23 1 1 0 2014
                          9 1 0 0 2012
                          500 1 0 0 2022
                          3 1 1 0 2011
                          1 1 0 0 2014
                          565 1 0 0 2018
                          561 1 1 1 2018
                          284 1 0 0 2022
                          7 1 0 0 2014
                          63 . 0 0 2010
                          289 0 0 0 2016
                          190 1 0 0 2018
                          6 1 0 0 2011
                          19 1 0 0 2014
                          21 1 0 0 2013
                          4 1 0 0 2012
                          554 1 0 0 2022
                          548 1 0 0 2022
                          9 1 0 0 2012
                          396 1 0 0 2016
                          12 1 1 0 2014
                          113 0 0 0 2018
                          21 . 0 0 2014
                          2 1 0 0 2012
                          21 . 0 0 2010
                          4 1 0 0 2012
                          241 1 0 0 2022
                          9 1 0 0 2013
                          194 0 0 0 2016
                          17 . 0 0 2012
                          220 1 0 0 2018
                          127 1 0 0 2022
                          230 1 0 0 2022
                          2 1 1 0 2010
                          13 1 0 0 2011
                          515 1 0 0 2016
                          9 1 0 0 2013
                          13 0 0 0 2012
                          19 0 0 0 2010
                          279 0 0 0 2016
                          588 1 0 0 2018
                          15 1 0 0 2022
                          601 1 0 0 2018
                          11 . 0 0 2011
                          7 0 0 0 2010
                          8 1 0 0 2011
                          24 1 0 0 2013
                          446 0 0 0 2022
                          20 1 1 0 2012
                          104 1 0 0 2022
                          258 1 0 0 2022
                          37 0 1 0 2010
                          37 0 0 0 2013
                          617 1 0 0 2018
                          9 1 0 0 2012
                          16 1 0 0 2010
                          4 1 1 0 2011
                          30 1 0 0 2014
                          576 1 0 0 2016
                          1 0 0 0 2011
                          28 1 0 0 2013
                          248 0 0 0 2016
                          5 1 0 0 2013
                          1 1 0 0 2010
                          61 1 0 0 2016
                          281 1 1 1 2022
                          658 0 1 1 2022
                          4 1 0 0 2013
                          7 1 0 0 2013
                          4 1 0 0 2012
                          12 0 1 0 2013
                          3 1 1 0 2011
                          3 . 0 0 2012
                          70 1 0 0 2016
                          2 1 0 0 2011
                          548 1 0 0 2022
                          276 0 0 0 2016
                          5 1 0 0 2012
                          23 1 1 0 2016
                          14 1 0 0 2012
                          3 1 0 0 2014
                          552 1 0 0 2022
                          490 1 0 0 2022
                          2 0 0 0 2011
                          6 0 0 0 2010
                          28 0 0 0 2013
                          485 1 1 0 2016
                          9 . 0 0 2011
                          316 1 0 0 2016
                          25 0 0 0 2022
                          421 1 0 0 2018
                          4 . 0 0 2010
                          327 1 0 0 2022
                          601 1 0 0 2022
                          8 0 0 0 2011
                          4 1 0 0 2012
                          27 . 1 0 2010
                          65 1 0 0 2013
                          3 1 1 0 2012
                          594 1 0 0 2018
                          269 . 0 0 2022
                          11 1 0 0 2010
                          578 1 0 0 2022
                          2 1 0 0 2012
                          10 1 0 0 2014
                          250 0 0 0 2022
                          35 1 0 0 2013
                          32 1 0 0 2012
                          186 1 0 0 2018
                          3 . 0 0 2013
                          11 1 0 0 2010
                          35 0 0 0 2010
                          5 1 0 0 2011
                          124 1 0 0 2018
                          4 1 0 0 2012
                          10 0 0 0 2012
                          11 1 0 0 2013
                          251 . 0 0 2016
                          6 1 0 0 2012
                          300 1 0 0 2018
                          5 0 1 0 2010
                          238 1 1 1 2022
                          6 . 0 0 2010
                          9 1 0 0 2011
                          61 1 0 0 2010
                          129 1 0 0 2016
                          19 1 0 0 2010
                          18 1 0 0 2012
                          550 1 0 0 2022
                          241 1 0 0 2018
                          6 1 0 0 2014
                          1 1 0 0 2010
                          13 1 0 0 2010
                          27 . 0 0 2010
                          5 0 0 0 2013
                          2 1 1 0 2014
                          2 1 0 0 2010
                          19 1 0 0 2010
                          502 1 0 0 2018
                          9 1 0 0 2012
                          343 1 0 0 2018
                          3 1 1 0 2014
                          13 1 0 0 2010
                          169 1 0 0 2022
                          6 . 0 0 2010
                          6 1 0 0 2013
                          398 1 0 0 2022
                          7 0 0 0 2011
                          21 0 1 0 2013
                          552 1 0 0 2022
                          8 1 0 0 2010
                          10 1 0 0 2011
                          35 1 0 0 2012
                          9 1 1 0 2012
                          9 . 1 0 2014
                          6 1 0 0 2012
                          610 . 0 0 2018
                          358 1 1 1 2022
                          11 1 0 0 2013
                          15 1 0 0 2022
                          30 1 0 0 2010
                          3 1 0 0 2018
                          8 1 0 0 2014
                          221 1 0 0 2018
                          15 1 0 0 2011
                          553 1 0 0 2022
                          1 1 0 0 2012
                          51 1 1 0 2010
                          512 . 0 0 2022
                          231 1 0 0 2018
                          3 1 0 0 2013
                          9 . 0 0 2014
                          254 0 0 0 2018
                          600 1 0 0 2018
                          269 1 0 0 2016
                          8 1 0 0 2010
                          9 0 1 0 2012
                          5 1 0 0 2012
                          13 1 0 0 2010
                          508 1 1 1 2018
                          521 1 0 0 2022
                          7 1 0 0 2011
                          13 0 0 0 2010
                          19 1 0 0 2012
                          15 1 0 0 2012
                          491 1 0 0 2022
                          21 1 0 0 2012
                          1 1 0 0 2011
                          554 1 0 0 2022
                          520 0 0 0 2018
                          146 1 0 0 2022
                          11 1 0 0 2010
                          3 0 0 0 2012
                          16 1 0 0 2013
                          6 . 0 0 2011
                          1 . 0 0 2011
                          278 0 0 0 2022
                          27 1 0 0 2014
                          101 1 0 0 2018
                          197 1 0 0 2016
                          1 1 0 0 2014
                          13 0 1 0 2011
                          4 1 0 0 2013
                          130 1 0 0 2018
                          244 1 0 0 2022
                          22 1 0 0 2010
                          2 1 0 0 2014
                          3 . 1 0 2012
                          12 1 0 0 2010
                          1 0 0 0 2014
                          34 0 0 0 2010
                          553 1 0 0 2022
                          289 1 0 0 2018
                          24 . 0 0 2010
                          4 . 0 0 2011
                          2 0 0 0 2010
                          23 1 0 0 2011
                          421 0 0 0 2016
                          85 1 0 0 2018
                          42 . 1 1 2018
                          3 0 0 0 2014
                          34 1 0 0 2010
                          482 1 0 0 2016
                          1 0 0 0 2013
                          9 . 0 0 2012
                          18 1 0 0 2010
                          156 1 0 0 2022
                          592 1 0 0 2016
                          25 0 0 0 2022
                          66 1 1 0 2010
                          5 1 0 0 2010
                          20 1 1 0 2012
                          11 0 0 0 2018
                          12 1 0 0 2012
                          40 0 0 0 2010
                          21 1 0 0 2013
                          21 1 0 0 2012
                          6 1 0 0 2012
                          3 . 0 0 2013
                          430 1 0 0 2016
                          1 1 0 0 2014
                          6 1 0 0 2014
                          2 1 0 0 2012
                          4 1 0 0 2011
                          8 0 0 0 2011
                          503 1 0 0 2022
                          8 1 0 0 2013
                          552 1 0 0 2022
                          17 1 0 0 2012
                          221 1 0 0 2022
                          10 0 0 0 2010
                          4 1 0 0 2012
                          244 0 0 0 2022
                          219 1 0 0 2016
                          617 1 0 0 2018
                          3 1 0 0 2014
                          25 . 0 0 2010
                          44 1 0 0 2011
                          11 1 0 0 2013
                          32 0 0 0 2013
                          11 1 0 0 2012
                          633 . 0 0 2018
                          4 1 0 0 2013
                          597 1 0 0 2016
                          269 . 0 0 2018
                          277 1 0 0 2022
                          279 1 0 0 2018
                          4 . 0 0 2013
                          524 1 0 0 2018
                          13 1 0 0 2010
                          4 0 0 0 2014
                          10 . 0 0 2012
                          521 1 0 0 2016
                          592 1 0 0 2016
                          275 0 0 0 2022
                          20 1 0 0 2013
                          15 1 0 0 2010
                          33 1 0 0 2012
                          45 1 0 0 2010
                          554 1 0 0 2022
                          13 1 0 0 2014
                          70 1 0 0 2018
                          8 1 0 0 2011
                          3 1 0 0 2010
                          453 1 0 0 2016
                          7 0 0 0 2010
                          16 0 0 0 2010
                          6 1 0 0 2012
                          22 0 0 0 2010
                          529 1 0 0 2016
                          284 0 0 0 2022
                          6 1 0 0 2013
                          19 . 0 0 2018
                          75 1 0 0 2016
                          10 0 0 0 2012
                          184 1 1 0 2016
                          9 1 0 0 2010
                          9 . 0 0 2011
                          491 1 0 0 2016
                          8 . 1 0 2010
                          555 1 0 0 2022
                          19 1 0 0 2012
                          60 1 0 0 2013
                          21 0 0 0 2013
                          20 1 0 0 2014
                          8 0 0 0 2010
                          28 0 0 0 2012
                          3 1 0 0 2013
                          263 1 0 0 2018
                          13 0 0 0 2014
                          549 1 0 0 2022
                          504 1 0 0 2022
                          68 1 0 0 2010
                          9 0 1 0 2014
                          3 1 0 0 2012
                          5 . 0 0 2011
                          23 1 0 0 2010
                          277 0 0 0 2022
                          15 1 0 0 2011
                          24 1 0 0 2022
                          9 1 0 0 2010
                          454 1 0 0 2016
                          4 1 1 0 2014
                          267 0 0 0 2018
                          15 1 0 0 2014
                          532 1 0 0 2022
                          1 . 0 0 2010
                          9 0 0 0 2013
                          37 . 0 0 2010
                          4 1 0 0 2011
                          6 0 0 0 2010
                          6 . 0 0 2011
                          314 . 0 0 2016
                          483 1 0 0 2016
                          20 1 0 0 2013
                          553 1 0 0 2022
                          38 1 0 0 2012
                          11 1 0 0 2010
                          551 1 1 1 2022
                          13 1 0 0 2013
                          419 1 0 0 2018
                          588 1 0 0 2022
                          8 . 0 0 2010
                          278 . 0 0 2016
                          246 1 0 0 2018
                          9 0 1 0 2010
                          34 1 0 0 2013
                          4 0 0 0 2014
                          278 . 0 0 2016
                          4 1 0 0 2013
                          66 1 0 0 2018
                          24 . 0 0 2011
                          14 1 0 0 2013
                          end
                          [/CODE]

                          As mentioned in #1, the treatment is given all at once in year 2018.
                          -outcome- variable is the outcome of interest. -rec_treat- identifies the group that receives treatment. -did- is the interaction term (gen did =0 replace did = 1 if rec_treat==1 & year>=2018).

                          Comment


                          • #14
                            Parul:
                            what about:
                            Code:
                            . gen After=1 if year>=2018
                            
                            . replace After=0 if year<2018
                            
                            . bysort district_code: egen Group=max( rec_treat)
                            
                            . xtreg outcome c.Group#c.After, fe vce(cluster district_code)
                            
                            Fixed-effects (within) regression               Number of obs     =        432
                            Group variable: district_c~e                    Number of groups  =        163
                            
                            R-squared:                                      Obs per group:
                                 Within  = 0.0012                                         min =          1
                                 Between = 0.0017                                         avg =        2.7
                                 Overall = 0.0046                                         max =         23
                            
                                                                            F(1, 162)         =      38.08
                            corr(u_i, Xb) = 0.0239                          Prob > F          =     0.0000
                            
                                                       (Std. err. adjusted for 163 clusters in district_code)
                            ---------------------------------------------------------------------------------
                                            |               Robust
                                    outcome | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
                            ----------------+----------------------------------------------------------------
                            c.Group#c.After |   .1197605   .0194068     6.17   0.000     .0814377    .1580833
                                            |
                                      _cons |   .7828787   .0006738  1161.81   0.000      .781548    .7842093
                            ----------------+----------------------------------------------------------------
                                    sigma_u |  .31767238
                                    sigma_e |  .41628541
                                        rho |  .36802453   (fraction of variance due to u_i)
                            ---------------------------------------------------------------------------------
                            
                            .
                            Kind regards,
                            Carlo
                            (StataNow 18.5)

                            Comment


                            • #15
                              Thanks, Carlo. Can I use this with -reghdfe- instead of -xtreg- since my data is not a true panel? Further, how can I use this setup for event study/parallel trends?

                              Comment

                              Working...
                              X