Announcement

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

  • very large coefficients in dif-in-dif

    Hi Statalist users

    I run a study to get the effect of the minimum wage increases on the employment rate. Now I run a difference-in-difference analysis and got for some age category very large coefficients.
    My method is that I built groups with individuals who have the same characteristics, for example are female and hold a master degree. For this groups I calculated the cap-measure.

    I run the following code, to know the dif-in-dif coefficient of the groups containing only people who are 30-39 years old:

    Code:
    reg ln_unemployment_rate indicate avg i.numvar avg i.numvar##c.avg if anos2 == "03" , vce (cluster code)
    numvar ist my time-variable, code is the group-id and anos2=="03" are the 30-39 year old people. avg is my gap measure. I tried to control for the interaction of the gap-measure with time, for the gap-measure itself and for time-fixed effects.
    Did I do something wrong in coding or is this result realistic?
    I would be very thankful if someone could help me, since I'm really a beginner.

    Best

    Felix


    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float code int numvar float ln_unemployment_rate str2 anos2 byte anos2_n float avg_GAP_c str3 estu byte isdup str2 nuts1 byte nuts1_n str2 sexo byte sexo_n float(Anzahl_Betroffene post) long estu_n float(indicate Arbeitslosenrate all)
     8 222  -.6931472 "01" 1  .05259339 "2" 0 "2" 2 "1" 1  1 0 2          0        .5         2
     8 234  -.6931472 "01" 1  .05259339 "2" 0 "2" 2 "1" 1  1 1 2  .05259339        .5         2
     8 226 -.55961573 "01" 1  .05259339 "2" 0 "2" 2 "1" 1  1 0 2          0  .5714286      1.75
     8 230  -.4054651 "01" 1  .05259339 "2" 0 "2" 2 "1" 1  1 0 2          0  .6666667       1.5
     8 238  -.4054651 "01" 1  .05259339 "2" 0 "2" 2 "1" 1  1 1 2  .05259339  .6666667       1.5
     8 240 -.22314353 "01" 1  .05259339 "2" 0 "2" 2 "1" 1  1 1 2  .05259339        .8      1.25
     8 214 -.15415066 "01" 1  .05259339 "2" 0 "2" 2 "1" 1  1 0 2          0  .8571429 1.1666666
     8 218          0 "01" 1  .05259339 "2" 0 "2" 2 "1" 1  1 0 2          0         1         1
    12 238 -.55961573 "01" 1  .04764649 "2" 0 "4" 4 "1" 1  2 1 2  .04764649  .5714286       3.5
    12 226  -.5389965 "01" 1  .04764649 "2" 0 "4" 4 "1" 1  2 0 2          0  .5833333 3.4285715
    12 240  -.4855078 "01" 1  .04764649 "2" 0 "4" 4 "1" 1  2 1 2  .04764649  .6153846      3.25
    12 234   -.427444 "01" 1  .04764649 "2" 0 "4" 4 "1" 1  2 1 2  .04764649  .6521739 3.0666666
    12 222  -.3254224 "01" 1  .04764649 "2" 0 "4" 4 "1" 1  2 0 2          0  .7222222  2.769231
    12 214 -.27443686 "01" 1  .04764649 "2" 0 "4" 4 "1" 1  2 0 2          0       .76  2.631579
    12 230 -.22314353 "01" 1  .04764649 "2" 0 "4" 4 "1" 1  2 0 2          0        .8       2.5
    12 218 -.13353139 "01" 1  .04764649 "2" 0 "4" 4 "1" 1  2 0 2          0      .875 2.2857144
    13 240  -.4054651 "01" 1   .3313497 "2" 0 "4" 4 "6" 6  1 1 2   .3313497  .6666667       1.5
    13 238 -.22314353 "01" 1   .3313497 "2" 0 "4" 4 "6" 6  1 1 2   .3313497        .8      1.25
    13 230 -.22314353 "01" 1   .3313497 "2" 0 "4" 4 "6" 6  1 0 2          0        .8      1.25
    13 222  -.2006707 "01" 1   .3313497 "2" 0 "4" 4 "6" 6  1 0 2          0  .8181818 1.2222222
    13 226  -.2006707 "01" 1   .3313497 "2" 0 "4" 4 "6" 6  1 0 2          0  .8181818 1.2222222
    13 214 -.16705407 "01" 1   .3313497 "2" 0 "4" 4 "6" 6  1 0 2          0  .8461539 1.1818181
    13 218          0 "01" 1   .3313497 "2" 0 "4" 4 "6" 6  1 0 2          0         1         1
    13 234          0 "01" 1   .3313497 "2" 0 "4" 4 "6" 6  1 1 2   .3313497         1         1
    14 226 -1.0116009 "01" 1  .30434015 "2" 0 "5" 5 "1" 1  6 0 2          0  .3636364      16.5
    14 230 -.55961573 "01" 1  .30434015 "2" 0 "5" 5 "1" 1  6 0 2          0  .5714286      10.5
    14 238 -.45198515 "01" 1  .30434015 "2" 0 "5" 5 "1" 1  6 1 2  .30434015  .6363636  9.428572
    14 234  -.4054651 "01" 1  .30434015 "2" 0 "5" 5 "1" 1  6 1 2  .30434015  .6666667         9
    14 218  -.3101549 "01" 1  .30434015 "2" 0 "5" 5 "1" 1  6 0 2          0  .7333333  8.181818
    14 240  -.2876821 "01" 1  .30434015 "2" 0 "5" 5 "1" 1  6 1 2  .30434015       .75         8
    14 222 -.24116208 "01" 1  .30434015 "2" 0 "5" 5 "1" 1  6 0 2          0  .7857143  7.636364
    14 214 -.21622308 "01" 1  .30434015 "2" 0 "5" 5 "1" 1  6 0 2          0  .8055556  7.448276
    15 226  -.6931472 "01" 1   .1741187 "2" 0 "5" 5 "6" 6  4 0 2          0        .5         8
    15 238  -.2876821 "01" 1   .1741187 "2" 0 "5" 5 "6" 6  4 1 2   .1741187       .75  5.333333
    15 214 -.25782913 "01" 1   .1741187 "2" 0 "5" 5 "6" 6  4 0 2          0  .7727273  5.176471
    15 234  -.1823216 "01" 1   .1741187 "2" 0 "5" 5 "6" 6  4 1 2   .1741187  .8333333       4.8
    15 218          0 "01" 1   .1741187 "2" 0 "5" 5 "6" 6  4 0 2          0         1         4
    15 240          0 "01" 1   .1741187 "2" 0 "5" 5 "6" 6  4 1 2   .1741187         1         4
    15 222          0 "01" 1   .1741187 "2" 0 "5" 5 "6" 6  4 0 2          0         1         4
    15 230          0 "01" 1   .1741187 "2" 0 "5" 5 "6" 6  4 0 2          0         1         4
    16 240  -.6931472 "01" 1  .06941935 "2" 0 "6" 6 "1" 1  1 1 2  .06941935        .5         2
    16 238  -.6190392 "01" 1  .06941935 "2" 0 "6" 6 "1" 1  1 1 2  .06941935 .53846157 1.8571428
    16 222  -.5389965 "01" 1  .06941935 "2" 0 "6" 6 "1" 1  1 0 2          0  .5833333 1.7142857
    16 230  -.3254224 "01" 1  .06941935 "2" 0 "6" 6 "1" 1  1 0 2          0  .7222222 1.3846154
    16 226  -.2876821 "01" 1  .06941935 "2" 0 "6" 6 "1" 1  1 0 2          0       .75 1.3333334
    16 218  -.2876821 "01" 1  .06941935 "2" 0 "6" 6 "1" 1  1 0 2          0       .75 1.3333334
    16 214 -.14842002 "01" 1  .06941935 "2" 0 "6" 6 "1" 1  1 0 2          0   .862069      1.16
    16 234 -.14310083 "01" 1  .06941935 "2" 0 "6" 6 "1" 1  1 1 2  .06941935  .8666667 1.1538461
    17 230  -.4054651 "01" 1  .12124364 "2" 0 "7" 7 "1" 1  1 0 2          0  .6666667       1.5
    17 214  -.3364722 "01" 1  .12124364 "2" 0 "7" 7 "1" 1  1 0 2          0  .7142857       1.4
    17 222  -.2876821 "01" 1  .12124364 "2" 0 "7" 7 "1" 1  1 0 2          0       .75 1.3333334
    17 218  -.2876821 "01" 1  .12124364 "2" 0 "7" 7 "1" 1  1 0 2          0       .75 1.3333334
    17 226          0 "01" 1  .12124364 "2" 0 "7" 7 "1" 1  1 0 2          0         1         1
    17 240          0 "01" 1  .12124364 "2" 0 "7" 7 "1" 1  1 1 2  .12124364         1         1
    17 234          0 "01" 1  .12124364 "2" 0 "7" 7 "1" 1  1 1 2  .12124364         1         1
    17 238          0 "01" 1  .12124364 "2" 0 "7" 7 "1" 1  1 1 2  .12124364         1         1
    19 238  -1.446919 "01" 1  1.0230924 "3" 0 "1" 1 "1" 1  1 1 3  1.0230924  .2352941      4.25
    19 234 -1.2685113 "01" 1  1.0230924 "3" 0 "1" 1 "1" 1  1 1 3  1.0230924    .28125 3.5555556
    19 240 -1.1394343 "01" 1  1.0230924 "3" 0 "1" 1 "1" 1  1 1 3  1.0230924       .32     3.125
    19 222  -.7672552 "01" 1  1.0230924 "3" 0 "1" 1 "1" 1  1 0 3          0  .4642857 2.1538463
    19 230  -.7339692 "01" 1  1.0230924 "3" 0 "1" 1 "1" 1  1 0 3          0       .48 2.0833335
    19 214 -.56798404 "01" 1  1.0230924 "3" 0 "1" 1 "1" 1  1 0 3          0 .56666666  1.764706
    19 218  -.4480247 "01" 1  1.0230924 "3" 0 "1" 1 "1" 1  1 0 3          0  .6388889 1.5652174
    19 226   -.427444 "01" 1  1.0230924 "3" 0 "1" 1 "1" 1  1 0 3          0  .6521739 1.5333333
    20 238 -1.0647107 "01" 1  .09704527 "3" 0 "1" 1 "6" 6  1 1 3  .09704527  .3448276       2.9
    20 226  -.9808292 "01" 1  .09704527 "3" 0 "1" 1 "6" 6  1 0 3          0      .375  2.666667
    20 240  -.8472978 "01" 1  .09704527 "3" 0 "1" 1 "6" 6  1 1 3  .09704527  .4285714 2.3333333
    20 234  -.6931472 "01" 1  .09704527 "3" 0 "1" 1 "6" 6  1 1 3  .09704527        .5         2
    20 222  -.5260931 "01" 1  .09704527 "3" 0 "1" 1 "6" 6  1 0 3          0 .59090906 1.6923077
    20 214  -.4964369 "01" 1  .09704527 "3" 0 "1" 1 "6" 6  1 0 3          0  .6086956 1.6428572
    20 230  -.4924765 "01" 1  .09704527 "3" 0 "1" 1 "6" 6  1 0 3          0  .6111111 1.6363636
    20 218 -.23361483 "01" 1  .09704527 "3" 0 "1" 1 "6" 6  1 0 3          0  .7916667  1.263158
    21 240 -1.4271164 "01" 1 .036009464 "3" 0 "2" 2 "1" 1  4 1 3 .036009464       .24 16.666668
    21 234  -1.060872 "01" 1 .036009464 "3" 0 "2" 2 "1" 1  4 1 3 .036009464  .3461539 11.555555
    21 238  -.9808292 "01" 1 .036009464 "3" 0 "2" 2 "1" 1  4 1 3 .036009464      .375 10.666667
    21 226  -.7827593 "01" 1 .036009464 "3" 0 "2" 2 "1" 1  4 0 3          0  .4571429      8.75
    21 230    -.76214 "01" 1 .036009464 "3" 0 "2" 2 "1" 1  4 0 3          0  .4666667  8.571428
    21 218 -.56798404 "01" 1 .036009464 "3" 0 "2" 2 "1" 1  4 0 3          0 .56666666  7.058824
    21 214  -.5520686 "01" 1 .036009464 "3" 0 "2" 2 "1" 1  4 0 3          0 .57575756  6.947369
    21 222  -.4855078 "01" 1 .036009464 "3" 0 "2" 2 "1" 1  4 0 3          0  .6153846       6.5
    22 240 -1.0986123 "01" 1          0 "3" 0 "2" 2 "6" 6  0 1 3          0  .3333333         0
    22 234  -.9555115 "01" 1          0 "3" 0 "2" 2 "6" 6  0 1 3          0  .3846154         0
    22 226   -.737599 "01" 1          0 "3" 0 "2" 2 "6" 6  0 0 3          0  .4782609         0
    22 238  -.4924765 "01" 1          0 "3" 0 "2" 2 "6" 6  0 1 3          0  .6111111         0
    22 222   -.479573 "01" 1          0 "3" 0 "2" 2 "6" 6  0 0 3          0  .6190476         0
    22 218  -.4700036 "01" 1          0 "3" 0 "2" 2 "6" 6  0 0 3          0      .625         0
    22 214  -.3022809 "01" 1          0 "3" 0 "2" 2 "6" 6  0 0 3          0  .7391304         0
    22 230  -.2719337 "01" 1          0 "3" 0 "2" 2 "6" 6  0 0 3          0  .7619048         0
    23 218  -1.299283 "01" 1   .9331547 "3" 0 "3" 3 "1" 1 13 0 3          0 .27272728  47.66666
    23 238  -.6931472 "01" 1   .9331547 "3" 0 "3" 3 "1" 1 13 1 3   .9331547        .5        26
    23 240  -.6061358 "01" 1   .9331547 "3" 0 "3" 3 "1" 1 13 1 3   .9331547 .54545456  23.83333
    23 234   -.597837 "01" 1   .9331547 "3" 0 "3" 3 "1" 1 13 1 3   .9331547       .55 23.636364
    23 230 -.55961573 "01" 1   .9331547 "3" 0 "3" 3 "1" 1 13 0 3          0  .5714286     22.75
    23 226 -.45198515 "01" 1   .9331547 "3" 0 "3" 3 "1" 1 13 0 3          0  .6363636  20.42857
    23 222  -.3483067 "01" 1   .9331547 "3" 0 "3" 3 "1" 1 13 0 3          0  .7058824 18.416666
    23 214  -.2876821 "01" 1   .9331547 "3" 0 "3" 3 "1" 1 13 0 3          0       .75 17.333334
    24 226  -.8472978 "01" 1  .05983265 "3" 0 "3" 3 "6" 6  1 0 3          0  .4285714 2.3333333
    24 240  -.8109302 "01" 1  .05983265 "3" 0 "3" 3 "6" 6  1 1 3  .05983265 .44444445      2.25
    24 230  -.7731899 "01" 1  .05983265 "3" 0 "3" 3 "6" 6  1 0 3          0  .4615385 2.1666667
    24 238  -.5108256 "01" 1  .05983265 "3" 0 "3" 3 "6" 6  1 1 3  .05983265        .6 1.6666666
    end
    format %tq numvar
    label values estu_n estu_n
    label def estu_n 2 "2", modify
    label def estu_n 3 "3", modify
    ------------------ copy up to and including the previous line ------------------
    Last edited by Felix Chappuis; 19 Jul 2021, 08:02.

  • #2
    I think for specific advice, more information is needed. First, show the actual output you got from Stata and explain which coefficients you think are too large and why. And also, show a different set of example data that matches the problem concerned. The example you posted has no observations with anos2 == "03". Show an example that will actually run the regression command that you are worried about--the problem is more likely to be with the data than with the code.

    Comment


    • #3
      Hi Clyde
      Thank you very much for answering. Here is the stata output.

      . asdoc reg Arbeitslosenrate_ln indicate avg i.numvar avg i.numvar##c.avg if anos2 == "03" , nest vce (cluster code) add(Time-Fixed-Effects, YES, Interaction GAP-Measure and Time, YES) cnames(30-39)
      (File Myfile.doc already exists, option append was assumed)
      note: avg_GAP omitted because of collinearity.
      note: avg_GAP omitted because of collinearity.
      note: 240.numvar#c.avg_GAP omitted because of collinearity.

      Linear regression Number of obs = 312
      F(15, 38) = 26.25
      Prob > F = 0.0000
      R-squared = 0.5522
      Root MSE = .35741

      (Std. err. adjusted for 39 clusters in code)
      ----------------------------------------------------------------------------------
      | Robust
      Arbeitslosenra~n | Coefficient std. err. t P>|t| [95% conf. interval]
      -----------------+----------------------------------------------------------------
      indicate | 15.36871 4.773936 3.22 0.003 5.704383 25.03304
      avg_GAP | 12.83401 2.190158 5.86 0.000 8.400269 17.26776
      |
      numvar |
      218 | -.2112056 .0489717 -4.31 0.000 -.3103436 -.1120676
      222 | -.3640937 .0486977 -7.48 0.000 -.4626771 -.2655103
      226 | -.4818032 .0685638 -7.03 0.000 -.6206034 -.343003
      230 | -.6983471 .0562264 -12.42 0.000 -.8121715 -.5845226
      234 | -.8680102 .0811457 -10.70 0.000 -1.032281 -.7037393
      238 | -.9731426 .082945 -11.73 0.000 -1.141056 -.8052291
      240 | -.8549269 .0896587 -9.54 0.000 -1.036431 -.6734224
      |
      avg_GAP | 0 (omitted)
      avg_GAP | 0 (omitted)
      |
      numvar#c.avg_GAP |
      218 | 6.654765 1.871522 3.56 0.001 2.866067 10.44346
      222 | 6.140529 1.725625 3.56 0.001 2.647183 9.633874
      226 | 8.943345 3.498238 2.56 0.015 1.861533 16.02516
      230 | 11.92668 2.249964 5.30 0.000 7.371866 16.48149
      234 | -1.572417 2.891235 -0.54 0.590 -7.425416 4.280581
      238 | 3.160158 2.577931 1.23 0.228 -2.05859 8.378905
      240 | 0 (omitted)
      |
      _cons | -1.522831 .0614625 -24.78 0.000 -1.647255 -1.398406
      ----------------------------------------------------------------------------------


      And here is an adapted example which contains anos2=="03".

      ----------------------- copy starting from the next line -----------------------
      Code:
      * Example generated by -dataex-. For more info, type help dataex
      clear
      input float code int numvar float(Arbeitslosenrate_ln GAP_ct) str2 anos2 byte anos2_n float avg_GAP str3 estu float gap_ct byte isdup str2 nuts1 byte nuts1_n str2 sexo byte sexo_n float(Anzahl_Betroffene post) long estu_n float(indicate Arbeitslosenrate)
      70 230 -1.4053426 .012595055 "03" 3 .012595055 "2" .012595055 0 "4" 4 "1" 1  33 0 2          0   .245283
      70 240  -1.293921 .012595055 "03" 3 .012595055 "2" .012595055 0 "4" 4 "1" 1  33 1 2 .012595055 .27419356
      70 234 -1.2685113 .012595055 "03" 3 .012595055 "2" .012595055 0 "4" 4 "1" 1  33 1 2 .012595055    .28125
      70 226 -1.2321438 .012595055 "03" 3 .012595055 "2" .012595055 0 "4" 4 "1" 1  33 0 2          0 .29166666
      70 214 -1.2039728 .012595055 "03" 3 .012595055 "2" .012595055 0 "4" 4 "1" 1  33 0 2          0        .3
      70 238 -1.1249295 .012595055 "03" 3 .012595055 "2" .012595055 0 "4" 4 "1" 1  33 1 2 .012595055 .32467535
      70 222 -1.0473189 .012595055 "03" 3 .012595055 "2" .012595055 0 "4" 4 "1" 1  33 0 2          0  .3508772
      70 218  -.8001193 .012595055 "03" 3 .012595055 "2" .012595055 0 "4" 4 "1" 1  33 0 2          0  .4492754
      74 240  -1.740466 .012664276 "03" 3 .012664276 "2" .012664276 0 "6" 6 "1" 1  50 1 2 .012664276  .1754386
      74 238  -1.323774 .012664276 "03" 3 .012664276 "2" .012664276 0 "6" 6 "1" 1  50 1 2 .012664276 .26612905
      74 234  -1.044545 .012664276 "03" 3 .012664276 "2" .012664276 0 "6" 6 "1" 1  50 1 2 .012664276 .35185185
      74 226 -1.0352427 .012664276 "03" 3 .012664276 "2" .012664276 0 "6" 6 "1" 1  50 0 2          0  .3551402
      74 230  -.9777758 .012664276 "03" 3 .012664276 "2" .012664276 0 "6" 6 "1" 1  50 0 2          0  .3761468
      74 222  -.7331525 .012664276 "03" 3 .012664276 "2" .012664276 0 "6" 6 "1" 1  50 0 2          0  .4803922
      74 218  -.6526558 .012664276 "03" 3 .012664276 "2" .012664276 0 "6" 6 "1" 1  50 0 2          0  .5206612
      74 214  -.5187938 .012664276 "03" 3 .012664276 "2" .012664276 0 "6" 6 "1" 1  50 0 2          0  .5952381
      75 240  -.9162907 .072123796 "03" 3 .072123796 "2" .072123796 0 "6" 6 "6" 6  67 1 2 .072123796        .4
      75 226  -.8700779 .072123796 "03" 3 .072123796 "2" .072123796 0 "6" 6 "6" 6  67 0 2          0  .4189189
      75 234  -.8517522 .072123796 "03" 3 .072123796 "2" .072123796 0 "6" 6 "6" 6  67 1 2 .072123796  .4266667
      75 222  -.7295148 .072123796 "03" 3 .072123796 "2" .072123796 0 "6" 6 "6" 6  67 0 2          0  .4821429
      75 214  -.6931472 .072123796 "03" 3 .072123796 "2" .072123796 0 "6" 6 "6" 6  67 0 2          0        .5
      75 230  -.6778796 .072123796 "03" 3 .072123796 "2" .072123796 0 "6" 6 "6" 6  67 0 2          0 .50769234
      75 238  -.6641596 .072123796 "03" 3 .072123796 "2" .072123796 0 "6" 6 "6" 6  67 1 2 .072123796  .5147059
      75 218  -.5250103 .072123796 "03" 3 .072123796 "2" .072123796 0 "6" 6 "6" 6  67 0 2          0  .5915493
      76 234 -2.1690538 .009476304 "03" 3 .009476304 "3" .009476304 0 "1" 1 "1" 1  42 1 3 .009476304  .1142857
      76 238  -2.095273 .009476304 "03" 3 .009476304 "3" .009476304 0 "1" 1 "1" 1  42 1 3 .009476304 .12303665
      76 240 -2.0736105 .009476304 "03" 3 .009476304 "3" .009476304 0 "1" 1 "1" 1  42 1 3 .009476304   .125731
      76 230  -1.915812 .009476304 "03" 3 .009476304 "3" .009476304 0 "1" 1 "1" 1  42 0 3          0 .14722222
      76 222 -1.6206112 .009476304 "03" 3 .009476304 "3" .009476304 0 "1" 1 "1" 1  42 0 3          0  .1977778
      76 226 -1.4900912 .009476304 "03" 3 .009476304 "3" .009476304 0 "1" 1 "1" 1  42 0 3          0  .2253521
      76 218  -1.369487 .009476304 "03" 3 .009476304 "3" .009476304 0 "1" 1 "1" 1  42 0 3          0  .2542373
      76 214 -1.2174904 .009476304 "03" 3 .009476304 "3" .009476304 0 "1" 1 "1" 1  42 0 3          0   .295972
      77 234   -1.56181  .03839993 "03" 3  .03839993 "3"  .03839993 0 "1" 1 "6" 6  94 1 3  .03839993  .2097561
      77 240 -1.5017105  .03839993 "03" 3  .03839993 "3"  .03839993 0 "1" 1 "6" 6  94 1 3  .03839993  .2227488
      77 230  -1.437828  .03839993 "03" 3  .03839993 "3"  .03839993 0 "1" 1 "6" 6  94 0 3          0 .23744294
      77 238 -1.4271164  .03839993 "03" 3  .03839993 "3"  .03839993 0 "1" 1 "6" 6  94 1 3  .03839993       .24
      77 226  -1.372811  .03839993 "03" 3  .03839993 "3"  .03839993 0 "1" 1 "6" 6  94 0 3          0 .25339368
      77 222  -1.335742  .03839993 "03" 3  .03839993 "3"  .03839993 0 "1" 1 "6" 6  94 0 3          0 .26296297
      77 218 -1.2335316  .03839993 "03" 3  .03839993 "3"  .03839993 0 "1" 1 "6" 6  94 0 3          0 .29126215
      77 214  -1.227926  .03839993 "03" 3  .03839993 "3"  .03839993 0 "1" 1 "6" 6  94 0 3          0 .29289943
      78 234   -2.61496 .006512205 "03" 3 .006512205 "3" .006512205 0 "2" 2 "1" 1  31 1 3 .006512205 .07317074
      78 230 -2.4107985 .006512205 "03" 3 .006512205 "3" .006512205 0 "2" 2 "1" 1  31 0 3          0  .0897436
      78 238  -2.410216 .006512205 "03" 3 .006512205 "3" .006512205 0 "2" 2 "1" 1  31 1 3 .006512205  .0897959
      78 240 -2.1113348 .006512205 "03" 3 .006512205 "3" .006512205 0 "2" 2 "1" 1  31 1 3 .006512205 .12107625
      78 226 -2.0249534 .006512205 "03" 3 .006512205 "3" .006512205 0 "2" 2 "1" 1  31 0 3          0      .132
      78 222 -1.8021222 .006512205 "03" 3 .006512205 "3" .006512205 0 "2" 2 "1" 1  31 0 3          0 .16494846
      78 218    -1.7492 .006512205 "03" 3 .006512205 "3" .006512205 0 "2" 2 "1" 1  31 0 3          0 .17391305
      78 214 -1.6518586 .006512205 "03" 3 .006512205 "3" .006512205 0 "2" 2 "1" 1  31 0 3          0  .1916933
      79 238  -1.683546   .0200352 "03" 3   .0200352 "3"   .0200352 0 "2" 2 "6" 6  49 1 3   .0200352  .1857143
      79 222 -1.5612358   .0200352 "03" 3   .0200352 "3"   .0200352 0 "2" 2 "6" 6  49 0 3          0 .20987655
      79 214 -1.5170646   .0200352 "03" 3   .0200352 "3"   .0200352 0 "2" 2 "6" 6  49 0 3          0 .21935484
      79 240  -1.491655   .0200352 "03" 3   .0200352 "3"   .0200352 0 "2" 2 "6" 6  49 1 3   .0200352      .225
      79 230 -1.4593195   .0200352 "03" 3   .0200352 "3"   .0200352 0 "2" 2 "6" 6  49 0 3          0 .23239437
      79 234  -1.445135   .0200352 "03" 3   .0200352 "3"   .0200352 0 "2" 2 "6" 6  49 1 3   .0200352  .2357143
      79 226 -1.3796936   .0200352 "03" 3   .0200352 "3"   .0200352 0 "2" 2 "6" 6  49 0 3          0 .25165564
      79 218 -1.1769441   .0200352 "03" 3   .0200352 "3"   .0200352 0 "2" 2 "6" 6  49 0 3          0  .3082192
      80 238 -2.3125355 .011943158 "03" 3 .011943158 "3" .011943158 0 "3" 3 "1" 1  43 1 3 .011943158  .0990099
      80 234 -2.1535494 .011943158 "03" 3 .011943158 "3" .011943158 0 "3" 3 "1" 1  43 1 3 .011943158 .11607144
      80 240 -2.1058748 .011943158 "03" 3 .011943158 "3" .011943158 0 "3" 3 "1" 1  43 1 3 .011943158 .12173913
      80 230 -2.0522907 .011943158 "03" 3 .011943158 "3" .011943158 0 "3" 3 "1" 1  43 0 3          0 .12844035
      80 226 -1.8430527 .011943158 "03" 3 .011943158 "3" .011943158 0 "3" 3 "1" 1  43 0 3          0 .15833333
      80 222 -1.6711315 .011943158 "03" 3 .011943158 "3" .011943158 0 "3" 3 "1" 1  43 0 3          0  .1880342
      80 214 -1.3862944 .011943158 "03" 3 .011943158 "3" .011943158 0 "3" 3 "1" 1  43 0 3          0       .25
      80 218 -1.1267833 .011943158 "03" 3 .011943158 "3" .011943158 0 "3" 3 "1" 1  43 0 3          0  .3240741
      81 238   -2.00148 .016390441 "03" 3 .016390441 "3" .016390441 0 "3" 3 "6" 6  56 1 3 .016390441 .13513511
      81 240 -1.9715526 .016390441 "03" 3 .016390441 "3" .016390441 0 "3" 3 "6" 6  56 1 3 .016390441  .1392405
      81 226 -1.7107904 .016390441 "03" 3 .016390441 "3" .016390441 0 "3" 3 "6" 6  56 0 3          0  .1807229
      81 230  -1.686399 .016390441 "03" 3 .016390441 "3" .016390441 0 "3" 3 "6" 6  56 0 3          0  .1851852
      81 222 -1.4294665 .016390441 "03" 3 .016390441 "3" .016390441 0 "3" 3 "6" 6  56 0 3          0 .23943663
      81 218 -1.3328056 .016390441 "03" 3 .016390441 "3" .016390441 0 "3" 3 "6" 6  56 0 3          0 .26373628
      81 234  -1.332227 .016390441 "03" 3 .016390441 "3" .016390441 0 "3" 3 "6" 6  56 1 3 .016390441  .2638889
      81 214 -1.0593916 .016390441 "03" 3 .016390441 "3" .016390441 0 "3" 3 "6" 6  56 0 3          0  .3466667
      82 238 -2.1077263 .011992987 "03" 3 .011992987 "3" .011992987 0 "4" 4 "1" 1  68 1 3 .011992987 .12151393
      82 230  -2.036882 .011992987 "03" 3 .011992987 "3" .011992987 0 "4" 4 "1" 1  68 0 3          0 .13043478
      82 240  -1.980471 .011992987 "03" 3 .011992987 "3" .011992987 0 "4" 4 "1" 1  68 1 3 .011992987 .13800424
      82 234 -1.9530276 .011992987 "03" 3 .011992987 "3" .011992987 0 "4" 4 "1" 1  68 1 3 .011992987 .14184397
      82 226  -1.770074 .011992987 "03" 3 .011992987 "3" .011992987 0 "4" 4 "1" 1  68 0 3          0  .1703204
      82 222  -1.625967 .011992987 "03" 3 .011992987 "3" .011992987 0 "4" 4 "1" 1  68 0 3          0 .19672133
      82 218  -1.309177 .011992987 "03" 3 .011992987 "3" .011992987 0 "4" 4 "1" 1  68 0 3          0 .27004218
      82 214 -1.2997397 .011992987 "03" 3 .011992987 "3" .011992987 0 "4" 4 "1" 1  68 0 3          0 .27260274
      83 234 -1.5799155  .02804787 "03" 3  .02804787 "3"  .02804787 0 "4" 4 "6" 6 102 1 3  .02804787  .2059925
      83 238   -1.57372  .02804787 "03" 3  .02804787 "3"  .02804787 0 "4" 4 "6" 6 102 1 3  .02804787 .20727272
      83 240  -1.418043  .02804787 "03" 3  .02804787 "3"  .02804787 0 "4" 4 "6" 6 102 1 3  .02804787  .2421875
      83 230 -1.3926035  .02804787 "03" 3  .02804787 "3"  .02804787 0 "4" 4 "6" 6 102 0 3          0 .24842767
      83 226 -1.3049487  .02804787 "03" 3  .02804787 "3"  .02804787 0 "4" 4 "6" 6 102 0 3          0 .27118644
      83 222 -1.1279399  .02804787 "03" 3  .02804787 "3"  .02804787 0 "4" 4 "6" 6 102 0 3          0  .3236994
      83 214  -1.063273  .02804787 "03" 3  .02804787 "3"  .02804787 0 "4" 4 "6" 6 102 0 3          0  .3453237
      83 218  -.9852836  .02804787 "03" 3  .02804787 "3"  .02804787 0 "4" 4 "6" 6 102 0 3          0  .3733333
      84 238 -2.1788418 .009505322 "03" 3 .009505322 "3" .009505322 0 "5" 5 "1" 1 109 1 3 .009505322 .11317253
      84 234  -2.151088 .009505322 "03" 3 .009505322 "3" .009505322 0 "5" 5 "1" 1 109 1 3 .009505322  .1163575
      84 240 -2.1139276 .009505322 "03" 3 .009505322 "3" .009505322 0 "5" 5 "1" 1 109 1 3 .009505322 .12076273
      84 230 -1.9074117 .009505322 "03" 3 .009505322 "3" .009505322 0 "5" 5 "1" 1 109 0 3          0 .14846416
      84 226 -1.8442775 .009505322 "03" 3 .009505322 "3" .009505322 0 "5" 5 "1" 1 109 0 3          0 .15813954
      84 222  -1.613808 .009505322 "03" 3 .009505322 "3" .009505322 0 "5" 5 "1" 1 109 0 3          0  .1991279
      84 218 -1.4056587 .009505322 "03" 3 .009505322 "3" .009505322 0 "5" 5 "1" 1 109 0 3          0 .24520548
      84 214 -1.3392884 .009505322 "03" 3 .009505322 "3" .009505322 0 "5" 5 "1" 1 109 0 3          0 .26203206
      85 238 -1.8645188 .021509806 "03" 3 .021509806 "3" .021509806 0 "5" 5 "6" 6 137 1 3 .021509806 .15497077
      85 240 -1.6897603 .021509806 "03" 3 .021509806 "3" .021509806 0 "5" 5 "6" 6 137 1 3 .021509806 .18456376
      85 234  -1.533378 .021509806 "03" 3 .021509806 "3" .021509806 0 "5" 5 "6" 6 137 1 3 .021509806 .21580547
      85 230 -1.4999537 .021509806 "03" 3 .021509806 "3" .021509806 0 "5" 5 "6" 6 137 0 3          0  .2231405
      end
      format %tq numvar
      label values estu_n estu_n
      label def estu_n 2 "2", modify
      label def estu_n 3 "3", modify
      ------------------ copy up to and including the previous line ------------------

      Sorry that I included such a wrong example. Hope someone can help me. My result would mean that in the 10 % most exposed groups to the minimum wage relative to the 10 % least exposed to the minimum wage, would increase very much. I think that there may be a difference, but not so much.

      Comment


      • #4
        Well, it looks to me like you are trying to make a complicated model out of data that is inadequate to support it. At least in your example data, both the variable indicate and the variable avg_GAP are more or less proxies for intervals of the time variable numvar:

        Code:
                   |                                         numvar
           avg_GAP |    2013q3     2014q3     2015q3     2016q3     2017q3     2018q3     2019q3     2020q1 |     Total
        -----------+----------------------------------------------------------------------------------------+----------
          .0065122 |         1          1          1          1          1          1          1          1 |         8
          .0094763 |         1          1          1          1          1          1          1          1 |         8
          .0095053 |         1          1          1          1          1          1          1          1 |         8
          .0119432 |         1          1          1          1          1          1          1          1 |         8
           .011993 |         1          1          1          1          1          1          1          1 |         8
          .0125951 |         1          1          1          1          1          1          1          1 |         8
          .0126643 |         1          1          1          1          1          1          1          1 |         8
          .0163904 |         1          1          1          1          1          1          1          1 |         8
          .0200352 |         1          1          1          1          1          1          1          1 |         8
          .0215098 |         0          0          0          0          1          1          1          1 |         4
          .0280479 |         1          1          1          1          1          1          1          1 |         8
          .0383999 |         1          1          1          1          1          1          1          1 |         8
          .0721238 |         1          1          1          1          1          1          1          1 |         8
        -----------+----------------------------------------------------------------------------------------+----------
             Total |        12         12         12         12         13         13         13         13 |       100
        
        . tab indicate numvar
        
                   |                                         numvar
          indicate |    2013q3     2014q3     2015q3     2016q3     2017q3     2018q3     2019q3     2020q1 |     Total
        -----------+----------------------------------------------------------------------------------------+----------
                 0 |        12         12         12         12         13          0          0          0 |        61
          .0065122 |         0          0          0          0          0          1          1          1 |         3
          .0094763 |         0          0          0          0          0          1          1          1 |         3
          .0095053 |         0          0          0          0          0          1          1          1 |         3
          .0119432 |         0          0          0          0          0          1          1          1 |         3
           .011993 |         0          0          0          0          0          1          1          1 |         3
          .0125951 |         0          0          0          0          0          1          1          1 |         3
          .0126643 |         0          0          0          0          0          1          1          1 |         3
          .0163904 |         0          0          0          0          0          1          1          1 |         3
          .0200352 |         0          0          0          0          0          1          1          1 |         3
          .0215098 |         0          0          0          0          0          1          1          1 |         3
          .0280479 |         0          0          0          0          0          1          1          1 |         3
          .0383999 |         0          0          0          0          0          1          1          1 |         3
          .0721238 |         0          0          0          0          0          1          1          1 |         3
        -----------+----------------------------------------------------------------------------------------+----------
             Total |        12         12         12         12         13         13         13         13 |       100
        In fact, avg_GAP and numvar jointly identify unique observations in the data. So the interaction i.numvar#c.avg_GAP which is the key term in your regression model, uniquely identifies observations. The only reason you aren't getting R2 = 1 in your regression is that the relationship between your outcome and avg_GAP is not exactly linear. Anyway, with such complete explanation, it is not surprising that something in your regression model will end up having a huge effect attributed to it.

        That said, backing away from complicated models and just looking at a scatterplot of Arbeitslosenrate_ln against avg_GAP does show a very strong relationship, where the difference between the highest and lowest values of Arbeitslosenrate_ln is 3.13, which corresponds to a roughly 23 fold ratio of values of Arbeitslosenrate itself. And in this simple analysis, avg_GAP does seem to be associated with much of that variation.

        Comment


        • #5
          Thank you very much Clyde, soo happy that you help me. Now I would like to construct a graph with numvar on the x-achsis and the coefficients of avg_GAP on the Y-Achsis. The reference-time should be at 2019, where the minimum wage increasing took place. And I would like to have on every dot a 95% confidence interval. But how can I constract that? I would be so thankful if you could help me. It should look like that.

          Comment


          • #6
            Click image for larger version

