I am trying to run a simple DID model with a binary dependent variable, i.e. a logit model. Is this an approach that is possible? Simply running a regression as follows:
logit treat time did
logit treat time did
xtset unit_of_analysis time xtlogit outcome i.treat##i.time, fe
xtset personid int_year, yearly panel variable: personid (unbalanced) time variable: int_year, 2004 to 2011, but with gaps delta: 1 year xtlogit dep i.treat##i.time, fe
note: multiple positive outcomes within groups encountered. note: 1,638 groups (2,950 obs) dropped because of all positive or all negative outcomes. Iteration 0: log likelihood = -104.66559 Iteration 1: log likelihood = -104.52719 Iteration 2: log likelihood = -104.52643 Iteration 3: log likelihood = -104.52643 Conditional fixed-effects logistic regression Number of obs = 478 Group variable: personid Number of groups = 202 Obs per group: min = 2 avg = 2.4 max = 3 LR chi2(3) = 130.99 Log likelihood = -104.52643 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ dep | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.treat | .3432175 .8406951 0.41 0.683 -1.304515 1.99095 1.time | .3427126 .5699821 0.60 0.548 -.7744317 1.459857 | treat#time | 1 1 | 2.035563 .8818109 2.31 0.021 .3072454 3.76388 ------------------------------------------------------------------------------
hausman fe re
---- Coefficients ----
| (b) (B) (b-B) sqrt(diag(V_b-V_B))
| fe re Difference S.E.
-------------+----------------------------------------------------------------
1.treat | .3432175 .4256876 -.0824701 .6297125
1.time | .3427126 -.5866406 .9293532 .4353551
treat#time |
1 1 | 2.035563 2.302691 -.2671278 .6485319
------------------------------------------------------------------------------
b = consistent under Ho and Ha; obtained from xtlogit
B = inconsistent under Ha, efficient under Ho; obtained from xtlogit
Test: Ho: difference in coefficients not systematic
chi2(3) = (b-B)'[(V_b-V_B)^(-1)](b-B)
= 9.39
Prob>chi2 = 0.0245
margins time#treat margins treat, dydx(time)
Comment