Announcement

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

  • Implementation of Borusyak's event studies - problem with eventstudyinteract of Sun and Abraham (2020)

    Hello everyone!

    I have been trying to implement Borusyak's codes for my dataset to generated the combined DID graph with all the recent estimators, and while it works great for all of them, for some reason I get an error message when trying to run eventstudyinteract to get the Sun and Abraham (2020)'s estimates.

    This are the relevant codes I am using, with Ei being a variable euqal to 2009 (my intervention year) for all treated and missing for untreated. tx_malaria_res is my outcome variable, code is the pannel's id and year is the time variable. I have data from 2003-2019 (so why I have specified 5 leads and 10 lags), and the if uf_code==15 part is just because I am using a subset of the full dataset:

    sum Ei
    gen lastcohort = Ei==r(max) // dummy for the never-treated cohort
    forvalues l = 0/10 {
    gen L`l'event = K==`l'
    }
    forvalues l = 1/5 {
    gen F`l'event = K==-`l'
    }
    drop F1event // normalize K=-1 (and also K=-15) to zero
    eventstudyinteract tx_malaria_res L*event F*event if uf_code==15, vce(cluster code) absorb(code year) cohort(Ei) control_cohort(lastcohort)

    I get the error message:
    varlist required
    r(100);

    I believe I have all the necessary packages in good order, i.e.: eventstudyinteract; avar; reghdfe; etc.

    Did anyone experience something similar and/or has insights on how to solve?
    I double checked my codes so many times, but do not know which variable I may have missed to specify somewhere...

    Thanks in advance - any insights are appreciated.

  • #2
    Luiza:
    I guess you meant https://www.sciencedirect.com/scienc...0440762030378X.
    typing -search Sun and Abraham- within Stata takes you to 'EVENTSTUDYINTERACT' community-contributed module.
    For your future post mentioning a reference, please read and act on https://www.statalist.org/forums/help#references #14. Thanks.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Hi Carlo, thank you.
      Yes, my bad on not posting the full reference to the paper.

      Do you know how to solve the issue I have?
      Naturaly, I have consulted the help files before posting here in statalist and it did not discuss this error specifically.

      Comment


      • #4
        Luiza:
        are you sure that
        Code:
        L*event F*event
        is legal?
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          I know this is an old question, but I got a similar error in another context, and, finding limited resources on the topic, set about trying to get the example in `help eventstudyinteract` to generate the same error.

          The issue is `eventstudyinteract` doesn't check that you correctly specified your model and variables before beginning to run the analysis, so if you goof up anything it will often lead to empty varlists being passed around internally eventually triggering this error. This is true of many user generated commands, which it's often best to think of as well thought out examples rather than utilities (...he says into the echoing void...).

          For example you can replicate this error if you do the following:

          1. follow the first example in `help eventstudyinteract` up to:

          Code:
           eventstudyinteract ln_wage g_* g0-g18, cohort(first_union) control_cohort(never_union) covariates(south) absorb(i.idcode i.year) vce(cluster idcode)
          confirm that the example works with your installation. Then do step 2.

          2. Incorrectly specify `never_union`:

          Code:
          replace never_union = (!mi(first_union))
          and rerun the link in 1 above.

          I don't know if this is what you did, but it should illustrate the sort of thing that might generate this error.

          Comment

          Working...
          X