Announcement

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

  • If 'didregress'='reg yvar i.treatment##period' how come the std.errors differ?

    Hi all

    Having read that difference-in-difference essentially is about adding an interaction term between two dummy variables indicating the period (pre / post treatment) and group (treatment / control), I decided to see if the results of a 'didregress' and 'reg' with the interaction term would be the same. It was not:

    Code:
    use https://www.stata-press.com/data/r17/hospdd, clear
    
    gen period = .
    replace period = 0 if inrange(month, 1, 3)
    replace period = 1 if inrange(month, 4, 7)
    gen treated = .
    replace treated = 0 if inrange(hospital, 19, 46)
    replace treated = 1 if inrange(hospital, 1, 18)
    
    reg satis i.period##i.treated, vce(cluster hospital)
    didregress (satis)(procedure), group(hospital) time(month)
    The estimated coefficients for procedure is the same between the two commands, but the standard errors are not. Now, I know that a 0,000107 difference in standard errors may seem pedantic, but for the sake of understanding how Stata commands work deep down, can anyone explain why the standard errors differ? Is it because 'reg' also provides estimates for the treated and period dummies?

  • #2
    Dear Emil,

    You are not being pedantic. They are different. The reason is that by default -didregress- uses a two-way fixed effects estimator to obtain the ATET. That is, it includes time and group indicators. You are fitting a two-by-two model instead. Point estimates should be equivalent but standard errors are slightly different. If you look at example 8 in the manual we discuss this in a bit more detail.

    https://www.stata.com/manuals/tedidregress.pdf

    Comment


    • #3
      Originally posted by Enrique Pinzon (StataCorp) View Post
      Dear Emil,

      You are not being pedantic. They are different. The reason is that by default -didregress- uses a two-way fixed effects estimator to obtain the ATET. That is, it includes time and group indicators. You are fitting a two-by-two model instead. Point estimates should be equivalent but standard errors are slightly different. If you look at example 8 in the manual we discuss this in a bit more detail.

      https://www.stata.com/manuals/tedidregress.pdf
      Dear Enrique, thanks for providing a concise answer.

      Comment


      • #4
        Originally posted by Enrique Pinzon (StataCorp) View Post
        Dear Emil,

        You are not being pedantic. They are different. The reason is that by default -didregress- uses a two-way fixed effects estimator to obtain the ATET. That is, it includes time and group indicators. You are fitting a two-by-two model instead. Point estimates should be equivalent but standard errors are slightly different. If you look at example 8 in the manual we discuss this in a bit more detail.

        https://www.stata.com/manuals/tedidregress.pdf

        Dear Enrique Pinzon (StataCorp),

        Hello!

        While I studying DID (and xtdidregress), I found this post.

        and, I can't find Example 8 in the manual you posted.

        Can you help me to find it?

        Please let me know where is example 8 (what page?)
        I just found example 7, but there is no example 8 in the manual.
        Am I making some mistake?

        Sorry for bothering you

        Best,
        Yeonwoo Sim

        Comment


        • #5
          Dear Yeonwoo,

          We migrated the [TE] manual and now it is the [CAUSAL] manual. When the migration happened something must have occurred. This is the relevant link now:

          https://www.stata.com/manuals/causaldidregress.pdf

          Best,
          Enrique
          Last edited by Enrique Pinzon (StataCorp); 31 Aug 2023, 00:56.

          Comment


          • #6
            Originally posted by Enrique Pinzon (StataCorp) View Post
            Dear Yeonwoo,

            We migrated the [TE] manual and now it is the [CAUSAL] manual. When the migration happened something must have occurred. This is the relevant link now:

            https://www.stata.com/manuals/causaldidregress.pdf

            Best,
            Enrique
            Thanks a lot!

            Comment


            • #7
              Originally posted by Enrique Pinzon (StataCorp) View Post
              Dear Yeonwoo,

              We migrated the [TE] manual and now it is the [CAUSAL] manual. When the migration happened something must have occurred. This is the relevant link now:

              https://www.stata.com/manuals/causaldidregress.pdf

              Best,
              Enrique


              Hi Enrique,


              Can the didregress command be also used if the outcome is BINARY?


              The Stata 17 mannual says and I quote "The ATET of a binary or continuous treatment on a CONTINUOUS outcome is estimated by fitting a linear model with time and group fixed effects." Do you know of any community contributed command for DiD for binary outcome.

              Right now, I am using the following command-

              didregress (quality education wealth caste) (treatment) if comparision == 2, group(group) time(year)

              the quality is a binary outcome.

              Is this valid??

              Comment


              • #8
                Dear Pavan,

                It is a linear regression model for a continuous outcome. Sometimes people model binary outcomes using a linear regression. A good reference of how to think about nonlinear DID is Jeff Wooldridge's recently published paper in The Econometrics Journal. The paper has discussion about estimation. There are earlier working paper versions of the article you can find online. Also on the same issue of the journal is the excellent survey paper on DID by Clément de Chaisemartin and Xavier D’Haultfœuille.

                https://academic.oup.com/ectj/issue?login=false

                Best,

                Enrique

                Comment

                Working...
                X