Announcement

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

  • Diference in Difference with Fixed effects

    Hello everybody,

    I am new here and since I am not that experienced with STATA I would like to ask you how to provide such a baseline regression in STATA using dialog box, as follows Statistics > Treatment effects > Continuous outcomes > Difference in differences (FE) or even by command xtdidregress.

    I have a panel dataset consisting of banks (their names) + some other factors (8) influencing the dependent variable (1) for period of time (2012-2019).


    yijt = α + β1 * (Treatmentit) + β2 * (PostPeriodt) + β3 * (Treatmentit * PostPeriodt ) + β4 * factor1ijt+⋯+βn * factorNijt+ δit + ϴit + εit

    yijt stand for dependent variable of a bank i at time t in country j
    Treatmentit stands for variable that equals 1 if bank i at time t has the factor1 variable greater than or equal to the chosen threshold and takes value 0 if it is lower than threshold
    PostPeriodt stands for variable that equals 1 the year (2014) that the specific policy was adopted and takes value 0 prior the time the policy was introduced
    factorNijt stands for all the factors influencing dependent variable for a bank i at time t in country j
    δt and θt stands for year and bank fixed effects
    εit stands for errors

    Errors have to be clustered on bank level (if I understoof it correctly - based on their names as each of banks is specific)

    So far I have created dummy variables:

    Treat which gets 1 if it in Treatment group and 0 if its in Reference group
    PostPeriod which gets 1 if years are >=2014 and 0 if <2014
    Treat_PostPeriod which is the interaction of both - if Treat ==1 and PostPeriod == 1 then Treat_PostPeriod =1

    Even though I have all variables and dummies ready I do not know how to continue and process with DiD and get fixed effects for bank and year.

    In my opinion, as it is abovementioned in baseline regression, I should get a regression table which shows me effect of each of the variables on the dependent variable - correct me if I am wrong. Although what I get when I try to put variables correctly into the cells of dialog box for DiD (FE) I get only 3 variables that are explained.

    Last question : in case of such a regression and used method - what tests you would reccomend ? Can you also provide some of the code, please ?

    Thank you very much. I have been looking for answers on forums + videos but this seems to me as a specific case which with my experience I am not able to solve.


    Last edited by Stanislav Beli; 21 Jun 2021, 12:51.

  • #2
    reghdfe y c.treatment#c.post x1 x2 x3 x4 x5 x6 x7 x8 , absorb(firm year) cluster(firm)

    you don't need the postperiod and treatment variables as they are collinear with the fixed effects (firm year).

    make sure you have enough firms for clustering (10 at least, more is better).

    Comment

    Working...
    X