Hello dear all,
I used the local projection method on yearly data for a panel data (143 countries from 1973-2019), but as a robustness check I am trying to use the rolling window (5-years)and plot it. I tried a lot based on the othere STATA posted and help. but I received several times an error.
I appreciate receiving your assistance.
------------------ copy up to and including the previous line ------------------
Listed 100 out of 8883 observations
Use the count() option to list more
my local projection method is :
now in terms of the rolling window I did :
Also:
Many thanks in advance,
I used the local projection method on yearly data for a panel data (143 countries from 1973-2019), but as a robustness check I am trying to use the rolling window (5-years)and plot it. I tried a lot based on the othere STATA posted and help. but I received several times an error.
I appreciate receiving your assistance.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int year float cur int ifscode double WUI_sum 1973 .5317895 111 .0897666 1974 .11001506 111 .28516949999999996 1975 1.0611881 111 .48200679999999996 1976 .2049736 111 .3596399 1977 -.7253248 111 1.0571842999999999 1978 -.6696295 111 .19876069999999998 1979 -.005964223 111 .5083416000000001 1980 .074440725 111 .24863100000000002 1981 .1499825 111 .3621824 1982 -.3471212 111 .3713493 1983 -1.2168833 111 .3962155 1984 -2.452142 111 .192419 1985 -2.8683014 111 .0839913 1986 -3.213665 111 .21242709999999998 1987 -3.3087516 111 .3327374 1988 -2.315658 111 .7352632 1989 -1.7637967 111 .36565369999999997 1990 -1.3239995 111 .39529499999999995 1991 .04629653 111 .1536587 1992 -.7914488 111 .2734836 1993 -1.2361605 111 .5693062999999999 1994 -1.669253 111 .2580359 1995 -1.4864494 111 .2924072 1996 -1.5449674 111 .1409335 1997 -1.6406133 111 .0495638 1998 -2.3727388 111 .4398425 1999 -2.975982 111 .2346321 2000 -3.920886 111 .2538247 2001 -3.724075 111 .9892922 2002 -4.17334 111 1.07912 2003 -4.558981 111 1.2123401 2004 -5.204854 111 .3570366 2005 -5.745982 111 .49987200000000004 2006 -5.911019 111 .23886079999999998 2007 -5.088728 111 1.094794 2008 -4.7158613 111 .6031295 2009 -2.6228366 111 1.0202793 2010 -2.870643 111 .8268708999999999 2011 -2.918621 111 .7264667 2012 -2.572368 111 1.5249123 2013 -2.0153842 111 .8904299 2014 -2.108055 111 .5881687 2015 -2.243472 111 1.073512 2016 -2.1193724 111 .8585571000000001 2017 -1.8535286 111 .7434678 2018 -2.1421602 111 .7691144999999999 2019 -2.085756 111 2.1541754 1973 -1.2524583 112 .0855359 1974 -3.613082 112 .38107559999999996 1975 -1.433419 112 .8089789 1976 -.59336907 112 1.0808285999999998 1977 .05513242 112 .3710501 1978 .6441247 112 1.0868924 1979 -.17827246 112 .9693126999999999 1980 1.2146102 112 .46875239999999996 1981 2.612607 112 .3194212 1982 1.5504085 112 .36219169999999995 1983 1.08082 112 .8144914 1984 .3972896 112 0 1985 .67741 112 .06320909999999999 1986 -.22009194 112 .2062234 1987 -1.6895826 112 0 1988 -3.8812656 112 .5320132 1989 -4.650699 112 .6230532 1990 -3.550168 112 1.230429 1991 -1.6645445 112 .6524292 1992 -1.966937 112 .3223508 1993 -1.669506 112 .3112551 1994 -.8791173 112 .08992339999999999 1995 -.9980571 112 .1008928 1996 -.7264912 112 .44899579999999995 1997 -.08981485 112 .7623446 1998 -.31861085 112 .6506400999999999 1999 -2.1135337 112 .5433545 2000 -1.84713 112 .2850048 2001 -1.8055797 112 .5955098 2002 -2.0363908 112 .27691750000000004 2003 -1.884036 112 .8814714 2004 -2.362032 112 .6360688 2005 -2.0342944 112 .6806401 2006 -3.16443 112 .5955746 2007 -3.786051 112 .8178505 2008 -3.987796 112 .7105001 2009 -3.118611 112 1.818801 2010 -2.894801 112 1.4819679000000001 2011 -1.8039025 112 1.3387272000000001 2012 -3.2902634 112 1.6197735999999998 2013 -4.782701 112 1.2138284000000001 2014 -5.138112 112 .9520833000000001 2015 -5.066957 112 1.9084387 2016 -5.540469 112 3.9415905 2017 -3.610205 112 1.8996527 2018 -4.0648184 112 2.433672 2019 -2.827337 112 4.7189962 1973 . 122 .0988142 1974 . 122 .3575679 1975 . 122 .9805128999999999 1976 . 122 .34737660000000004 1977 . 122 0 1978 . 122 .11152 end
Listed 100 out of 8883 observations
Use the count() option to list more
my local projection method is :
Code:
foreach v in "cur" { gen d`v'_0=f0.`v'- l.`v' gen d`v'_1=f1.`v'- l.`v' gen d`v'_2=f2.`v'- l.`v' gen d`v'_3=f3.`v'- l.`v' gen d`v'_4=f4.`v'- l.`v' gen d`v'_5=f5.`v'- l.`v' }
Code:
foreach v in cur { forvalues i=0/4{ /*reghdfe d`v'_`i' l(0/3)WUI_sum l(1/1)d`v'_0 if inv!=. & sav!=. & cur!=. , absorb(i.ifscode i.year) vce( cluster ifscode)*/ xtscc d`v'_`i' l(0/3)l.WUI_sum l(1/1)d`v'_0 i.year if cur!=. & ,fe
now in terms of the rolling window I did :
Code:
bysort ifscode: rolling (window 5): regress cur l(0/3)l.WUI_sum rolling may not be combined with by r(190);
Code:
bys ifscode: asreg cur l(0/3)lwui, wind(year 5) factor-variable and time-series operators not allowed r(101);
Many thanks in advance,
Comment