Announcement

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

  • Marginsplot change "reference" year

    Hi, I am using the function marginplots to plot margins for treated (toxic1=1) vs control (toxic1=0) over years from 2000 to 2020. Currently, the default of the margins command is to use 2000 (the beginning of my sample) as the reference year, therefore have missing margins for 2000 and shows up in the marginsplot like this (note the missing element in year 2000). Click image for larger version

Name:	Screenshot 2022-04-19 121949.png
Views:	1
Size:	43.2 KB
ID:	1660441

    But what I want is to have the reference year to be 2007 (i.e. no margins estimate for 2007 and missing element in marginsplot for 2007). How can I accomplish that? The following is the current data and code I used.
    Code:
    reghdfe log_debt i.year##toxic1, absorb(i.insee)
    margins i.year#toxic1 if year>=2000
    marginsplot,xlabel(,angle(vertical)) title("")
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(log_debt year toxic1) double insee
     12.32517 2013 1 33063
    11.971442 2013 0 67482
    11.811516 2013 0 92026
      12.9581 2014 0 69123
    11.982915 2012 1 93051
     12.87717 2013 0 69123
    12.342184 2012 0 34172
     11.03804 2020 0 92060
    11.149103 2012 0 92026
    12.198172 2014 0 93048
    11.988816 2013 1 13005
     12.49912 2013 1 95018
    12.316158 2014 0 67482
    12.220356 2019 0 67482
    12.054286 2020 0 97415
      12.2634 2015 1 68224
    12.331805 2012 1 95018
     8.369261 2017 0 92040
      12.3976 2020 0 67482
     8.067302 2020 0 92040
    12.200433 2019 0 34172
    12.093436 2013 0 93048
    12.510007 2020 1 33063
    12.162685 2019 1 92063
    12.558186 2014 1 33063
    11.632102 2019 1 94076
      11.9771 2012 1 93070
     11.20678 2019 0 59606
    12.117535 2012 1  6004
    11.174264 2014 0 94002
    12.309046 2014 1 97209
    11.358448 2019 0 82121
      11.9289 2019 1 93005
     11.23069 2017 0 83137
    11.032966 2015 1  3185
    11.422158 2015 0 92023
    12.904583 2020 0 69123
    11.855364 2016 0 92025
    11.028974 2019 0 11262
     11.28666 2013 1 79191
    11.509714 2013 0 72181
    13.131512 2019 1  6088
     11.03228 2014 0 92023
    12.415907 2012 1 76351
    11.982006 2013 1 63113
    11.100784 2013 0 90010
    11.074895 2017 0 97416
    11.827296 2013 0 92025
    10.659093 2016 0 97408
    10.677785 2013 0 84031
    12.482695 2014 1 76351
    10.324215 2013 0 74012
     11.48608 2013 1 94033
    11.240614 2012 1 94033
    11.190235 2013 1 78440
     10.05102 2013 0 13103
     11.36747 2019 0 64445
    11.268244 2013 0 19031
    11.792292 2015 1 93006
     11.50492 2014 0 93010
     11.39246 2014 1 78440
    12.500934 2017 1 76351
     11.47896 2012 1 93005
    11.203295 2017 0 92060
    10.603282 2013 0 93027
     11.35412 2012 0 72181
    11.961753 2016 0 92050
    13.118523 2016 1  6088
    11.067586 2014 0 56260
     11.67479 2015 1 93066
    11.961278 2013 1 68224
     10.60875 2014 1 44162
    10.240132 2018 0 92049
    11.998708 2020 1 93005
    13.174577 2013 1  6088
    12.090904 2019 1 63113
    12.201494 2012 1 33063
    11.533978 2019 1 28085
    10.052868 2019 0 94042
    10.851552 2013 0 92023
    11.557556 2017 0 34003
      11.4003 2014 0 19031
     11.59707 2013 1 93005
    10.617874 2015 1 97302
    12.411562 2015 0 67482
    10.781545 2014 1 95280
     11.46871 2012 1 91174
     10.62157 2019 1 94038
     11.06794 2013 0 68066
     11.54898 2014 1 94033
    11.914995 2012 1 63113
    10.256122 2013 1 44162
    12.205373 2019 1  6004
     11.34796 2016 1 28085
    11.603178 2013 1 94041
    11.094548 2017 0 64445
     10.25087 2020 1 94019
     10.81221 2013 0 94080
     9.188096 2019 0  6012
    10.920685 2018 1  6083
    end


  • #2
    I'm not sure if that'd be an improvement, but try using "ib2007.year" in the line of the regression command.

    Comment

    Working...
    X