Announcement

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

  • Difference-in-difference-in-difference estimation in Stata

    Dear Statalisters,

    I am trying to estimate the impact of a labor law (went into action in 2008) on income and consumption.

    The law was introduced in certain industries/sectors and not in others. Moreover, there are certain categories of people that were impacted (wage-employed) and others not (self-employed).

    I have already done a diff-in-diff for specific treated industries.
    My code is as such:

    HTML Code:
    *** Difference in Difference estimations with industries ***
    
    * Generate a dummy variable to indicate when the treatment started: 2008
    
    gen time=(year>2008) &!missing(year)
    
    * Generate a dummy variable to identify the group exposed to treatment 
    
    gen treated =(indusprimjob==3|indusprimjob==8|indusprimjob==5|indusprimjob==6|indusprimjob==7|indusprimjob==15) &!missing(indusprimjob)
    
    * Generate an interaction term between time and treated
    
    gen did=time*treated 
    I would like to include a treated and control group within the treated industries following this idea: "A more robust analysis than either of the DD analyses described above can be obtained by using both a different state and a control group within the treatment state." from Imbens/Wooldridge, Lecture Notes 10, Summer ’07.
    My treated group would be the wage-employed and control group would be the self-employed.

    If I understand correctly, this means that I will have two did estimators right? One which I already have, and another one capturing the interaction between time, treated, and another treated group within the treated group. I am not sure I completely grasped the concept...

    How can I code that in Stata? Could it be something like:
    HTML Code:
    gen treated =(indusprimjob==3|indusprimjob==8|indusprimjob==5|indusprimjob==6|indusprimjob==7|indusprimjob==15)|selfemployed==0 &!missing(indusprimjob,selfemployed)
    Thank you very much for your help!


  • #2
    I do not have the Imbens/Wooldridge lecture notes, but I think what they are referring to here is a 3-group comparison. Jeff Wooldridge frequently posts on this forum, so if I have this wrong, I'm sure he'll correct me.

    Group 0 (external controls) are those who are not in the affected industries. Then group 1 (internal controls) would be the group who are in affected industries but are exempt due to self-employment (or other exemptions in the law). Finally group 2 (intervention) consists of those who are subject to the law. So it would probably look like this:

    Code:
    gen byte group = 2 if inlist(indusprimjob, 3, 8, 5, 6, 7, 15) & !self_employed
    replace group = 1 if inlist(indusprimjob, 3, 8, 5, 6, 7, 15) & self_employed
    replace group = 0 if !inlist(indusprimjob, 3, 8, 5, 6, 7, 15) & !missing(indusprimjob)
    
    regression_command outcome_var i.group##i.time // AND PERHAPS COVARIATES
    margins group#time
    margins group, dydx(time)
    I assume here that you have some variable that identifies the people who are self-employed, or can calculate it from other information in your data set.

    There would be two DID estimators you get from this: one for 1.group#1.time and the other for 2.group#2.time. The first -margins- commands will give you expected outcomes in each group in each time period. And second will give you the average pre-post difference in each group. Note: if your regression command is a fixed effects regression, then you will likely need to add the -noestimcheck- option to the -margins- commands to get them to run, because the -group- variable will be omitted due to colinearity with the fixed effects.

    Note that by using -margins- you save yourself the headache of having to figure out which coefficients to add up and then how to adjust for any differences in covasriates: Stata does it all for you, quickly, effortlessly, and without mistakes. In order to use -margins, you must use factor-variable notation in your regression command. Do read -help fvvarlist- and the associated manual section to learn more about factor-variable notation. It is one of the best improvements to Stata in recent years, in my opinion.
    Last edited by Clyde Schechter; 05 Apr 2017, 09:51.

    Comment


    • #3
      Clyde-

      Many thanks for your help! I ran the code you provided and here is the outcome.
      If I understand the results correctly, group 1 has been negatively affected but group 2 has been positively affected? My did estimators being in the group#time "section". Also, shouldn't I have 2 time periods?

      Let's disregard the p-values here, I ran it with another outcome variable and got better p-values.

      HTML Code:
      
      reg lntotalincjob i.group##i.time
      
            Source |       SS           df       MS      Number of obs   =     1,924
      -------------+----------------------------------   F(5, 1918)      =     39.71
             Model |   118.46976         5  23.6939521   Prob > F        =    0.0000
          Residual |  1144.32708     1,918  .596625172   R-squared       =    0.0938
      -------------+----------------------------------   Adj R-squared   =    0.0915
             Total |  1262.79684     1,923  .656680624   Root MSE        =    .77242
      
      ------------------------------------------------------------------------------
      lntotal~cjob |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
             group |
                1  |   -.191327   .1299675    -1.47   0.141    -.4462194    .0635654
                2  |  -.3051794   .0664178    -4.59   0.000     -.435438   -.1749207
                   |
            1.time |   .4363648   .0583696     7.48   0.000     .3218901    .5508394
                   |
        group#time |
              1 1  |  -.2614726   .3426315    -0.76   0.445    -.9334421     .410497
              2 1  |   .0753531   .0790473     0.95   0.341    -.0796745    .2303807
                   |
             _cons |   10.23481   .0483705   211.59   0.000     10.13995    10.32968
      ------------------------------------------------------------------------------
      

      As for margins, isn't it strange that they are positive even if the effect has been negative? I am not sure I'm reading the results correctly.

      HTML Code:
       margins group#time
      
      Adjusted predictions                            Number of obs     =      1,924
      Model VCE    : OLS
      
      Expression   : Linear prediction, predict()
      
      ------------------------------------------------------------------------------
                   |            Delta-method
                   |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
        group#time |
              0 0  |   10.23481   .0483705   211.59   0.000     10.13995    10.32968
              0 1  |   10.67118   .0326697   326.64   0.000     10.60711    10.73525
              1 0  |   10.04349    .120631    83.26   0.000     9.806904    10.28007
              1 1  |   10.21838   .3153372    32.40   0.000     9.599938    10.83682
              2 0  |   9.929633    .045515   218.16   0.000     9.840369     10.0189
              2 1  |   10.44135    .027746   376.32   0.000     10.38694    10.49577
      ------------------------------------------------------------------------------
      Thank you!
      Last edited by Candice Yandam; 05 Apr 2017, 11:03.

      Comment


      • #4
        If I understand the results correctly, group 1 has been negatively affected but group 2 has been positively affected? My did estimators being in the group#time "section".
        No. The negative coefficient for 1.group#1.time does not mean that group 1 was negatively affected. It just means that the effect in group 1 was smaller than that in group 0 (the reference category for group.) Smaller might mean negative, but could also mean smaller positive. The effect in group 0 is given by the 1.time coefficient: about 0.44. The effect in group 1 is 1.time + 1.group#1.time, or approximately 0.4 - 0.26, which is about 0.14: smaller than group 0's effect but still positive. The effect in group 2 is 1.time + 2.group#1.time = 0.44 + 0.08, or about 0.52, the largest of the three effects. You cannot read effects in interaction models directly from the regression output. You have to combine the appropriate rows of the output table.

        Or, better, instead of adding up coefficients and having to keep straight which ones to add, you can get those results with the second -margins- command I suggested in #2, namely -margins group, dydx(time)-.

        Also, shouldn't I have 2 time periods?
        No. time is a dichotomous category, so as with any other "dummy" coding, you get one fewer variables than the number of levels. 2-1 = 1.

        As for margins, isn't it strange that they are positive even if the effect has been negative?
        No, you're misunderstanding what you have there. The output of that -margins- command gives expected values of lntotalincjob in each group in each time period. So you would not expect them to be negative unless in some group at some time the average lntotalincjob is negative. That seems unlikely as that would imply a total income of less than 1 dollar (or whatever currency unit). These numbers are not marginal effects. The marginal effects are from the other -margins- command which you did not run (or ran but did not show here). [And in any case, as noted above, none of the marginal effects are negative in any case.]

        Let's disregard the p-values here
        Hooray! Almost always a good idea!

        I ran it with another outcome variable and got better p-values.
        Boo! Unless the use of both this and the other outcome variable was pre-specified in your analysis protocol, this is just shopping for favorable p-values. That's not science. It's p-hacking. Some would even call it scientific misconduct (though I think that's a bit extreme). See Ronald L. Wasserstein & Nicole A. Lazar (2016): The ASA's statement on p-values: context, process, and purpose, The American Statistician, DOI:10.1080/00031305.2016.1154108, which you can download from http://dx.doi.org/10.1080/00031305.2016.1154108.


        Comment


        • #5
          Should I interrupt my professors during class to denounce their "scientific misconduct" regarding p-values?!
          Public denunciations are usually not effective, and when directed at people with power over you might provoke reprisals. Circulating the ASA article among them privately, however, might be useful. Even that is a judgment that you have to make, knowing the people involved.

          Comment


          • #6
            Dear Clyde we had a study covering 32 parishes in a district . 9 of these parishes were under an intervention while the rest were control. we wish to conduct a difference in a difference analysis but we had different households for baseline and follow-up. Therefore it cant be a DID in an individual but rather in a parish. but there are few parishes. what is your view about this? all together we have 818 households are baseline and about 850 at follow-up.

            Comment


            • #7
              You can still do it. Since your comparisons pre- and post- are for different households, they will not be as precise as they might have been with a longitudinal design, the household-level variation not being cancelled out. But you can still do it.

              Comment


              • #8
                thanks a lot

                Comment


                • #9
                  Hi Clyde, I’m using the DD model to estimates the impact of the euro on the growth volatility. I obtain some significant results but I would like to control my model. Since I do not have in my sample another control group I tried to run the same model than before using two placebo periods (I just consider the the effect of the Euro ten years before the real period) in order to prove that using this two periods I cannot obtain significant results, but I cannot obtain any estimates since the dummies are omitted by collinearity problem. This could highlight a problem also for my original model? There is some other way to prove the validity of the DD?
                  Thanks a lot!

                  Comment


                  • #10
                    You do not provide enough information to answer your question. In principle, using a "placebo" from ten years earlier should be possible. But may have structured your data incorrectly so that they do not actually reflect that. Or perhaps your code does not properly reflect the changes to the model. Without seeing example data, code, and output, it is impossible to give specific advice.

                    Comment


                    • #11
                      Sorry Clyde. I'm using Stata 13. The aim of my research is to verify how growth volatility change when a country is a euro member. I have a 5-years panel of european countries. Dependent variable and controls are the average value over 5 years and I create a dummy called euro that is 1 if a coutry has a euro, 0 otherwise and a country after that is 1 after the enter in the euro system, 0 otherwise. For example if a country enters in the euro zone in 2004 that period (2000-2005) is zero, the period after that is one. If a country enters in 2002 that period (2000-2005) is equal to 1 and also the following period. I use this following code:

                      Code:
                      xtset id year, delta (5)
                             panel variable:  id (strongly balanced)
                              time variable:  year, 1970 to 2010
                                      delta:  5 units
                      
                      . do "C:\Users\Utente\AppData\Local\Temp\STD09000000.tmp"
                      
                      . xtreg GDP_2010grw_sd5 euro##after iGDP_2010 Im_grw_sd5 lnBroadmoney_5 lnBroad_sd5 lninfl_5 Govern_cons_exp_GDP_sd5 i.
                      > year,fe cluster (id)
                      note: 1.euro omitted because of collinearity
                      note: 1.after omitted because of collinearity
                      
                      Fixed-effects (within) regression               Number of obs      =       107
                      Group variable: id                              Number of groups   =        21
                      
                      R-sq:  within  = 0.7399                         Obs per group: min =         2
                             between = 0.6486                                        avg =       5.1
                             overall = 0.5991                                        max =         9
                      
                                                                      F(15,20)           =    116.66
                      corr(u_i, Xb)  = -0.7489                        Prob > F           =    0.0000
                      
                                                                     (Std. Err. adjusted for 21 clusters in id)
                      -----------------------------------------------------------------------------------------
                                              |               Robust
                              GDP_2010grw_sd5 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                      ------------------------+----------------------------------------------------------------
                                       1.euro |          0  (omitted)
                                      1.after |          0  (omitted)
                                              |
                                   euro#after |
                                         1 1  |   .0609861   .0097653     6.25   0.000     .0406162    .0813561
                                              |
                                    iGDP_2010 |  -.0125092   .0225337    -0.56   0.585    -.0595136    .0344953
                                   Im_grw_sd5 |    .001237   .0001654     7.48   0.000     .0008921     .001582
                               lnBroadmoney_5 |  -.0014416   .0036364    -0.40   0.696     -.009027    .0061437
                                  lnBroad_sd5 |   .0006373   .0094612     0.07   0.947    -.0190984     .020373
                                     lninfl_5 |   .0027366   .0035115     0.78   0.445    -.0045884    .0100615
                      Govern_cons_exp_GDP_sd5 |   .0034959   .0031421     1.11   0.279    -.0030584    .0100502
                                              |
                                         year |
                                        1975  |    .000536    .005683     0.09   0.926    -.0113185    .0123905
                                        1980  |   .0101922   .0066056     1.54   0.139    -.0035869    .0239713
                                        1985  |   .0072235   .0078661     0.92   0.369    -.0091848    .0236318
                                        1990  |   .0122165    .010012     1.22   0.237    -.0086682    .0331013
                                        1995  |   .0085086   .0105332     0.81   0.429    -.0134632    .0304805
                                        2000  |  -.0013375   .0101053    -0.13   0.896    -.0224168    .0197418
                                        2005  |   .0220778   .0099021     2.23   0.037     .0014224    .0427332
                                        2010  |   .0109246   .0152139     0.72   0.481     -.020811    .0426602
                                              |
                                        _cons |   .1471181   .1404911     1.05   0.308    -.1459411    .4401774
                      ------------------------+----------------------------------------------------------------
                                      sigma_u |  .01709258
                                      sigma_e |  .01213935
                                          rho |  .66471658   (fraction of variance due to u_i)
                      -----------------------------------------------------------------------------------------
                      Here maybe there is some problem since the first two dummies are cancelled out. I did not calculate the marginal effect with margins since I understood that the marginal effect is the beta of euro#efter. I'm wrong? Because following your example before I have now some doubts.
                      Then I introduce a placebo period starting from 1990, the dummy placebo is equal to 1 after 1990, 0 otherwise. This is the result

                      Code:
                      . xtreg GDP_2010grw_sd5 euro##placebo iGDP_2010 Im_grw_sd5 lnBroadmoney_5 lnBroad_sd5 lninfl_5 Govern_cons_exp_GDP_sd5 
                      > i.year,fe cluster (id)
                      note: 1.euro omitted because of collinearity
                      note: 1.placebo omitted because of collinearity
                      note: 1.euro#1.placebo omitted because of collinearity
                      
                      Fixed-effects (within) regression               Number of obs      =       107
                      Group variable: id                              Number of groups   =        21
                      
                      R-sq:  within  = 0.6364                         Obs per group: min =         2
                             between = 0.3332                                        avg =       5.1
                             overall = 0.0835                                        max =         9
                      
                                                                      F(14,20)           =     14.40
                      corr(u_i, Xb)  = -0.5539                        Prob > F           =    0.0000
                      
                                                                     (Std. Err. adjusted for 21 clusters in id)
                      -----------------------------------------------------------------------------------------
                                              |               Robust
                              GDP_2010grw_sd5 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                      ------------------------+----------------------------------------------------------------
                                       1.euro |          0  (omitted)
                                    1.placebo |          0  (omitted)
                                              |
                                 euro#placebo |
                                         1 0  |          0  (empty)
                                         1 1  |          0  (omitted)
                                              |
                                    iGDP_2010 |   .0086552   .0265714     0.33   0.748    -.0467718    .0640823
                                   Im_grw_sd5 |   .0013367   .0002352     5.68   0.000     .0008462    .0018273
                               lnBroadmoney_5 |   .0051925   .0053076     0.98   0.340     -.005879    .0162639
                                  lnBroad_sd5 |  -.0083039   .0104041    -0.80   0.434    -.0300064    .0133986
                                     lninfl_5 |  -.0039693   .0054642    -0.73   0.476    -.0153674    .0074288
                      Govern_cons_exp_GDP_sd5 |   .0062777   .0040594     1.55   0.138    -.0021899    .0147454
                                              |
                                         year |
                                        1975  |  -.0030186   .0074738    -0.40   0.691    -.0186087    .0125715
                                        1980  |   .0033608   .0083932     0.40   0.693    -.0141471    .0208687
                                        1985  |  -.0033838   .0101171    -0.33   0.742    -.0244876    .0177201
                                        1990  |  -.0039051   .0132437    -0.29   0.771    -.0315309    .0237208
                                        1995  |  -.0080212   .0133396    -0.60   0.554     -.035847    .0198047
                                        2000  |  -.0225883   .0137245    -1.65   0.115     -.051217    .0060405
                                        2005  |  -.0006481   .0135213    -0.05   0.962     -.028853    .0275568
                                        2010  |  -.0177878   .0174967    -1.02   0.321    -.0542852    .0187096
                                              |
                                        _cons |  -.1801407   .1487508    -1.21   0.240    -.4904295    .1301481
                      ------------------------+----------------------------------------------------------------
                                      sigma_u |  .02486753
                                      sigma_e |  .01425197
                                          rho |  .75275037   (fraction of variance due to u_i)
                      -----------------------------------------------------------------------------------------
                      I would appreciate so much any insights. Thank you!

                      Comment


                      • #12
                        The first analysis looks OK. The omission of the euro variable is expected because it is a time-invariant attribute of the country, and so is colinear with the fixed effects. The omission of the after variable is a little surprising, but not entirely so. That's because it is colinear with the year variables. I would have expected Stata to drop one of the time indicators instead of the after variable, but for these purposes it makes no difference which gets omitted. You are correct that the DID estimator of the euro effect is the coefficient of 1.euro#1.after and you do not need the -margins- command to get that. (I would think you would be interested in reporting the expected outcomes in each combination of euro and after as well, which you would most easily get from -margins-. But if all you are interested in is the effect of adopting the Euro, what you did is sufficient.)

                        The second one is problematic. I think you may not have calculated your placebo variable correctly. 1.euro#0.placebo should not be "empty." All countries, whether they ultimately adopt the Euro or not, should have placebo = 0 prior to 1990. So you need to re-check your code to see if you did it incorrectly. Another possibility is that missing data in the other variables has subverted your analysis. Remember that an observation will be included in the analysis only if it has non-missing values for every variable in the regression. It may be that even though you calculated the placebo variable correctly, perhaps when observations with any missing values for other variables in the model are excluded, there are no observations left with euro = 1 and placebo = 0. Otherwise put, it may be that every observation that has euro = 1 and placebo = 0 has a missing value for some variable in the regression. You can check this easily:

                        Code:
                        tab euro placebo // COMBINATIONS IN ENTIRE DATA SET
                        // RUN THE SECOND REGRESSION
                        tab euro placebo if e(sample) // COMBINATIONS IN ESTIMATION SAMPLE

                        Comment


                        • #13
                          Thank you for your answer Clyde! If I understod correctly do not have observation with euro=1 and placebo=0 makes issues on my model. I think that this may be the problem, but I obtain the same results also for the after dummy. I show you my results. The first regression is the same than before, I just add the tab

                          Code:
                          . xtreg GDP_2010grw_sd5 euro##after iGDP_2010 Im_grw_sd5 lnBroadmoney_5 lnBroad_sd5 lninfl_5 Govern_cons_exp_GDP_sd5 i.
                          > year,fe cluster (id)
                          note: 1.euro omitted because of collinearity
                          note: 1.after omitted because of collinearity
                          
                          Fixed-effects (within) regression               Number of obs      =       107
                          Group variable: id                              Number of groups   =        21
                          
                          R-sq:  within  = 0.7399                         Obs per group: min =         2
                                 between = 0.6486                                        avg =       5.1
                                 overall = 0.5991                                        max =         9
                          
                                                                          F(15,20)           =    116.66
                          corr(u_i, Xb)  = -0.7489                        Prob > F           =    0.0000
                          
                                                                         (Std. Err. adjusted for 21 clusters in id)
                          -----------------------------------------------------------------------------------------
                                                  |               Robust
                                  GDP_2010grw_sd5 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                          ------------------------+----------------------------------------------------------------
                                           1.euro |          0  (omitted)
                                          1.after |          0  (omitted)
                                                  |
                                       euro#after |
                                             1 1  |   .0609861   .0097653     6.25   0.000     .0406162    .0813561
                                                  |
                                        iGDP_2010 |  -.0125092   .0225337    -0.56   0.585    -.0595136    .0344953
                                       Im_grw_sd5 |    .001237   .0001654     7.48   0.000     .0008921     .001582
                                   lnBroadmoney_5 |  -.0014416   .0036364    -0.40   0.696     -.009027    .0061437
                                      lnBroad_sd5 |   .0006373   .0094612     0.07   0.947    -.0190984     .020373
                                         lninfl_5 |   .0027366   .0035115     0.78   0.445    -.0045884    .0100615
                          Govern_cons_exp_GDP_sd5 |   .0034959   .0031421     1.11   0.279    -.0030584    .0100502
                                                  |
                                             year |
                                            1975  |    .000536    .005683     0.09   0.926    -.0113185    .0123905
                                            1980  |   .0101922   .0066056     1.54   0.139    -.0035869    .0239713
                                            1985  |   .0072235   .0078661     0.92   0.369    -.0091848    .0236318
                                            1990  |   .0122165    .010012     1.22   0.237    -.0086682    .0331013
                                            1995  |   .0085086   .0105332     0.81   0.429    -.0134632    .0304805
                                            2000  |  -.0013375   .0101053    -0.13   0.896    -.0224168    .0197418
                                            2005  |   .0220778   .0099021     2.23   0.037     .0014224    .0427332
                                            2010  |   .0109246   .0152139     0.72   0.481     -.020811    .0426602
                                                  |
                                            _cons |   .1471181   .1404911     1.05   0.308    -.1459411    .4401774
                          ------------------------+----------------------------------------------------------------
                                          sigma_u |  .01709258
                                          sigma_e |  .01213935
                                              rho |  .66471658   (fraction of variance due to u_i)
                          -----------------------------------------------------------------------------------------
                          
                          . 
                          end of do-file
                          
                          . tab euro placebo if e(sample)
                          
                                     |        placebo
                                euro |         0          1 |     Total
                          -----------+----------------------+----------
                                   0 |        19         79 |        98 
                                   1 |         0          9 |         9 
                          -----------+----------------------+----------
                               Total |        19         88 |       107
                          The second is the following, I obtain the placebo as greater than 1985 since I have a 5-year panel:

                          Code:
                          . sort id year
                          
                          . gen placebo =(year>1985)
                          
                          . do "C:\Users\Utente\AppData\Local\Temp\STD09000000.tmp"
                          
                          . xtreg GDP_2010grw_sd5 euro##placebo iGDP_2010 Im_grw_sd5 lnBroadmoney_5 lnBroad_sd5 lninfl_5 Govern_cons_exp_GDP_sd5 
                          > i.year,fe cluster (id)
                          note: 1.euro omitted because of collinearity
                          note: 1.placebo omitted because of collinearity
                          note: 1.euro#1.placebo omitted because of collinearity
                          
                          Fixed-effects (within) regression               Number of obs      =       107
                          Group variable: id                              Number of groups   =        21
                          
                          R-sq:  within  = 0.6364                         Obs per group: min =         2
                                 between = 0.3332                                        avg =       5.1
                                 overall = 0.0835                                        max =         9
                          
                                                                          F(14,20)           =     14.40
                          corr(u_i, Xb)  = -0.5539                        Prob > F           =    0.0000
                          
                                                                         (Std. Err. adjusted for 21 clusters in id)
                          -----------------------------------------------------------------------------------------
                                                  |               Robust
                                  GDP_2010grw_sd5 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                          ------------------------+----------------------------------------------------------------
                                           1.euro |          0  (omitted)
                                        1.placebo |          0  (omitted)
                                                  |
                                     euro#placebo |
                                             1 0  |          0  (empty)
                                             1 1  |          0  (omitted)
                                                  |
                                        iGDP_2010 |   .0086552   .0265714     0.33   0.748    -.0467718    .0640823
                                       Im_grw_sd5 |   .0013367   .0002352     5.68   0.000     .0008462    .0018273
                                   lnBroadmoney_5 |   .0051925   .0053076     0.98   0.340     -.005879    .0162639
                                      lnBroad_sd5 |  -.0083039   .0104041    -0.80   0.434    -.0300064    .0133986
                                         lninfl_5 |  -.0039693   .0054642    -0.73   0.476    -.0153674    .0074288
                          Govern_cons_exp_GDP_sd5 |   .0062777   .0040594     1.55   0.138    -.0021899    .0147454
                                                  |
                                             year |
                                            1975  |  -.0030186   .0074738    -0.40   0.691    -.0186087    .0125715
                                            1980  |   .0033608   .0083932     0.40   0.693    -.0141471    .0208687
                                            1985  |  -.0033838   .0101171    -0.33   0.742    -.0244876    .0177201
                                            1990  |  -.0039051   .0132437    -0.29   0.771    -.0315309    .0237208
                                            1995  |  -.0080212   .0133396    -0.60   0.554     -.035847    .0198047
                                            2000  |  -.0225883   .0137245    -1.65   0.115     -.051217    .0060405
                                            2005  |  -.0006481   .0135213    -0.05   0.962     -.028853    .0275568
                                            2010  |  -.0177878   .0174967    -1.02   0.321    -.0542852    .0187096
                                                  |
                                            _cons |  -.1801407   .1487508    -1.21   0.240    -.4904295    .1301481
                          ------------------------+----------------------------------------------------------------
                                          sigma_u |  .02486753
                                          sigma_e |  .01425197
                                              rho |  .75275037   (fraction of variance due to u_i)
                          -----------------------------------------------------------------------------------------
                          
                          . 
                          end of do-file
                          
                          . tab euro placebo if e(sample)
                          
                                     |        placebo
                                euro |         0          1 |     Total
                          -----------+----------------------+----------
                                   0 |        19         79 |        98 
                                   1 |         0          9 |         9 
                          -----------+----------------------+----------
                               Total |        19         88 |       107
                          The results is the same than before but in this case I did not obtain any estimates. My professor told me that I need such a control since the analysis is weak without it. What do you think?

                          Comment


                          • #14
                            No, you do not have the same situation with variable after. You just did the wrong test. Do it this way:

                            Code:
                            xtreg GDP_2010grw_sd5 euro##after iGDP_2010 Im_grw_sd5 lnBroadmoney_5 lnBroad_sd5 lninfl_5 Govern_cons_exp_GDP_sd5 i.year,fe cluster (id)
                            tab euro after if e(sample)
                            
                            xtreg GDP_2010grw_sd5 euro##placebo iGDP_2010 Im_grw_sd5 lnBroadmoney_5 lnBroad_sd5 lninfl_5 Govern_cons_exp_GDP_sd5 i.year,fe cluster (id)
                            tab euro placebo if e(sample)
                            You will see that you do have observations with all combinations of variables euro and after in the estimation sample of your regression using after. But, as you have already seen, your placebo variable is never 0 in combination with euro = 1 in the estimation sample.

                            Again, you need to check whether your calculation of the variable placebo is actually correct. If it is correct, then the missing data is the problem. In that case, I suggest trying a different placebo cutoff. I would screen each possibility by first dropping from your data set any observation with any missing values on any regression variable, and then tabulating the combinations of euro and each candidate value of the placebo transition year. Only use a value of placebo where you find observations in all four combinations.


                            Comment


                            • #15
                              Yes Clyde you rigth, I did the wrong test. Now I run the correct test as you suggest and I have a combination of euro=1 and after=0 so it runs and gives me an estimate. I will try to find a combination, if I have it, in which euro=0 and placebo=1.
                              I can also try to drop some variables but I'm afraid that it seems to my tutor like a research of favorable results and this is not my intention. I know that is not your suggestion and I want to avoid any behavior that can sound like a misconduct.
                              Thanks a lot for your valuable advices!!!

                              Comment

                              Working...
                              X