Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: Difference-in-Differences and Panel Data - In search of an adequate regression

 From Sjoerd van Bekkum To "statalist@hsphsun2.harvard.edu" Subject Re: st: Difference-in-Differences and Panel Data - In search of an adequate regression Date Thu, 3 Jan 2013 04:09:22 +0100

```Maybe my post was too brief. I think what Barbara wants to do (and
what I meant in my previous post) is, assuming two groups and 2
(pre-/post) periods:

y = a + b*D(treatment=1) + c*D(post=1) + d*D(treatment=1)*D(post=1) + e,

where D are indicator variables. As mentioned in the paper I cited
above, this leads to the following groups:

E[y|treated, post] =a+b+c+d
E[y|treated, pre] = a+b
E[y|not treated,post] = a+c
E[y|not treated, pre] = a

with the dif-in-dif captured by

DID = {E[y|treated, post]-E[y|treated, pre]} - {E[y|not
treated,post]-E[y|not treated, pre]}
= {a+b+c+d - (a+b)} - {a+c - a}
= d

with cluster-robust errors, as Austin mentioned. I don't see any
collinearity problems here.

On 3 January 2013 02:03, Austin Nichols <austinnichols@gmail.com> wrote:
>
> Barbara Engels <engels.ba@gmail.com> :
> You should certainly use cluster-robust SE to account for repeated
> observations, but how could you include FE and a dummy for treatment
> group? With a post dummy, and a treatment dummy, and the interaction,
> there would be a severe perfect collinearity problem.
>
> On Wed, Jan 2, 2013 at 3:49 PM, Barbara Engels <engels.ba@gmail.com>
> wrote:
> > Dear Stata people,
> >
> > I am currently working on a difference-in-differences model in its
> > simplest form  - treatment and control group, pre- and post-intervention
> > period.
> > However, I got a large panel data set and I wonder what is the best way
> > to estimate the DID in Stata to account for flaws like serial correlation.
> > Should I go for a simple
> >
> > reg y x  incl. interaction term, ROBUST
> >
> > Or should I apply clustering?
> > Or even xtreg with fe?
> >
> > Any help is greatly appreciated.
> >
> > Thanks a lot, happy 2013!
> >
> > Barbara
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/
```