Reputation: 27
I want to calculate univariate t-statistic for difference-in-difference.
I have unbalenced panel dataset including treatment and control groups, as follows:
Treatment Control
Pre-period 5.33 8.9
Post-period 5.10 6.9
From the above database, I would like to get
Treatment Control Difference
Pre-period 5.33 8.9 -3.57
Post-period 5.10 6.9 -1.8
Difference 0.23 2.0 -1.77
Of course, I would like to get t-statistics for each of differences (in total, 5).
Thank you in advance.
Upvotes: 0
Views: 799
Reputation: 643
Let
D(,pre) = [Treat,Pre] - [Control,Pre]
D(,post) = [Treat,Post] - [Control,Post]
D(treat,) = [Treat,Post] - [Treat,Pre]
D(control,) = [Control,Post] - [Control,Pre]
DID = D(post) - D(pre) = D(treat) - D(control).
In your example, D(,pre)
= -3.57, D(,post)
= -1.8, D(treat,)
= -0.23, D(control,)
= -2.0 and DID
= 1.77. (Note: We go post-pre rather than pre-post.) Let "Treat", "Control", "Pre" and "Post" be the four dummy variables.
reg y Treat##Post
gives D(,pre)
, D(control,)
and DID
.reg y Control##Post
gives -D(,pre)
, D(treat,)
and DID
.reg y Treat##Pre
gives D(,post)
, -D(control,)
and DID
.reg y Control##Pre
gives -D(,post)
, -D(treat,)
and DID
.Explanation: Do reg y Treat Post c.Treat#c.Post
. The coefficient of Treat
is E(y|Treat=1, Post=0) - E(y|Treat=0, Post=0)
, which is D(,pre)
. The coefficient of Post
is E(y|Treat=0, Post=1) - E(y|Treat=0, Post=0)
, which is D(control,)
. The coefficient on the interaction term is DID
obviously. Others are similar.
Upvotes: 1