Good day
I want to perform a difference in difference regression defined as
treatment is a self created binary variable that seems to be performing correctly
However for some reason my time variable is causing issues as can be seen by the following output
Survey is coded as 1 or 2 for the two respective waves. However, for some reason it will not perform the interaction and I do not understand why. There is variation in all variables used. I have used survey for other things in my code, so why won't it use the second wave for the regression and instead omits it? Is it an operator error? Because if I use two "##" instead of one (and shorten my equation properly) to do the following equation
I get the following output
Here I get the interaction term, so is this now correct? It is basically the same as the first output, only that the interaction term is now positive instead of negative, but almost all other values are identical or very similar. So is this now a properly done diff in diff interaction?
I want to perform a difference in difference regression defined as
Code:
mi estimate, esampvaryok: reg job_hours treatment survey survey#treatment, robust
However for some reason my time variable is causing issues as can be seen by the following output
Code:
. mi estimate, esampvaryok: reg job_hours treatment survey survey#treatment, robust Multiple-imputation estimates Imputations = 5 Linear regression Number of obs = 47 Average RVI = 0.1641 Largest FMI = 0.3495 Complete DF = 43 DF adjustment: Small sample DF: min = 16.96 avg = 30.94 max = 39.37 Model F test: Equal FMI F( 3, 32.3) = 1.60 Within VCE type: Robust Prob > F = 0.2078 ---------------------------------------------------------------------------------- job_hours | Coef. Std. Err. t P>|t| [95% Conf. Interval] -----------------+---------------------------------------------------------------- treatment | -7.204348 10.75615 -0.67 0.512 -29.90156 15.49287 survey | -6.755652 3.470882 -1.95 0.059 -13.7762 .2648965 | survey#treatment | 1 1 | -2.855652 17.76597 -0.16 0.873 -39.22317 33.51187 2 0 | 0 (omitted) 2 1 | 0 (omitted) | _cons | 50.41565 5.211848 9.67 0.000 39.87688 60.95442 ----------------------------------------------------------------------------------
Code:
mi estimate, esampvaryok: reg job_hours survey##treatment, robust
Code:
. mi estimate, esampvaryok: reg job_hours survey##treatment, robust Multiple-imputation estimates Imputations = 5 Linear regression Number of obs = 47 Average RVI = 0.1641 Largest FMI = 0.1763 Complete DF = 43 DF adjustment: Small sample DF: min = 28.42 avg = 34.41 max = 39.55 Model F test: Equal FMI F( 3, 32.3) = 1.60 Within VCE type: Robust Prob > F = 0.2078 ---------------------------------------------------------------------------------- job_hours | Coef. Std. Err. t P>|t| [95% Conf. Interval] -----------------+---------------------------------------------------------------- 2.survey | -6.755652 3.470882 -1.95 0.059 -13.7762 .2648965 1.treatment | -10.06 14.64265 -0.69 0.497 -39.93717 19.81717 | survey#treatment | 2 1 | 2.855652 17.76597 0.16 0.873 -33.51187 39.22317 | _cons | 43.66 2.246678 19.43 0.000 39.11769 48.20231 ----------------------------------------------------------------------------------
Here I get the interaction term, so is this now correct? It is basically the same as the first output, only that the interaction term is now positive instead of negative, but almost all other values are identical or very similar. So is this now a properly done diff in diff interaction?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte job_hours float treatment byte survey . . 2 . . 2 . . 2 13 . 2 . . 2 . . 2 46 0 1 42 0 2 46 0 1 42 0 2 46 0 1 42 0 2 46 0 1 42 0 2 46 0 1 42 0 2 46 0 1 42 0 2 . 1 1 . 1 2 51 1 1 35 1 2 37 1 1 35 1 2 55 1 1 58 1 2 65 1 1 36 1 2 48 1 1 38 1 2 38 0 1 40 0 2 38 0 1 40 0 2 38 0 1 40 0 2 38 0 1 40 0 2 38 0 1 40 0 2 38 0 1 40 0 2 . 0 1 . 0 2 . 0 1 . 0 2 . 0 1 . 0 2 . 0 1 . 0 2 . 0 1 . 0 2 . 0 1 . 0 2 41 0 1 40 0 2 41 0 1 40 0 2 41 0 1 40 0 2 41 0 1 40 0 2 41 0 1 40 0 2 41 0 1 40 0 2 0 . 1 0 . 1 0 . 1 0 . 1 0 . 1 0 . 1 31 . 1 31 . 1 31 . 1 31 . 1 31 . 1 31 . 1 52 . 1 52 . 1 52 . 1 52 . 1 52 . 1 52 . 1 38 . 1 38 . 1 38 . 1 38 . 1 38 . 1 38 . 1 38 0 1 45 0 2 38 0 1 45 0 2 38 0 1 45 0 2 38 0 1 45 0 2 38 0 1 45 0 2 end
Comment