= Difference in Differences = '''Difference in differences''' is a [[Statistics/CausalInference#Quasi-Experiments|quasi-experimental]] method. <> ---- == Description == The method can be expressed as: {{attachment:graph.png||width=200px}} where A, B, C, and D represent sample statistics; and where A and C are from treated samples. There is an assumption of parallel trends: absent treatment, AC should be parallel to BD as average change would have been equivalent. The interpretation becomes: * B is the baseline average * D-B is the time trend * A-B is the difference between groups * (C-A)-(D-B) is the difference in differences ---- == Implementation == The method is generally implemented using [[Statistics/OrdinaryLeastSquares|OLS regression]]. Given indicators ''T'' where ''T,,t,,=1'' if time period ''t'' is the second one, and ''S'' where ''S,,i,,=1'' if observation ''i'' is in the treatment group, fit the following model: ''Y,,it,, = β,,0,, + β,,1,,T,,t,, + β,,2,,S,,i,, + β,,3,,(T,,t,,S,,i,,) + ϵ,,it,,'' The coefficients can be interpreted as: * ''β,,0,,'' is the baseline average * ''β,,1,,'' is the time trend * ''β,,2,,'' is the difference between groups * ''β,,3,,'' is the difference in differences [[Statistics/FixedEffectsModel|Fixed effects]] for both units and time periods are generally included, leading to these being called '''two-way fixed effects''' models. Alternatively, calculate the [[Statistics/FirstDifferencedEstimator|first differenced]] outcomes as ''Y',,i,, = Y,,i2,, - Y,,i1,,''. Now fit the model: ''Y',,i,, = β,,1,, + β,,3,,S,,i,, + (ϵ,,i2,, - ϵ,,i1,,)'' Once again, ''β,,3,,'' is the difference in differences. ---- CategoryRicottone