Announcement

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

  • Difference in Difference model in Stata

    Hi all smart folks!

    I am trying to replicate a figure from the code I got from the authors of a paper.

    I want to use didregress function in Stata to replicate the table. However, I could not figure it out. Could someone help? Thanks!

    The original code is below:

    *TABLE 2 -- D-in-D;
    sum logrealsales if cc==1 & year<2000
    sum logrealsales if cc==1 & year>1999
    sum logrealsales if lc==1 & year<2000
    sum logrealsales if lc==1 & year>1999
    gen did=0
    replace did=1 if cc==1 & year>1999
    gen tafter=0
    replace tafter=1 if year>1999
    regress logrealsales cc tafter did
    drop tafter did


  • #2
    However, I could not figure it out
    Neither can I, and my masters thesis and current doctoral coursework specifically studies/uses difference-in-differences, synthetic controls and related methods.

    Not because I can't or won't help, it's just that there's nothing to go off of here. You don't even provide a screenshot of a table or anything that would reflect what you want. Also, didreg is a command, not a function.

    I don't mind helping at all, but please, see FAQ section 10 and 12 and re-ask your question below.

    Comment


    • #3
      Originally posted by Jared Greathouse View Post
      Neither can I, and my masters thesis and current doctoral coursework specifically studies/uses difference-in-differences, synthetic controls and related methods.

      Not because I can't or won't help, it's just that there's nothing to go off of here. You don't even provide a screenshot of a table or anything that would reflect what you want. Also, didreg is a command, not a function.

      I don't mind helping at all, but please, see FAQ section 10 and 12 and re-ask your question below.
      Hi Jared,

      Thanks for your replying, I have included the table and reposted it. Thanks for your advice!

      Comment


      • #4
        I don't see a table (I'm on my phone, if that matters), and either way I still need your data and code to be of use here. So, please show me your data using dataex.

        Comment

        Working...
        X