Name:	Bildschirmfoto 2021-07-20 um 20.46.17.png
Views:	1
Size:	53.2 KB
ID:	1619859

            Comment


            • #7
              By coefficients of avg_GAP I take it you mean the marginal effects of avg_GAP in each year. You won't be able to get that from your current model because of the colinearities that exist among numvar (time) and indicate and avg_GAP. You will have to simplify your model to eliminate those.

              Code:
              regress Arbeitslosenrate_ln i.numvar##c.avg_GAP, cluster(code)
              
              margins numvar, dydx(avg_GAP)
              marginsplot, xdimension(numvar)
              -marginsplot- accepts most -graph twoway- options, so you can customize the appearance of the graph to your preferences.

              Note: You can add more covariates to the -regress- command, but only if they are not proxies for time, nor colinear with c.avg_GAP. The variable indicator, in particular, is not permissible here.

              Comment


              • #8
                Thank you very much. Yes the graph looks great, only one thing, shouldn't there be a confidence interval of zero at the reference time 2019? Is there also a possibility to show in the time trend how it would be without the minimum wage increases in 2019? Thank you very much.

                Comment


                • #9
                  Why do you think there should be a zero-width confidence interval in 2019? I can't think of a reason.

                  I don't understand your proposed counterfactual. That may just be because I don't understand what the variables mean.

                  Comment


                  • #10
                    My goal would be that the coefficient is normalized so that it is zero in 2019. How can I do that?

                    Comment


                    • #11
                      That makes no sense to me. Please explain what your variables are and what the underlying process connecting them that you are trying to model is.

                      Comment


                      • #12
                        Thank you very much for the answer. Sorry for not having explicated clearer. Now I try to explain more. Thank you so much that you help me.
                        My figure should show how the unemployment rate in Logs (Arbeitslosenrate_ln) evolve in groups differentially exposed to the minimum wage, relative to the pre-policy year 2018. avg_GAP is my exposure measure. It is the same figure as in the figure 7c of the paper "Reallocation Effects of the Minimum Wage" of Christian Dustmann.
                        The code variable contains individuums with same age (anos2), region (nuts1), sex(sexo), education(estu). Unemployment_rate for this groups is (Arbeitslosenrate_ln). Post is a dummy which takes the value 1 after the treatment and before the treatment equals 0. Indicate the dif-in-dif-variable (post x avg_GAP).

                        Comment


                        • #13
                          The same with the reference period 2019 would be my goal.
                          Attached Files

                          Comment


                          • #14
                            I do not understand the graphs you are showing. They make no sense to me. They talk about plotted coefficients and effects in the caption, but the axis titles say they are plotting levels of outcome variables, not coefficients. They make reference to an equation (4) which is not shown, so who knows what that means. The graphs shown look self-contradictory to me. I suspect it could be puzzled out from reading the full text of the article. I do not have access to economics journals through my institution, and probably would not have time to read it even if I did. I don't think I can help you with this.

                            I also still cannot make sense of fixing the 2019 outcomes at zero. To do that, you have to be able to, for each observation in a given year, identify the corresponding observation in other years so you can calculate the difference. But there is no clear way I can see in your data to decide which observation of a given year corresponds to which observation in 2019. Does the variable code serve that purpose?

                            Post is a dummy which takes the value 1 after the treatment and before the treatment equals 0. Indicate the dif-in-dif-variable (post x avg_GAP).
                            The variable post has not appeared anywhere in your model. I'm just finding this more confusing as we go.


                            Comment


                            • #15
                              Yes, exactly, the code serves for that. The post is not important in my case, sorry for having described it.
                              Last edited by Felix Chappuis; 20 Jul 2021, 14:58.

                              Comment

                              Working...
                              X