Announcement

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

  • Difference in Difference Model - Binary outcome variable- Panel data

    Hi,

    I am trying to do a diff in diff model for the panel dataset. My outcome variable (y) is binary. Treated is 1 if the individual uses y and 0 otherwise. Post is 1 for post-policy change and 0 otherwise.
    I can perfectly run a LPM model using tthe follwoing code:

    xtreg y treated post treated##post $a1 $a2 $a3 , r

    I get extremely different results when I use FE (fixed effects) or RE(random effects). By that, I mean an extremely small coefficient for when I run FE like -2.03e-16 for my interaction term. All p values for this model, FE, are equal to 1.

    Also, when I run a probit model I get an error of r(2000). The code for the probit is :

    xtprobit y treated post treated##post $a1 $a2 $a3 , vce(cluster id)

    outcome = treated > 0 predicts data perfectly
    r(2000);

    Can someone please help? Thanks.
    Not sure how I can show the result using dataex.

    Kind Regards,
    Aarushi

  • #2

    I am getting this result for the Fixed effect model :
    Sorry not sure how to format it -

    note: 1.treated omitted because of collinearity
    note: 1.post omitted because of collinearity

    Fixed-effects (within) regression Number of obs = 21,998
    Group variable: id Number of groups = 8,635

    R-sq: Obs per group:
    within = 1.0000 min = 1
    between = 1.0000 avg = 2.5
    overall = 1.0000 max = 4

    F(0,8634) = .
    corr(u_i, Xb) = -0.8338 Prob > F = .

    (Std. Err. adjusted for 8,635 clusters in id)
    ----------------------------------------------------------------------------------------------------------------
    | Robust
    y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    -----------------------------------------------+----------------------------------------------------------------
    treated | 1 3.13e-11 3.2e+10 0.000 1 1
    post | 3.93e-17 1.28e-10 0.00 1.000 -2.51e-10 2.51e-10
    |
    treated |
    Treatment Group | 0 (omitted)
    |
    post |
    Post-policy | 0 (omitted)
    |
    treated#post |
    Treatment Group#Post-policy | -2.03e-16 7.50e-12 -0.00 1.000 -1.47e-11 1.47e-11

    Comment


    • #3
      You will increase your chances of useful answer by following the FAQ on asking questions-provide Stata code in code delimiters, readable Stata out what, and sample data using dataex.

      What it looks like is that the dependent variable equals 1 for all usable observations where treated is greater than zero. This probably means you've made a coding error. While with the probit estimates the model won't work at all, you get very strange results with the regression estimates.

      One thing to do would be restrict the sample to the usable observations, and then do summary for the dependent variable if treated==1. It is also possible that you don't have variance in the dependent variable or in the treated variable within panels. Remember, if you treat in year t, the dummy for treat must start in year t and not go for the entire panel.

      Comment

      Working...
      X