diff --git a/issue170/issue170.do b/issue170/issue170.do new file mode 100644 index 0000000..b3905ce --- /dev/null +++ b/issue170/issue170.do @@ -0,0 +1,164 @@ +*ado-files: C:\Users\B18945\ado\plus\x +*local directory: C:\Users\B18945\Downloads\xtevent-170-let-the-window-option-choose-a-window-range + +cd "C:\Users\B18945\Downloads\xtevent-170-let-the-window-option-choose-a-window-range\issue170" +cap log close +log using issue170.txt, replace text + + +*load dataset from +*https://github.com/JMSLab/xtevent/blob/main/test/example31.dta +use example31, clear + +******************************** Error messages ****************************** + +*** Window(max|balanced) can be used only if impute(stag|instag) is specified +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(max) +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(balanced) +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(balanced) impute(nuchange) + +*** Error messages due incorrect specification of window +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(5.5) +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(hello) +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(hello -3) +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(3.5 5.5 7.8) +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(3 5 7) +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(-3) + +*** errors because policyvar doesn't follow staggered adoption +* no binary +use example31, clear +replace z= 0.5 in 7 +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(max) +*it reverts +use example31, clear +replace z= 0 in 8 +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(max) +*always treated or never-treated units don't take the adopted or unadopted policy values +use example31, clear +replace z= 1 if i==1 +replace z=. in 8 +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(max) + +*** errors if the calculated limits for window are problematic + +*calculated left window is positive or right window is negative +use example31, clear +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(balanced) +replace z= 0 if t==20 & inlist(i, 54, 187, 240, 312, 315, 357, 446, 479, 487, 635, 687, 709, 748, 751, 887, 923, 943) // these units are causing the right window limit to be negative. Turn them into never-treated units +xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(balanced) + + +********************************* Examples to check correct functionality ****************************** + +** OLS + +use example31, clear +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(max) // requires adding impute() +xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(max) +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(balanced) //balanced window is too narrow, this is not a problem of the option but a limit imposed by this dataset +*Try with another dataset + +* compare with eventdd and its help file's dataset +webuse set www.damianclarke.net/stata/ +webuse bacon_example, clear +generate timeToTreat = year - _nfd +eventdd asmrs pcinc asmrh cases i.year, timevar(timeToTreat) method(fe, cluster(stfips)) // calculated window limits are -20 and 26, plus the endpoints +*eventdd's balanced option (it estimates with maximum window, but shows plot that corresponds to balanced time periods only) +eventdd asmrs pcinc asmrh cases i.year, timevar(timeToTreat) method(fe, cluster(stfips)) balanced // calcualted window is (-4, 10), plus the endpoints + +* now use that dataset with xtevent command +*max +xtevent asmrs pcinc asmrh cases, timevar(year) panelvar(stfips) policyvar(post) impute(stag) window(max) // same window as with the eventdd command +xteventplot // x-axis labels are cramped. Leave adjustment to the user? +*balanced +xtevent asmrs pcinc asmrh cases, timevar(year) panelvar(stfips) policyvar(post) impute(stag) window(balanced) // same window as with the eventdd command +xteventplot + +** missing values in varlist +use example31, clear +gen pois = rpoisson(5) in 1/200 +xtevent y eta i.pois, panelvar(i) timevar(t) pol(z) window(max) impute(stag) plot // window=(-15, 12) and endpoints={-16, 13} +* marksample (the marker for non-missing observations in varlist) doesn't interfer with mark (the marker for if & in conditions) +xtevent y eta i.pois if i<4, panelvar(i) timevar(t) pol(z) window(max) impute(stag) plot // window=(-12, 12) and endpoints={-13, 13} + + +******* IV + +*** return to the example31 dataset +use example31, clear +cap noi xtevent y eta, panelvar(i) timevar(t) policyvar(z) proxy(x) impute(stag) window(max) // instrument is collinear +* try same specification but with a narrower observed data range +keep if inrange(t,5,15) +xtevent y eta, panelvar(i) timevar(t) policyvar(z) proxy(x) impute(stag) window(max) +*balanced +cap noi xtevent y eta, panelvar(i) timevar(t) policyvar(z) proxy(x) impute(stag) window(balanced) // cannot test because balanced window is too narrow + +*** try csdid's dataset +use "https://friosavila.github.io/playingwithstata/drdid/mpdta.dta", clear +xtset countyreal year +gen ttreat = year - first_treat +gen z=(ttreat>=0) +csdid lemp lpop , ivar(countyreal) time(year) gvar(first_treat) method(dripw) +set seed 3 +gen eta=runiform() +*max +xtevent lemp lpop, timevar(year) panelvar(countyreal) policyvar(z) proxy(eta) impute(stag) window(max) +*balanced +cap noi xtevent lemp lpop, timevar(year) panelvar(countyreal) policyvar(z) proxy(eta) impute(stag) window(balanced) //cannot test "balanced" with this dataset, window is too narrow + + +*Check that lead in proxyiv is not outside estimation window +use example31, clear +cap noi xtevent y eta, panelvar(i) timevar(t) policyvar(z) proxy(x) impute(stag) window(max) proxyiv(5 e 20) + +** missing values in varlist +use example31, clear +keep if inrange(t,5,15) // +gen pois = rpoisson(5) in 1/2000 +xtevent y eta i.pois, panelvar(i) timevar(t) pol(z) impute(stag) proxy(x) window(max) // window=(-9, 8) and endpoints={-10, 9} +* marksample (the marker for non-missing observations in varlist) doesn't interfer with mark (the marker for if & in conditions) +xtevent y eta i.pois if i<40, panelvar(i) timevar(t) pol(z) window(max) impute(stag) // window=(-8, 7) and endpoints={-9, 8} + + +****************** interaction with other options ************************************** + +* coefficient to normalize is outside the calculated window +use example31, clear +replace z= 0 if t==20 & inlist(i, 54, 187, 240, 312, 315, 357, 446, 479, 487, 635, 687, 709, 748, 751, 887, 923, 943) // to overcome the problem with left window being positive or right window being negative +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(balanced) norm(2) + +*trend +use example31, clear +xtevent y eta , panelvar(i) timevar(t) policyvar(z) trend(-10, method(ols)) impute(stag) window(max) +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) trend(-20, method(gmm)) impute(stag) window(max) +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) trend(-15, method(ols)) impute(stag) window(balanced) + + +*** xteventplot overlay +use example31, clear +*static +xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(max) +xteventplot, overlay(static) +*trend +xtevent y eta , panelvar(i) timevar(t) policyvar(z) trend(-10, method(ols) saveoverlay) impute(stag) window(max) +xteventplot, overlay(trend) + +*************** Examples to check that implementation doesn't alter other functionalities ************************ + +* window +use example31, clear +xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(3) +xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(-3 5) +*impute +cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(-18 16) // need to add impute() +xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(-18 16) impute(nuchange) +* trend adjustment +xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(-18 16) impute(nuchange) trend(-3) +xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(-18 16) impute(nuchange) trend(-3, method(gmm)) +* IV +xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(6) impute(nuchange) proxy(zeta) + +log close + + diff --git a/issue170/issue170.txt b/issue170/issue170.txt new file mode 100644 index 0000000..50a01f9 --- /dev/null +++ b/issue170/issue170.txt @@ -0,0 +1,2072 @@ +--------------------------------------------------------------------------------------------------------------- + name: + log: C:\Users\B18945\Downloads\xtevent-170-let-the-window-option-choose-a-window-range\issue170\issue17 +> 0.txt + log type: text + opened on: 3 May 2024, 15:44:15 + +. +. +. *load dataset from +. *https://github.com/JMSLab/xtevent/blob/main/test/example31.dta +. use example31, clear + +. +. ******************************** Error messages ****************************** +. +. *** Window(max|balanced) can be used only if impute(stag|instag) is specified +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(max) + +No proxy or instruments provided. Implementing OLS estimator + +Options window(max) and window(balanced) can be used only if the policyvar follows staggered adoption. + +Add impute(stag) or impute(instag) to check if the policyvar follows staggered adoption and impute it. + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(balanced) + +No proxy or instruments provided. Implementing OLS estimator + +Options window(max) and window(balanced) can be used only if the policyvar follows staggered adoption. + +Add impute(stag) or impute(instag) to check if the policyvar follows staggered adoption and impute it. + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(balanced) impute(nuchange) + +No proxy or instruments provided. Implementing OLS estimator + +Options window(max) and window(balanced) can be used only if the policyvar follows staggered adoption. + +Add impute(stag) or impute(instag) to check if the policyvar follows staggered adoption and impute it. + +. +. *** Error messages due incorrect specification of window +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(5.5) + +Number in window must be integer. + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(hello) + +window must be max or balanced. + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(hello -3) + +Invalid window option. + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(3.5 5.5 7.8) + +window can only have one or two elements. + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(3 5 7) + +window can only have one or two elements. + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(-3) + +Window can not be negative + +. +. *** errors because policyvar doesn't follow staggered adoption +. * no binary +. use example31, clear + +. replace z= 0.5 in 7 +(1 real change made) + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(max) + +No proxy or instruments provided. Implementing OLS estimator +The policy variable is not binary. Assuming non-staggered adoption (no imputation). +If event dummies and variables are saved, event-time will be missing. + +Cannot use window(max) if policyvar doesn't follow staggered adoption. + +. *it reverts +. use example31, clear + +. replace z= 0 in 8 +(1 real change made) + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(max) + +No proxy or instruments provided. Implementing OLS estimator +Policyvar changes more than once for some units. Assuming non-staggered adoption (no imputation). + +Cannot use window(max) if policyvar doesn't follow staggered adoption. + +. *always treated or never-treated units don't take the adopted or unadopted policy values +. use example31, clear + +. replace z= 1 if i==1 +(6 real changes made) + +. replace z=. in 8 +(1 real change made, 1 to missing) + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(max) + +No proxy or instruments provided. Implementing OLS estimator +For some units, the changes in policyvar are not consistent with no-unobserved-change. Reverting to default (no +> imputation). + +Cannot use window(max) if policyvar doesn't follow staggered adoption. + +. +. *** errors if the calculated limits for window are problematic +. +. *calculated left window is positive or right window is negative +. use example31, clear + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(balanced) + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(balanced) is (-1,-1), plus the endpoints -2 and 0. + +Left window can not be positive and right window can not be negative. + +Check for first-treated units and last-treated units. Both types of units might have few common periods around +> treatment time which causes a narrow calculated window. + +. replace z= 0 if t==20 & inlist(i, 54, 187, 240, 312, 315, 357, 446, 479, 487, 635, 687, 709, 748, 751, 887, 9 +> 23, 943) // these units are causing the right window limit to be negative. Turn them into never-treated units +> +(17 real changes made) + +. xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(balanced) + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(balanced) is (-1,0), plus the endpoints -2 and 1. + +Linear regression, absorbing indicators Number of obs = 20,000 +Absorbed variable: i No. of categories = 1,000 + F(23, 18977) = 1705.02 + Prob > F = 0.0000 + R-squared = 0.8017 + Adj R-squared = 0.7910 + Root MSE = 1.0029 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m2 | .0966512 .0632608 1.53 0.127 -.0273457 .2206481 + _k_eq_p0 | 1.036658 .0826308 12.55 0.000 .8746946 1.198622 + _k_eq_p1 | 1.018862 .0632675 16.10 0.000 .8948521 1.142872 + eta | .2555571 .0045355 56.35 0.000 .2466671 .2644471 + | + t | + 2 | .1329423 .0448503 2.96 0.003 .0450317 .2208529 + 3 | .3265141 .0448544 7.28 0.000 .2385956 .4144327 + 4 | .5459212 .0448688 12.17 0.000 .4579743 .633868 + 5 | .7704941 .0448975 17.16 0.000 .6824911 .8584972 + 6 | .9494113 .044931 21.13 0.000 .8613425 1.03748 + 7 | 1.116899 .0449954 24.82 0.000 1.028704 1.205094 + 8 | 1.399919 .0450501 31.07 0.000 1.311617 1.488221 + 9 | 1.57827 .0451242 34.98 0.000 1.489822 1.666717 + 10 | 1.810051 .0452134 40.03 0.000 1.721429 1.898673 + 11 | 1.956898 .0453227 43.18 0.000 1.868061 2.045734 + 12 | 2.131417 .0454573 46.89 0.000 2.042317 2.220518 + 13 | 2.37368 .0456114 52.04 0.000 2.284278 2.463083 + 14 | 2.522503 .0457314 55.16 0.000 2.432866 2.612141 + 15 | 2.75875 .0458235 60.20 0.000 2.668931 2.848568 + 16 | 2.980638 .0460083 64.78 0.000 2.890458 3.070819 + 17 | 3.18547 .0461261 69.06 0.000 3.095059 3.275881 + 18 | 3.3473 .0462274 72.41 0.000 3.25669 3.43791 + 19 | 3.54896 .0462721 76.70 0.000 3.458262 3.639657 + 20 | 3.767289 .0463329 81.31 0.000 3.676473 3.858106 + | + _cons | .1720965 .070765 2.43 0.015 .0333908 .3108023 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(999, 18977) = 21.608 Prob > F = 0.000 + +. +. +. ********************************* Examples to check correct functionality ****************************** +. +. ** OLS +. +. use example31, clear + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(max) // requires adding impute() + +No proxy or instruments provided. Implementing OLS estimator + +Options window(max) and window(balanced) can be used only if the policyvar follows staggered adoption. + +Add impute(stag) or impute(instag) to check if the policyvar follows staggered adoption and impute it. + +. xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(max) + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(max) is (-18,16), plus the endpoints -19 and 17. + +Linear regression, absorbing indicators Number of obs = 20,000 +Absorbed variable: i No. of categories = 1,000 + F(56, 18944) = 702.23 + Prob > F = 0.0000 + R-squared = 0.8023 + Adj R-squared = 0.7913 + Root MSE = 1.0022 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m19 | .6423926 .2608484 2.46 0.014 .1311064 1.153679 + _k_eq_m18 | -.1775268 .2104908 -0.84 0.399 -.5901075 .2350538 + _k_eq_m17 | .1263326 .1698441 0.74 0.457 -.206577 .4592422 + _k_eq_m16 | .0380571 .1450188 0.26 0.793 -.2461928 .3223069 + _k_eq_m15 | .005294 .1337594 0.04 0.968 -.2568864 .2674743 + _k_eq_m14 | -.1028837 .1236077 -0.83 0.405 -.3451658 .1393984 + _k_eq_m13 | -.1811439 .1143673 -1.58 0.113 -.405314 .0430262 + _k_eq_m12 | .1848555 .1070519 1.73 0.084 -.0249757 .3946868 + _k_eq_m11 | .0700347 .1022051 0.69 0.493 -.1302964 .2703658 + _k_eq_m10 | .1192835 .0973245 1.23 0.220 -.0714811 .3100481 + _k_eq_m9 | -.1123919 .0934684 -1.20 0.229 -.2955984 .0708146 + _k_eq_m8 | -.0008947 .0905761 -0.01 0.992 -.1784318 .1766425 + _k_eq_m7 | .0825609 .0871064 0.95 0.343 -.0881755 .2532973 + _k_eq_m6 | .1123127 .0850227 1.32 0.187 -.0543394 .2789648 + _k_eq_m5 | .1134179 .082994 1.37 0.172 -.0492577 .2760935 + _k_eq_m4 | .1225368 .0815805 1.50 0.133 -.0373683 .2824418 + _k_eq_m3 | .1437796 .0806316 1.78 0.075 -.0142655 .3018246 + _k_eq_m2 | .0626728 .0801585 0.78 0.434 -.094445 .2197905 + _k_eq_p0 | 1.030078 .0803795 12.82 0.000 .872527 1.187629 + _k_eq_p1 | .9553605 .081658 11.70 0.000 .7953035 1.115418 + _k_eq_p2 | 1.046724 .0825916 12.67 0.000 .8848376 1.208611 + _k_eq_p3 | 1.036179 .084252 12.30 0.000 .8710377 1.20132 + _k_eq_p4 | 1.00154 .0863377 11.60 0.000 .8323109 1.17077 + _k_eq_p5 | 1.153019 .0880671 13.09 0.000 .9803992 1.325638 + _k_eq_p6 | 1.000366 .0902809 11.08 0.000 .8234072 1.177324 + _k_eq_p7 | 1.030018 .0935097 11.02 0.000 .8467308 1.213306 + _k_eq_p8 | .97777 .0975634 10.02 0.000 .7865371 1.169003 + _k_eq_p9 | 1.035819 .1016011 10.19 0.000 .8366717 1.234966 + _k_eq_p10 | 1.111073 .1076606 10.32 0.000 .9000485 1.322097 + _k_eq_p11 | .9799806 .1153 8.50 0.000 .7539823 1.205979 + _k_eq_p12 | 1.16532 .1240796 9.39 0.000 .9221132 1.408527 + _k_eq_p13 | .8056877 .143361 5.62 0.000 .5246875 1.086688 + _k_eq_p14 | 1.129944 .1649623 6.85 0.000 .8066028 1.453284 + _k_eq_p15 | .7956263 .2124408 3.75 0.000 .3792235 1.212029 + _k_eq_p16 | .7021863 .3051937 2.30 0.021 .1039793 1.300393 + _k_eq_p17 | 1.457152 .5985379 2.43 0.015 .2839648 2.63034 + eta | .2519384 .0047391 53.16 0.000 .2426494 .2612275 + | + t | + 2 | .1434719 .0450851 3.18 0.001 .0551011 .2318427 + 3 | .3312757 .0451509 7.34 0.000 .2427759 .4197754 + 4 | .5528668 .0452825 12.21 0.000 .464109 .6416247 + 5 | .7741836 .0454452 17.04 0.000 .6851069 .8632602 + 6 | .9513304 .0455863 20.87 0.000 .8619772 1.040684 + 7 | 1.116552 .0457312 24.42 0.000 1.026915 1.206189 + 8 | 1.394627 .0458923 30.39 0.000 1.304674 1.48458 + 9 | 1.574857 .0460787 34.18 0.000 1.484539 1.665176 + 10 | 1.803088 .0462321 39.00 0.000 1.712469 1.893707 + 11 | 1.950842 .046446 42.00 0.000 1.859804 2.041881 + 12 | 2.123341 .0466535 45.51 0.000 2.031896 2.214786 + 13 | 2.361859 .046878 50.38 0.000 2.269974 2.453744 + 14 | 2.511809 .0470803 53.35 0.000 2.419527 2.604091 + 15 | 2.747289 .0472441 58.15 0.000 2.654686 2.839891 + 16 | 2.968836 .0475149 62.48 0.000 2.875702 3.06197 + 17 | 3.174446 .0477045 66.54 0.000 3.080941 3.267952 + 18 | 3.336821 .0479173 69.64 0.000 3.242898 3.430743 + 19 | 3.544168 .0481713 73.57 0.000 3.449748 3.638588 + 20 | 3.743031 .0486024 77.01 0.000 3.647766 3.838296 + | + _cons | -.1941443 .1921508 -1.01 0.312 -.570777 .1824883 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(999, 18944) = 21.600 Prob > F = 0.000 + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(balanced) //balanced window i +> s too narrow, this is not a problem of the option but a limit imposed by this dataset + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(balanced) is (-1,-1), plus the endpoints -2 and 0. + +Left window can not be positive and right window can not be negative. + +Check for first-treated units and last-treated units. Both types of units might have few common periods around +> treatment time which causes a narrow calculated window. + +. *Try with another dataset +. +. * compare with eventdd and its help file's dataset +. webuse set www.damianclarke.net/stata/ +(prefix now "http://www.damianclarke.net/stata") + +. webuse bacon_example, clear +(Stevenson and Wolfers (2006) divorce example, provided by Goldring et al.) + +. generate timeToTreat = year - _nfd +(429 missing values generated) + +. eventdd asmrs pcinc asmrh cases i.year, timevar(timeToTreat) method(fe, cluster(stfips)) // calculated window +> limits are -20 and 26, plus the endpoints + +Fixed-effects (within) regression Number of obs = 1,617 +Group variable: stfips Number of groups = 49 + +R-squared: Obs per group: + Within = 0.3908 min = 33 + Between = 0.0006 avg = 33.0 + Overall = 0.1143 max = 33 + + F(48, 48) = . +corr(u_i, Xb) = -0.2197 Prob > F = . + + (Std. err. adjusted for 49 clusters in stfips) +------------------------------------------------------------------------------ + | Robust + asmrs | Coefficient std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + pcinc | -.0011046 .0004071 -2.71 0.009 -.0019232 -.0002861 + asmrh | 1.08064 .5968879 1.81 0.076 -.119483 2.280764 + cases | -190.3716 134.4991 -1.42 0.163 -460.8002 80.05698 + | + year | + 1965 | 5.225278 2.085934 2.51 0.016 1.031228 9.419329 + 1966 | 2.803378 2.233247 1.26 0.215 -1.686867 7.293623 + 1967 | 4.61116 2.30199 2.00 0.051 -.0173022 9.239622 + 1968 | 5.596837 2.474536 2.26 0.028 .6214484 10.57223 + 1969 | 8.574786 3.108537 2.76 0.008 2.324653 14.82492 + 1970 | 10.65894 3.761173 2.83 0.007 3.096592 18.22128 + 1971 | 17.6067 3.528991 4.99 0.000 10.51119 24.70221 + 1972 | 14.0683 4.071123 3.46 0.001 5.882763 22.25385 + 1973 | 16.16345 4.696724 3.44 0.001 6.720049 25.60684 + 1974 | 17.01009 4.503385 3.78 0.000 7.955426 26.06475 + 1975 | 20.48743 4.645711 4.41 0.000 11.1466 29.82826 + 1976 | 16.76032 5.245676 3.20 0.002 6.213179 27.30746 + 1977 | 18.8125 4.868024 3.86 0.000 9.02468 28.60032 + 1978 | 15.53648 5.31917 2.92 0.005 4.841575 26.23139 + 1979 | 13.97376 5.979227 2.34 0.024 1.951718 25.9958 + 1980 | 11.16642 5.26412 2.12 0.039 .5822025 21.75065 + 1981 | 13.86874 5.83575 2.38 0.022 2.135177 25.6023 + 1982 | 10.84654 5.062437 2.14 0.037 .6678274 21.02525 + 1983 | 10.26562 5.572711 1.84 0.072 -.9390617 21.47031 + 1984 | 13.14376 5.799601 2.27 0.028 1.482879 24.80464 + 1985 | 9.251855 6.24809 1.48 0.145 -3.310772 21.81448 + 1986 | 14.41652 6.147773 2.34 0.023 2.055597 26.77745 + 1987 | 15.65435 5.964006 2.62 0.012 3.662911 27.64579 + 1988 | 13.44858 6.506079 2.07 0.044 .367229 26.52992 + 1989 | 12.80977 7.187861 1.78 0.081 -1.642396 27.26193 + 1990 | 14.06857 7.03352 2.00 0.051 -.0732654 28.21041 + 1991 | 13.22049 6.972729 1.90 0.064 -.7991248 27.2401 + 1992 | 12.87047 7.357297 1.75 0.087 -1.922369 27.66331 + 1993 | 15.34731 7.616965 2.01 0.050 .0323786 30.66225 + 1994 | 15.13629 7.739464 1.96 0.056 -.4249446 30.69753 + 1995 | 13.79803 8.05073 1.71 0.093 -2.389047 29.98511 + 1996 | 13.98251 8.372387 1.67 0.101 -2.851302 30.81632 + | + lead21 | -22.92073 4.011063 -5.71 0.000 -30.98551 -14.85594 + lead20 | -12.08418 10.99637 -1.10 0.277 -34.19385 10.0255 + lead19 | 8.842727 5.957829 1.48 0.144 -3.13629 20.82174 + lead18 | -.5159513 4.678946 -0.11 0.913 -9.923602 8.891699 + lead17 | -4.434874 6.210982 -0.71 0.479 -16.92289 8.053142 + lead16 | -1.022577 3.593627 -0.28 0.777 -8.248049 6.202895 + lead15 | .8477567 4.19552 0.20 0.841 -7.587901 9.283414 + lead14 | 4.327995 5.218016 0.83 0.411 -6.163529 14.81952 + lead13 | -1.388568 4.634641 -0.30 0.766 -10.70714 7.930001 + lead12 | -.0434501 6.912751 -0.01 0.995 -13.94247 13.85557 + lead11 | -9.381948 3.980237 -2.36 0.023 -17.38475 -1.379145 + lead10 | -1.150666 4.932033 -0.23 0.817 -11.06718 8.765851 + lead9 | -5.000702 3.587977 -1.39 0.170 -12.21481 2.213409 + lead8 | -2.73765 3.902927 -0.70 0.486 -10.58501 5.10971 + lead7 | -1.256434 4.34036 -0.29 0.773 -9.983313 7.470445 + lead6 | -.7505582 2.990802 -0.25 0.803 -6.763968 5.262852 + lead5 | -2.775423 2.620752 -1.06 0.295 -8.044798 2.493952 + lead4 | .2283574 2.39735 0.10 0.925 -4.591837 5.048552 + lead3 | -2.312587 2.970068 -0.78 0.440 -8.28431 3.659136 + lead2 | -.5157397 2.514907 -0.21 0.838 -5.572299 4.54082 + lag0 | .2507466 2.722144 0.09 0.927 -5.222491 5.723984 + lag1 | -1.619351 2.941537 -0.55 0.585 -7.533709 4.295006 + lag2 | -1.687107 3.898178 -0.43 0.667 -9.524919 6.150706 + lag3 | -.7444709 2.862572 -0.26 0.796 -6.500058 5.011116 + lag4 | -2.956354 2.832628 -1.04 0.302 -8.651735 2.739027 + lag5 | -2.377841 2.75474 -0.86 0.392 -7.916617 3.160935 + lag6 | -3.311888 3.568157 -0.93 0.358 -10.48615 3.862372 + lag7 | -5.136502 3.401946 -1.51 0.138 -11.97657 1.70357 + lag8 | -6.991146 3.086374 -2.27 0.028 -13.19672 -.785575 + lag9 | -4.82321 3.089481 -1.56 0.125 -11.03503 1.388607 + lag10 | -8.814158 3.6746 -2.40 0.020 -16.20244 -1.42588 + lag11 | -7.27331 3.631759 -2.00 0.051 -14.57545 .0288304 + lag12 | -6.151559 4.089512 -1.50 0.139 -14.37407 2.070957 + lag13 | -8.276837 3.946249 -2.10 0.041 -16.2113 -.3423707 + lag14 | -6.593221 3.867273 -1.70 0.095 -14.3689 1.182453 + lag15 | -7.850839 4.070836 -1.93 0.060 -16.0358 .3341258 + lag16 | -7.234422 4.270836 -1.69 0.097 -15.82151 1.35267 + lag17 | -8.516898 4.344278 -1.96 0.056 -17.25166 .2178592 + lag18 | -9.991582 3.758781 -2.66 0.011 -17.54912 -2.434046 + lag19 | -11.53613 3.861769 -2.99 0.004 -19.30074 -3.771526 + lag20 | -9.219165 4.501869 -2.05 0.046 -18.27078 -.167551 + lag21 | -10.79088 4.417864 -2.44 0.018 -19.67359 -1.908173 + lag22 | -10.65478 4.608349 -2.31 0.025 -19.92049 -1.389076 + lag23 | -12.08658 5.29214 -2.28 0.027 -22.72714 -1.446016 + lag24 | -10.67796 6.147523 -1.74 0.089 -23.03838 1.682466 + lag25 | -10.26777 7.459044 -1.38 0.175 -25.26518 4.729644 + lag26 | -16.69255 10.54234 -1.58 0.120 -37.88934 4.504239 + lag27 | -.4344752 8.147106 -0.05 0.958 -16.81533 15.94638 + _cons | 73.13054 7.291007 10.03 0.000 58.47098 87.79009 +-------------+---------------------------------------------------------------- + sigma_u | 15.826621 + sigma_e | 10.807927 + rho | .68196723 (fraction of variance due to u_i) +------------------------------------------------------------------------------ + +. *eventdd's balanced option (it estimates with maximum window, but shows plot that corresponds to balanced tim +> e periods only) +. eventdd asmrs pcinc asmrh cases i.year, timevar(timeToTreat) method(fe, cluster(stfips)) balanced // calcual +> ted window is (-4, 10), plus the endpoints + +Fixed-effects (within) regression Number of obs = 1,617 +Group variable: stfips Number of groups = 49 + +R-squared: Obs per group: + Within = 0.3908 min = 33 + Between = 0.0006 avg = 33.0 + Overall = 0.1143 max = 33 + + F(48, 48) = . +corr(u_i, Xb) = -0.2197 Prob > F = . + + (Std. err. adjusted for 49 clusters in stfips) +------------------------------------------------------------------------------ + | Robust + asmrs | Coefficient std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + pcinc | -.0011046 .0004071 -2.71 0.009 -.0019232 -.0002861 + asmrh | 1.08064 .5968879 1.81 0.076 -.119483 2.280764 + cases | -190.3716 134.4991 -1.42 0.163 -460.8002 80.05698 + | + year | + 1965 | 5.225278 2.085934 2.51 0.016 1.031228 9.419329 + 1966 | 2.803378 2.233247 1.26 0.215 -1.686867 7.293623 + 1967 | 4.61116 2.30199 2.00 0.051 -.0173022 9.239622 + 1968 | 5.596837 2.474536 2.26 0.028 .6214484 10.57223 + 1969 | 8.574786 3.108537 2.76 0.008 2.324653 14.82492 + 1970 | 10.65894 3.761173 2.83 0.007 3.096592 18.22128 + 1971 | 17.6067 3.528991 4.99 0.000 10.51119 24.70221 + 1972 | 14.0683 4.071123 3.46 0.001 5.882763 22.25385 + 1973 | 16.16345 4.696724 3.44 0.001 6.720049 25.60684 + 1974 | 17.01009 4.503385 3.78 0.000 7.955426 26.06475 + 1975 | 20.48743 4.645711 4.41 0.000 11.1466 29.82826 + 1976 | 16.76032 5.245676 3.20 0.002 6.213179 27.30746 + 1977 | 18.8125 4.868024 3.86 0.000 9.02468 28.60032 + 1978 | 15.53648 5.31917 2.92 0.005 4.841575 26.23139 + 1979 | 13.97376 5.979227 2.34 0.024 1.951718 25.9958 + 1980 | 11.16642 5.26412 2.12 0.039 .5822025 21.75065 + 1981 | 13.86874 5.83575 2.38 0.022 2.135177 25.6023 + 1982 | 10.84654 5.062437 2.14 0.037 .6678274 21.02525 + 1983 | 10.26562 5.572711 1.84 0.072 -.9390617 21.47031 + 1984 | 13.14376 5.799601 2.27 0.028 1.482879 24.80464 + 1985 | 9.251855 6.24809 1.48 0.145 -3.310772 21.81448 + 1986 | 14.41652 6.147773 2.34 0.023 2.055597 26.77745 + 1987 | 15.65435 5.964006 2.62 0.012 3.662911 27.64579 + 1988 | 13.44858 6.506079 2.07 0.044 .367229 26.52992 + 1989 | 12.80977 7.187861 1.78 0.081 -1.642396 27.26193 + 1990 | 14.06857 7.03352 2.00 0.051 -.0732654 28.21041 + 1991 | 13.22049 6.972729 1.90 0.064 -.7991248 27.2401 + 1992 | 12.87047 7.357297 1.75 0.087 -1.922369 27.66331 + 1993 | 15.34731 7.616965 2.01 0.050 .0323786 30.66225 + 1994 | 15.13629 7.739464 1.96 0.056 -.4249446 30.69753 + 1995 | 13.79803 8.05073 1.71 0.093 -2.389047 29.98511 + 1996 | 13.98251 8.372387 1.67 0.101 -2.851302 30.81632 + | + lead21 | -22.92073 4.011063 -5.71 0.000 -30.98551 -14.85594 + lead20 | -12.08418 10.99637 -1.10 0.277 -34.19385 10.0255 + lead19 | 8.842727 5.957829 1.48 0.144 -3.13629 20.82174 + lead18 | -.5159513 4.678946 -0.11 0.913 -9.923602 8.891699 + lead17 | -4.434874 6.210982 -0.71 0.479 -16.92289 8.053142 + lead16 | -1.022577 3.593627 -0.28 0.777 -8.248049 6.202895 + lead15 | .8477567 4.19552 0.20 0.841 -7.587901 9.283414 + lead14 | 4.327995 5.218016 0.83 0.411 -6.163529 14.81952 + lead13 | -1.388568 4.634641 -0.30 0.766 -10.70714 7.930001 + lead12 | -.0434501 6.912751 -0.01 0.995 -13.94247 13.85557 + lead11 | -9.381948 3.980237 -2.36 0.023 -17.38475 -1.379145 + lead10 | -1.150666 4.932033 -0.23 0.817 -11.06718 8.765851 + lead9 | -5.000702 3.587977 -1.39 0.170 -12.21481 2.213409 + lead8 | -2.73765 3.902927 -0.70 0.486 -10.58501 5.10971 + lead7 | -1.256434 4.34036 -0.29 0.773 -9.983313 7.470445 + lead6 | -.7505582 2.990802 -0.25 0.803 -6.763968 5.262852 + lead5 | -2.775423 2.620752 -1.06 0.295 -8.044798 2.493952 + lead4 | .2283574 2.39735 0.10 0.925 -4.591837 5.048552 + lead3 | -2.312587 2.970068 -0.78 0.440 -8.28431 3.659136 + lead2 | -.5157397 2.514907 -0.21 0.838 -5.572299 4.54082 + lag0 | .2507466 2.722144 0.09 0.927 -5.222491 5.723984 + lag1 | -1.619351 2.941537 -0.55 0.585 -7.533709 4.295006 + lag2 | -1.687107 3.898178 -0.43 0.667 -9.524919 6.150706 + lag3 | -.7444709 2.862572 -0.26 0.796 -6.500058 5.011116 + lag4 | -2.956354 2.832628 -1.04 0.302 -8.651735 2.739027 + lag5 | -2.377841 2.75474 -0.86 0.392 -7.916617 3.160935 + lag6 | -3.311888 3.568157 -0.93 0.358 -10.48615 3.862372 + lag7 | -5.136502 3.401946 -1.51 0.138 -11.97657 1.70357 + lag8 | -6.991146 3.086374 -2.27 0.028 -13.19672 -.785575 + lag9 | -4.82321 3.089481 -1.56 0.125 -11.03503 1.388607 + lag10 | -8.814158 3.6746 -2.40 0.020 -16.20244 -1.42588 + lag11 | -7.27331 3.631759 -2.00 0.051 -14.57545 .0288304 + lag12 | -6.151559 4.089512 -1.50 0.139 -14.37407 2.070957 + lag13 | -8.276837 3.946249 -2.10 0.041 -16.2113 -.3423707 + lag14 | -6.593221 3.867273 -1.70 0.095 -14.3689 1.182453 + lag15 | -7.850839 4.070836 -1.93 0.060 -16.0358 .3341258 + lag16 | -7.234422 4.270836 -1.69 0.097 -15.82151 1.35267 + lag17 | -8.516898 4.344278 -1.96 0.056 -17.25166 .2178592 + lag18 | -9.991582 3.758781 -2.66 0.011 -17.54912 -2.434046 + lag19 | -11.53613 3.861769 -2.99 0.004 -19.30074 -3.771526 + lag20 | -9.219165 4.501869 -2.05 0.046 -18.27078 -.167551 + lag21 | -10.79088 4.417864 -2.44 0.018 -19.67359 -1.908173 + lag22 | -10.65478 4.608349 -2.31 0.025 -19.92049 -1.389076 + lag23 | -12.08658 5.29214 -2.28 0.027 -22.72714 -1.446016 + lag24 | -10.67796 6.147523 -1.74 0.089 -23.03838 1.682466 + lag25 | -10.26777 7.459044 -1.38 0.175 -25.26518 4.729644 + lag26 | -16.69255 10.54234 -1.58 0.120 -37.88934 4.504239 + lag27 | -.4344752 8.147106 -0.05 0.958 -16.81533 15.94638 + _cons | 73.13054 7.291007 10.03 0.000 58.47098 87.79009 +-------------+---------------------------------------------------------------- + sigma_u | 15.826621 + sigma_e | 10.807927 + rho | .68196723 (fraction of variance due to u_i) +------------------------------------------------------------------------------ + +. +. * now use that dataset with xtevent command +. *max +. xtevent asmrs pcinc asmrh cases, timevar(year) panelvar(stfips) policyvar(post) impute(stag) window(max) // s +> ame window as with the eventdd command + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(max) is (-20,26), plus the endpoints -21 and 27. + +Linear regression, absorbing indicators Number of obs = 1,617 +Absorbed variable: stfips No. of categories = 49 + F(83, 1485) = 11.48 + Prob > F = 0.0000 + R-squared = 0.7212 + Adj R-squared = 0.6966 + Root MSE = 10.8079 + +------------------------------------------------------------------------------ + asmrs | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m21 | -22.92073 11.37384 -2.02 0.044 -45.23123 -.6102246 + _k_eq_m20 | -12.08418 8.219664 -1.47 0.142 -28.20757 4.039208 + _k_eq_m19 | 8.842727 8.195782 1.08 0.281 -7.233813 24.91927 + _k_eq_m18 | -.5159513 8.179167 -0.06 0.950 -16.5599 15.528 + _k_eq_m17 | -4.434874 8.15505 -0.54 0.587 -20.43152 11.56177 + _k_eq_m16 | -1.022577 6.759416 -0.15 0.880 -14.2816 12.23644 + _k_eq_m15 | .8477567 6.730708 0.13 0.900 -12.35495 14.05046 + _k_eq_m14 | 4.327995 6.717818 0.64 0.520 -8.849427 17.50542 + _k_eq_m13 | -1.388568 5.034247 -0.28 0.783 -11.26356 8.486422 + _k_eq_m12 | -.0434501 4.697811 -0.01 0.993 -9.258501 9.171601 + _k_eq_m11 | -9.381948 4.252798 -2.21 0.028 -17.72408 -1.039818 + _k_eq_m10 | -1.150666 3.815124 -0.30 0.763 -8.634271 6.332938 + _k_eq_m9 | -5.000702 3.184494 -1.57 0.117 -11.24729 1.245882 + _k_eq_m8 | -2.73765 3.038397 -0.90 0.368 -8.697656 3.222356 + _k_eq_m7 | -1.256434 2.821415 -0.45 0.656 -6.790816 4.277947 + _k_eq_m6 | -.7505582 2.760479 -0.27 0.786 -6.16541 4.664294 + _k_eq_m5 | -2.775423 2.668353 -1.04 0.298 -8.009564 2.458718 + _k_eq_m4 | .2283574 2.655076 0.09 0.931 -4.979741 5.436456 + _k_eq_m3 | -2.312587 2.605016 -0.89 0.375 -7.422491 2.797316 + _k_eq_m2 | -.5157397 2.612411 -0.20 0.844 -5.640148 4.608668 + _k_eq_p0 | .2507466 2.613315 0.10 0.924 -4.875434 5.376927 + _k_eq_p1 | -1.619351 2.602531 -0.62 0.534 -6.72438 3.485677 + _k_eq_p2 | -1.687107 2.651338 -0.64 0.525 -6.887872 3.513659 + _k_eq_p3 | -.7444709 2.659576 -0.28 0.780 -5.961395 4.472453 + _k_eq_p4 | -2.956354 2.70412 -1.09 0.274 -8.260656 2.347948 + _k_eq_p5 | -2.377841 2.713807 -0.88 0.381 -7.701143 2.945461 + _k_eq_p6 | -3.311888 2.730076 -1.21 0.225 -8.667103 2.043328 + _k_eq_p7 | -5.136502 2.744864 -1.87 0.061 -10.52072 .2477199 + _k_eq_p8 | -6.991146 2.754105 -2.54 0.011 -12.3935 -1.588797 + _k_eq_p9 | -4.82321 2.763293 -1.75 0.081 -10.24358 .5971632 + _k_eq_p10 | -8.814158 2.764971 -3.19 0.001 -14.23782 -3.390494 + _k_eq_p11 | -7.27331 2.77446 -2.62 0.009 -12.71559 -1.831032 + _k_eq_p12 | -6.151559 2.809711 -2.19 0.029 -11.66298 -.6401336 + _k_eq_p13 | -8.276837 2.847609 -2.91 0.004 -13.8626 -2.691073 + _k_eq_p14 | -6.593221 2.858804 -2.31 0.021 -12.20095 -.9854972 + _k_eq_p15 | -7.850839 2.867008 -2.74 0.006 -13.47466 -2.227023 + _k_eq_p16 | -7.234422 2.878539 -2.51 0.012 -12.88086 -1.587988 + _k_eq_p17 | -8.516898 2.91283 -2.92 0.004 -14.2306 -2.803198 + _k_eq_p18 | -9.991582 2.925868 -3.41 0.001 -15.73086 -4.252307 + _k_eq_p19 | -11.53613 2.938182 -3.93 0.000 -17.29956 -5.772704 + _k_eq_p20 | -9.219165 3.031173 -3.04 0.002 -15.165 -3.273328 + _k_eq_p21 | -10.79088 3.077907 -3.51 0.000 -16.82839 -4.753375 + _k_eq_p22 | -10.65478 3.166552 -3.36 0.001 -16.86617 -4.443391 + _k_eq_p23 | -12.08658 3.302592 -3.66 0.000 -18.56482 -5.608335 + _k_eq_p24 | -10.67796 3.850648 -2.77 0.006 -18.23124 -3.124669 + _k_eq_p25 | -10.26777 4.220049 -2.43 0.015 -18.54566 -1.989879 + _k_eq_p26 | -16.69255 6.109811 -2.73 0.006 -28.67733 -4.707772 + _k_eq_p27 | -.4344752 8.320606 -0.05 0.958 -16.75587 15.88692 + pcinc | -.0011046 .0002063 -5.35 0.000 -.0015093 -.0007 + asmrh | 1.08064 .3195947 3.38 0.001 .4537355 1.707545 + cases | -190.3716 54.98289 -3.46 0.001 -298.224 -82.51923 + | + year | + 1965 | 5.225278 2.314664 2.26 0.024 .6849187 9.765638 + 1966 | 2.803378 2.328778 1.20 0.229 -1.764666 7.371421 + 1967 | 4.61116 2.385918 1.93 0.053 -.0689673 9.291287 + 1968 | 5.596837 2.429648 2.30 0.021 .8309292 10.36274 + 1969 | 8.574786 2.53752 3.38 0.001 3.597282 13.55229 + 1970 | 10.65894 2.62164 4.07 0.000 5.516426 15.80145 + 1971 | 17.6067 2.719372 6.47 0.000 12.27248 22.94092 + 1972 | 14.0683 2.874215 4.89 0.000 8.430351 19.70626 + 1973 | 16.16345 3.026811 5.34 0.000 10.22617 22.10073 + 1974 | 17.01009 3.004951 5.66 0.000 11.11569 22.90449 + 1975 | 20.48743 3.04625 6.73 0.000 14.51202 26.46284 + 1976 | 16.76032 3.109164 5.39 0.000 10.6615 22.85914 + 1977 | 18.8125 3.190072 5.90 0.000 12.55497 25.07003 + 1978 | 15.53648 3.326895 4.67 0.000 9.01057 22.0624 + 1979 | 13.97376 3.358504 4.16 0.000 7.385843 20.56168 + 1980 | 11.16642 3.346006 3.34 0.001 4.603024 17.72982 + 1981 | 13.86874 3.406175 4.07 0.000 7.187314 20.55017 + 1982 | 10.84654 3.349709 3.24 0.001 4.275876 17.4172 + 1983 | 10.26562 3.395944 3.02 0.003 3.604267 16.92698 + 1984 | 13.14376 3.567761 3.68 0.000 6.145371 20.14215 + 1985 | 9.251855 3.656484 2.53 0.012 2.079433 16.42428 + 1986 | 14.41652 3.788273 3.81 0.000 6.985587 21.84746 + 1987 | 15.65435 3.860735 4.05 0.000 8.081274 23.22742 + 1988 | 13.44858 3.997081 3.36 0.001 5.608051 21.2891 + 1989 | 12.80977 4.147167 3.09 0.002 4.674839 20.9447 + 1990 | 14.06857 4.1887 3.36 0.001 5.852177 22.28497 + 1991 | 13.22049 4.202892 3.15 0.002 4.97625 21.46472 + 1992 | 12.87047 4.397498 2.93 0.003 4.244501 21.49644 + 1993 | 15.34731 4.478647 3.43 0.001 6.562165 24.13246 + 1994 | 15.13629 4.600901 3.29 0.001 6.111336 24.16125 + 1995 | 13.79803 4.70125 2.93 0.003 4.576233 23.01983 + 1996 | 13.98251 4.843201 2.89 0.004 4.482268 23.48275 + | + _cons | 75.54032 4.883258 15.47 0.000 65.9615 85.11914 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(48, 1485) = 50.534 Prob > F = 0.000 + +. xteventplot // x-axis labels are cramped. Leave adjustment to the user? + +. *balanced +. xtevent asmrs pcinc asmrh cases, timevar(year) panelvar(stfips) policyvar(post) impute(stag) window(balanced) +> // same window as with the eventdd command + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(balanced) is (-4,10), plus the endpoints -5 and 11. + +Linear regression, absorbing indicators Number of obs = 1,617 +Absorbed variable: stfips No. of categories = 49 + F(51, 1517) = 18.25 + Prob > F = 0.0000 + R-squared = 0.7164 + Adj R-squared = 0.6978 + Root MSE = 10.7860 + +------------------------------------------------------------------------------ + asmrs | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m5 | -2.296473 2.170827 -1.06 0.290 -6.554614 1.961667 + _k_eq_m4 | .1774566 2.64734 0.07 0.947 -5.015377 5.37029 + _k_eq_m3 | -2.380132 2.59882 -0.92 0.360 -7.477793 2.717529 + _k_eq_m2 | -.5617434 2.606436 -0.22 0.829 -5.674343 4.550856 + _k_eq_p0 | .3177935 2.60745 0.12 0.903 -4.796795 5.432382 + _k_eq_p1 | -1.568284 2.596491 -0.60 0.546 -6.661377 3.524809 + _k_eq_p2 | -1.616897 2.644714 -0.61 0.541 -6.80458 3.570786 + _k_eq_p3 | -.6558024 2.652497 -0.25 0.805 -5.858752 4.547147 + _k_eq_p4 | -2.882013 2.696776 -1.07 0.285 -8.171818 2.407791 + _k_eq_p5 | -2.347171 2.706141 -0.87 0.386 -7.655346 2.961003 + _k_eq_p6 | -3.271018 2.722442 -1.20 0.230 -8.611168 2.069132 + _k_eq_p7 | -5.147151 2.736446 -1.88 0.060 -10.51477 .2204684 + _k_eq_p8 | -7.046886 2.745308 -2.57 0.010 -12.43189 -1.661885 + _k_eq_p9 | -4.901624 2.753107 -1.78 0.075 -10.30192 .4986749 + _k_eq_p10 | -8.967955 2.754142 -3.26 0.001 -14.37028 -3.565626 + _k_eq_p11 | -8.320555 2.174546 -3.83 0.000 -12.58599 -4.05512 + pcinc | -.0010811 .0002054 -5.26 0.000 -.001484 -.0006783 + asmrh | 1.207423 .3140305 3.84 0.000 .5914431 1.823403 + cases | -193.0496 54.14657 -3.57 0.000 -299.2597 -86.83957 + | + year | + 1965 | 6.451365 2.189192 2.95 0.003 2.157201 10.74553 + 1966 | 3.912639 2.210265 1.77 0.077 -.4228594 8.248138 + 1967 | 5.973147 2.256475 2.65 0.008 1.547005 10.39929 + 1968 | 6.481465 2.308012 2.81 0.005 1.954231 11.0087 + 1969 | 9.534778 2.432557 3.92 0.000 4.763247 14.30631 + 1970 | 11.89369 2.524133 4.71 0.000 6.942535 16.84485 + 1971 | 18.68224 2.637173 7.08 0.000 13.50935 23.85513 + 1972 | 14.96715 2.794063 5.36 0.000 9.486516 20.44779 + 1973 | 16.85898 2.956617 5.70 0.000 11.05949 22.65847 + 1974 | 17.70936 2.933907 6.04 0.000 11.95441 23.4643 + 1975 | 21.22566 2.981853 7.12 0.000 15.37667 27.07465 + 1976 | 17.53607 3.045112 5.76 0.000 11.56299 23.50914 + 1977 | 19.63556 3.121998 6.29 0.000 13.51167 25.75945 + 1978 | 16.3839 3.25831 5.03 0.000 9.992636 22.77517 + 1979 | 14.77146 3.286973 4.49 0.000 8.323967 21.21895 + 1980 | 11.999 3.274261 3.66 0.000 5.57644 18.42156 + 1981 | 14.8144 3.33669 4.44 0.000 8.26939 21.35942 + 1982 | 11.9114 3.269006 3.64 0.000 5.499155 18.32365 + 1983 | 11.59646 3.316672 3.50 0.000 5.090714 18.10221 + 1984 | 14.39335 3.480903 4.13 0.000 7.565455 21.22124 + 1985 | 10.86624 3.575916 3.04 0.002 3.851978 17.8805 + 1986 | 15.54782 3.711335 4.19 0.000 8.267933 22.82771 + 1987 | 16.95428 3.785147 4.48 0.000 9.529607 24.37896 + 1988 | 14.28859 3.917564 3.65 0.000 6.604171 21.973 + 1989 | 13.50296 4.064894 3.32 0.001 5.529553 21.47637 + 1990 | 14.1299 4.091729 3.45 0.001 6.10386 22.15595 + 1991 | 13.17604 4.093865 3.22 0.001 5.145802 21.20627 + 1992 | 12.20114 4.274733 2.85 0.004 3.816129 20.58615 + 1993 | 14.84599 4.333458 3.43 0.001 6.345788 23.3462 + 1994 | 14.23651 4.433695 3.21 0.001 5.539685 22.93333 + 1995 | 12.64733 4.497172 2.81 0.005 3.825992 21.46866 + 1996 | 13.02559 4.59249 2.84 0.005 4.017288 22.03389 + | + _cons | 72.93132 4.386068 16.63 0.000 64.32792 81.53472 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(48, 1517) = 51.856 Prob > F = 0.000 + +. xteventplot + +. +. ** missing values in varlist +. use example31, clear + +. gen pois = rpoisson(5) in 1/200 +(19,800 missing values generated) + +. xtevent y eta i.pois, panelvar(i) timevar(t) pol(z) window(max) impute(stag) plot // window=(-15, 12) and end +> points={-16, 13} + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(max) is (-15,12), plus the endpoints -16 and 13. + +Linear regression, absorbing indicators Number of obs = 200 +Absorbed variable: i No. of categories = 10 + F(61, 129) = 8.20 + Prob > F = 0.0000 + R-squared = 0.8737 + Adj R-squared = 0.8052 + Root MSE = 0.9970 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m16 | .560613 1.348561 0.42 0.678 -2.107548 3.228774 + _k_eq_m15 | -.2059473 1.36986 -0.15 0.881 -2.916249 2.504354 + _k_eq_m14 | -2.852868 1.347598 -2.12 0.036 -5.519125 -.1866118 + _k_eq_m13 | -1.10108 1.028342 -1.07 0.286 -3.135679 .9335191 + _k_eq_m12 | -.5310655 1.002768 -0.53 0.597 -2.515066 1.452935 + _k_eq_m11 | -.4089488 1.048527 -0.39 0.697 -2.483486 1.665588 + _k_eq_m10 | -.9690414 .8220196 -1.18 0.241 -2.595427 .6573445 + _k_eq_m9 | -.2634298 .8397453 -0.31 0.754 -1.924886 1.398027 + _k_eq_m8 | -.3228574 .7950273 -0.41 0.685 -1.895838 1.250124 + _k_eq_m7 | -1.116465 .7532004 -1.48 0.141 -2.606691 .3737601 + _k_eq_m6 | -.6845226 .7932786 -0.86 0.390 -2.254044 .8849985 + _k_eq_m5 | -.7666738 .7315255 -1.05 0.297 -2.214015 .6806674 + _k_eq_m4 | -1.20671 .6839893 -1.76 0.080 -2.559999 .14658 + _k_eq_m3 | -.6253083 .7197171 -0.87 0.387 -2.049286 .7986696 + _k_eq_m2 | -.8240205 .724268 -1.14 0.257 -2.257002 .6089614 + _k_eq_p0 | -1.377646 .7310289 -1.88 0.062 -2.824004 .0687128 + _k_eq_p1 | .7774984 .7340882 1.06 0.292 -.6749131 2.22991 + _k_eq_p2 | .1859508 .6911306 0.27 0.788 -1.181468 1.55337 + _k_eq_p3 | .3241807 .708615 0.46 0.648 -1.077832 1.726193 + _k_eq_p4 | -.3398123 .7753383 -0.44 0.662 -1.873838 1.194213 + _k_eq_p5 | .3989768 .7556706 0.53 0.598 -1.096136 1.894089 + _k_eq_p6 | -.9042474 .7736386 -1.17 0.245 -2.43491 .6264155 + _k_eq_p7 | .8447507 .8788049 0.96 0.338 -.8939864 2.583488 + _k_eq_p8 | .3979451 .8566957 0.46 0.643 -1.297048 2.092938 + _k_eq_p9 | .0725575 .8486792 0.09 0.932 -1.606575 1.75169 + _k_eq_p10 | -2.693658 1.234258 -2.18 0.031 -5.135668 -.2516482 + _k_eq_p11 | 1.160472 1.26611 0.92 0.361 -1.344558 3.665501 + _k_eq_p12 | -.2253111 1.225097 -0.18 0.854 -2.649195 2.198573 + _k_eq_p13 | .0885968 1.236451 0.07 0.943 -2.357752 2.534945 + eta | .2780505 .0548273 5.07 0.000 .1695733 .3865276 + | + pois | + 1 | .0198979 .8267618 0.02 0.981 -1.615871 1.655666 + 2 | .3175376 .7169292 0.44 0.659 -1.100924 1.736 + 3 | .5907008 .6907714 0.86 0.394 -.7760073 1.957409 + 4 | .3295756 .6792246 0.49 0.628 -1.014287 1.673438 + 5 | .742053 .6656064 1.11 0.267 -.5748655 2.058972 + 6 | .3954542 .6999332 0.56 0.573 -.9893808 1.780289 + 7 | .763714 .7046482 1.08 0.280 -.6304497 2.157878 + 8 | .9906147 .7560632 1.31 0.192 -.5052748 2.486504 + 9 | .2487004 .7628212 0.33 0.745 -1.26056 1.757961 + 10 | -.0004487 .8643074 -0.00 1.000 -1.710502 1.709605 + 11 | 1.215473 1.379755 0.88 0.380 -1.514405 3.945352 + 13 | -.3297151 1.365123 -0.24 0.810 -3.030644 2.371214 + | + t | + 2 | -.1275904 .5439554 -0.23 0.815 -1.203819 .9486387 + 3 | .4417375 .5402322 0.82 0.415 -.6271253 1.5106 + 4 | .7064052 .5050924 1.40 0.164 -.2929324 1.705743 + 5 | .5758813 .5349487 1.08 0.284 -.4825278 1.63429 + 6 | .5590622 .5294639 1.06 0.293 -.488495 1.606619 + 7 | 1.674661 .5234591 3.20 0.002 .6389846 2.710338 + 8 | 1.216357 .5316151 2.29 0.024 .1645437 2.268171 + 9 | 1.377323 .5305226 2.60 0.011 .3276715 2.426975 + 10 | 1.499339 .533452 2.81 0.006 .443891 2.554787 + 11 | 2.245532 .5239535 4.29 0.000 1.208877 3.282186 + 12 | 1.928375 .5555267 3.47 0.001 .8292523 3.027499 + 13 | 2.367533 .5394007 4.39 0.000 1.300315 3.43475 + 14 | 2.634955 .5511094 4.78 0.000 1.544572 3.725339 + 15 | 2.797359 .5576196 5.02 0.000 1.694095 3.900623 + 16 | 2.789451 .5600601 4.98 0.000 1.681359 3.897544 + 17 | 3.710663 .5710368 6.50 0.000 2.580853 4.840473 + 18 | 3.681146 .5782784 6.37 0.000 2.537008 4.825284 + 19 | 3.635039 .585166 6.21 0.000 2.477274 4.792805 + 20 | 3.656317 .5947088 6.15 0.000 2.479671 4.832963 + | + _cons | -.5181891 1.207012 -0.43 0.668 -2.906292 1.869914 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(9, 129) = 7.008 Prob > F = 0.000 + +. * marksample (the marker for non-missing observations in varlist) doesn't interfer with mark (the marker for +> if & in conditions) +. xtevent y eta i.pois if i<4, panelvar(i) timevar(t) pol(z) window(max) impute(stag) plot // window=(-12, 12) +> and endpoints={-13, 13} + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(max) is (-12,12), plus the endpoints -13 and 13. +note: 8.pois omitted because of collinearity. +note: 9.pois omitted because of collinearity. + +Linear regression, absorbing indicators Number of obs = 60 +Absorbed variable: i No. of categories = 3 + F(53, 4) = 3.26 + Prob > F = 0.1281 + R-squared = 0.9834 + Adj R-squared = 0.7550 + Root MSE = 1.0665 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m13 | -8.367274 6.776987 -1.23 0.285 -27.18321 10.44866 + _k_eq_m12 | -3.563941 4.025411 -0.89 0.426 -14.74027 7.61239 + _k_eq_m11 | -7.020123 6.068445 -1.16 0.312 -23.86883 9.828581 + _k_eq_m10 | -6.956378 5.417937 -1.28 0.268 -21.99898 8.086228 + _k_eq_m9 | -4.595968 3.187813 -1.44 0.223 -13.44676 4.254819 + _k_eq_m8 | -5.194566 3.61702 -1.44 0.224 -15.23702 4.847892 + _k_eq_m7 | -6.965982 3.377781 -2.06 0.108 -16.34421 2.412242 + _k_eq_m6 | -4.251339 3.267426 -1.30 0.263 -13.32317 4.820492 + _k_eq_m5 | -3.586928 2.883485 -1.24 0.281 -11.59276 4.418909 + _k_eq_m4 | -2.713975 1.706517 -1.59 0.187 -7.452025 2.024075 + _k_eq_m3 | -2.104741 1.826917 -1.15 0.313 -7.177076 2.967595 + _k_eq_m2 | -3.954462 1.812082 -2.18 0.095 -8.985608 1.076685 + _k_eq_p0 | -4.89664 2.589904 -1.89 0.132 -12.08737 2.294085 + _k_eq_p1 | .7975102 2.514008 0.32 0.767 -6.182495 7.777516 + _k_eq_p2 | -.9998502 1.650652 -0.61 0.577 -5.582795 3.583095 + _k_eq_p3 | 1.477638 2.898152 0.51 0.637 -6.568922 9.524198 + _k_eq_p4 | -.8901499 2.117507 -0.42 0.696 -6.769292 4.988992 + _k_eq_p5 | -1.924405 2.456851 -0.78 0.477 -8.745718 4.896908 + _k_eq_p6 | -.7561025 1.836914 -0.41 0.702 -5.856192 4.343987 + _k_eq_p7 | -5.046578 4.16092 -1.21 0.292 -16.59914 6.505988 + _k_eq_p8 | 2.00014 2.654204 0.75 0.493 -5.369111 9.369392 + _k_eq_p9 | -.6230254 2.431817 -0.26 0.810 -7.374831 6.12878 + _k_eq_p10 | -1.460612 3.74461 -0.39 0.716 -11.85732 8.936093 + _k_eq_p11 | -1.285112 2.484983 -0.52 0.632 -8.18453 5.614307 + _k_eq_p12 | .6814398 2.620607 0.26 0.808 -6.594531 7.95741 + _k_eq_p13 | -.7875301 2.540835 -0.31 0.772 -7.842018 6.266958 + eta | -.0505091 .5090115 -0.10 0.926 -1.463752 1.362734 + | + pois | + 2 | -2.76873 2.875224 -0.96 0.390 -10.75163 5.214172 + 3 | -3.196865 3.808415 -0.84 0.448 -13.77072 7.376991 + 4 | -3.984475 3.904816 -1.02 0.365 -14.82598 6.857032 + 5 | -2.250303 3.517827 -0.64 0.557 -12.01736 7.51675 + 6 | -1.224586 3.708719 -0.33 0.758 -11.52164 9.072467 + 7 | -2.332293 3.980883 -0.59 0.589 -13.385 8.72041 + 8 | 0 (omitted) + 9 | 0 (omitted) + 10 | -3.807345 3.995542 -0.95 0.395 -14.90075 7.286059 + | + t | + 2 | -1.550675 1.572088 -0.99 0.380 -5.915493 2.814142 + 3 | .1943234 1.841973 0.11 0.921 -4.919812 5.308459 + 4 | -.6719961 2.461526 -0.27 0.798 -7.506288 6.162296 + 5 | -.0017005 2.327217 -0.00 0.999 -6.463091 6.45969 + 6 | -.6821088 2.154854 -0.32 0.767 -6.664943 5.300725 + 7 | 2.891478 2.309807 1.25 0.279 -3.521574 9.30453 + 8 | .4951514 2.463729 0.20 0.851 -6.345256 7.335559 + 9 | -1.437274 2.002204 -0.72 0.513 -6.996283 4.121735 + 10 | -.8918686 3.084909 -0.29 0.787 -9.45695 7.673213 + 11 | -.0290626 2.994579 -0.01 0.993 -8.343348 8.285222 + 12 | 1.268274 2.812808 0.45 0.675 -6.541335 9.077882 + 13 | -.7099993 2.897973 -0.24 0.819 -8.756061 7.336062 + 14 | 2.122402 3.275238 0.65 0.552 -6.971115 11.21592 + 15 | -1.20223 3.079734 -0.39 0.716 -9.752943 7.348484 + 16 | .8031321 2.437629 0.33 0.758 -5.96481 7.571074 + 17 | -1.259655 5.22641 -0.24 0.821 -15.77049 13.25118 + 18 | 2.668083 2.596196 1.03 0.362 -4.540112 9.876278 + 19 | .9846126 3.30826 0.30 0.781 -8.20059 10.16982 + 20 | 1.139018 2.593297 0.44 0.683 -6.061129 8.339165 + | + _cons | 9.346071 7.49655 1.25 0.281 -11.46769 30.15983 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(2, 4) = 1.358 Prob > F = 0.355 + +. +. +. ******* IV +. +. *** return to the example31 dataset +. use example31, clear + +. cap noi xtevent y eta, panelvar(i) timevar(t) policyvar(z) proxy(x) impute(stag) window(max) // instrument is +> collinear + +Proxy for the confound specified. Implementing FHS estimator +The calculated window by window(max) is (-18,16), plus the endpoints -19 and 17. + +proxyiv=select. Selecting lead order of differenced policy variable to use as instrument. + +Lead 1 selected. + +The corresponding coefficient of lead 1 and the normalized coefficient were the same. Lead 1 has been changed t +> o 2. + +The coefficient at -1 is normalized to zero. + +For estimation with proxy variables, an additional coefficient needs to be normalized to zero. + +The coefficient at -2 was selected to be normalized to zero. +The calculated window by window(max) is (-18,16), plus the endpoints -19 and 17. +Instrument _fd1__00000M is collinear with the included event-time dummies. You may have generated leads of the +> policy variable and included them in the proxyiv option instead of specifying the lead numbers. + +. * try same specification but with a narrower observed data range +. keep if inrange(t,5,15) +(9,000 observations deleted) + +. xtevent y eta, panelvar(i) timevar(t) policyvar(z) proxy(x) impute(stag) window(max) + +Proxy for the confound specified. Implementing FHS estimator +The calculated window by window(max) is (-9,8), plus the endpoints -10 and 9. + +proxyiv=select. Selecting lead order of differenced policy variable to use as instrument. + +Lead 1 selected. + +The corresponding coefficient of lead 1 and the normalized coefficient were the same. Lead 1 has been changed t +> o 2. + +The coefficient at -1 is normalized to zero. + +For estimation with proxy variables, an additional coefficient needs to be normalized to zero. + +The coefficient at -2 was selected to be normalized to zero. +The calculated window by window(max) is (-9,8), plus the endpoints -10 and 9. + +Fixed-effects (within) IV regression Number of obs = 10,000 +Group variable: i Number of groups = 1,000 + +R-squared: Obs per group: + Within = . min = 10 + Between = 0.3445 avg = 10.0 + Overall = 0.2103 max = 10 + + Wald chi2(28) = 23808.93 +corr(u_i, Xb) = 0.0125 Prob > chi2 = 0.0000 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. z P>|z| [95% conf. interval] +-------------+---------------------------------------------------------------- + x | -.4879222 .7193592 -0.68 0.498 -1.89784 .9219958 + eta | .7570187 .7253486 1.04 0.297 -.6646384 2.178676 + _k_eq_m10 | .3993927 .3963412 1.01 0.314 -.3774217 1.176207 + _k_eq_m9 | .0707463 .2780328 0.25 0.799 -.474188 .6156806 + _k_eq_m8 | -.4661491 .4344043 -1.07 0.283 -1.317566 .3852678 + _k_eq_m7 | .0513635 .2219985 0.23 0.817 -.3837455 .4864725 + _k_eq_m6 | .2412075 .1842696 1.31 0.191 -.1199543 .6023693 + _k_eq_m5 | -.028135 .1738645 -0.16 0.871 -.3689031 .3126331 + _k_eq_m4 | .0575744 .1414498 0.41 0.684 -.2196622 .334811 + _k_eq_m3 | -.1190687 .2960646 -0.40 0.688 -.6993447 .4612072 + _k_eq_p0 | .9041599 .1546977 5.84 0.000 .6009579 1.207362 + _k_eq_p1 | .8578694 .1357859 6.32 0.000 .591734 1.124005 + _k_eq_p2 | .8873698 .1460525 6.08 0.000 .6011123 1.173627 + _k_eq_p3 | .8519585 .1549772 5.50 0.000 .5482088 1.155708 + _k_eq_p4 | .7855899 .1920357 4.09 0.000 .4092069 1.161973 + _k_eq_p5 | .9677126 .2253588 4.29 0.000 .5260175 1.409408 + _k_eq_p6 | .8445128 .2597037 3.25 0.001 .3355029 1.353523 + _k_eq_p7 | 1.144286 .2672796 4.28 0.000 .6204277 1.668144 + _k_eq_p8 | .5030253 .4980757 1.01 0.313 -.4731851 1.479236 + _k_eq_p9 | 0 (omitted) + | + t | + 6 | .2602807 .1290741 2.02 0.044 .0073 .5132613 + 7 | .4142545 .1143486 3.62 0.000 .1901354 .6383736 + 8 | .6964738 .1161524 6.00 0.000 .4688192 .9241284 + 9 | .8927858 .1323746 6.74 0.000 .6333363 1.152235 + 10 | 1.061228 .0673523 15.76 0.000 .9292198 1.193236 + 11 | 1.235587 .0878502 14.06 0.000 1.063404 1.40777 + 12 | 1.393826 .0743839 18.74 0.000 1.248036 1.539616 + 13 | 1.703795 .1548552 11.00 0.000 1.400284 2.007305 + 14 | 1.804945 .0915412 19.72 0.000 1.625527 1.984362 + | + _cons | .7121939 .3346539 2.13 0.033 .0562843 1.368104 +-------------+---------------------------------------------------------------- + sigma_u | 1.1301557 + sigma_e | 1.4110677 + rho | .39079243 (fraction of variance due to u_i) +------------------------------------------------------------------------------ + F test that all u_i=0: F(999,8972) = 5.55 Prob > F = 0.0000 +------------------------------------------------------------------------------ +Endogenous: x +Exogenous: eta _k_eq_m10 _k_eq_m9 _k_eq_m8 _k_eq_m7 _k_eq_m6 _k_eq_m5 + _k_eq_m4 _k_eq_m3 _k_eq_p0 _k_eq_p1 _k_eq_p2 _k_eq_p3 _k_eq_p4 + _k_eq_p5 _k_eq_p6 _k_eq_p7 _k_eq_p8 _k_eq_p9 6.t 7.t 8.t 9.t 10.t + 11.t 12.t 13.t 14.t _fd1__00000M + +. *balanced +. cap noi xtevent y eta, panelvar(i) timevar(t) policyvar(z) proxy(x) impute(stag) window(balanced) // cannot t +> est because balanced window is too narrow + +Proxy for the confound specified. Implementing FHS estimator +The calculated window by window(balanced) is (0,-1), plus the endpoints -1 and 0. + +Left window can not be positive and right window can not be negative. + +Check for first-treated units and last-treated units. Both types of units might have few common periods around +> treatment time which causes a narrow calculated window. + +. +. *** try csdid's dataset +. use "https://friosavila.github.io/playingwithstata/drdid/mpdta.dta", clear +(Written by R. ) + +. xtset countyreal year + +Panel variable: countyreal (strongly balanced) + Time variable: year, 2003 to 2007 + Delta: 1 unit + +. gen ttreat = year - first_treat + +. gen z=(ttreat>=0) + +. csdid lemp lpop , ivar(countyreal) time(year) gvar(first_treat) method(dripw) +............ +Difference-in-difference with Multiple Time Periods + + Number of obs = 2,500 +Outcome model : least squares +Treatment model: inverse probability +------------------------------------------------------------------------------ + | Coefficient Std. err. z P>|z| [95% conf. interval] +-------------+---------------------------------------------------------------- +g2004 | + t_2003_2004 | -.0145297 .0221292 -0.66 0.511 -.057902 .0288427 + t_2003_2005 | -.0764219 .0286713 -2.67 0.008 -.1326166 -.0202271 + t_2003_2006 | -.1404483 .0353782 -3.97 0.000 -.2097882 -.0711084 + t_2003_2007 | -.1069039 .0328865 -3.25 0.001 -.1713602 -.0424476 +-------------+---------------------------------------------------------------- +g2006 | + t_2003_2004 | -.0004721 .0222234 -0.02 0.983 -.0440293 .043085 + t_2004_2005 | -.0062025 .0184957 -0.34 0.737 -.0424534 .0300484 + t_2005_2006 | .0009606 .0194002 0.05 0.961 -.0370631 .0389843 + t_2005_2007 | -.0412939 .0197211 -2.09 0.036 -.0799466 -.0026411 +-------------+---------------------------------------------------------------- +g2007 | + t_2003_2004 | .0267278 .0140657 1.90 0.057 -.0008404 .054296 + t_2004_2005 | -.0045766 .0157178 -0.29 0.771 -.0353828 .0262297 + t_2005_2006 | -.0284475 .0181809 -1.56 0.118 -.0640814 .0071864 + t_2006_2007 | -.0287814 .016239 -1.77 0.076 -.0606091 .0030464 +------------------------------------------------------------------------------ +Control: Never Treated + +See Callaway and Sant'Anna (2021) for details + +. set seed 3 + +. gen eta=runiform() + +. *max +. xtevent lemp lpop, timevar(year) panelvar(countyreal) policyvar(z) proxy(eta) impute(stag) window(max) + +Proxy for the confound specified. Implementing FHS estimator +The calculated window by window(max) is (-3,2), plus the endpoints -4 and 3. + +proxyiv=select. Selecting lead order of differenced policy variable to use as instrument. + +Lead 1 selected. + +The corresponding coefficient of lead 1 and the normalized coefficient were the same. Lead 1 has been changed t +> o 2. + +The coefficient at -1 is normalized to zero. + +For estimation with proxy variables, an additional coefficient needs to be normalized to zero. + +The coefficient at -2 was selected to be normalized to zero. +The calculated window by window(max) is (-3,2), plus the endpoints -4 and 3. + +Fixed-effects (within) IV regression Number of obs = 2,000 +Group variable: countyreal Number of groups = 500 + +R-squared: Obs per group: + Within = . min = 4 + Between = 0.0034 avg = 4.0 + Overall = 0.0011 max = 4 + + Wald chi2(9) = 2.12e+06 +corr(u_i, Xb) = 0.0089 Prob > chi2 = 0.0000 + +------------------------------------------------------------------------------ + lemp | Coefficient Std. err. z P>|z| [95% conf. interval] +-------------+---------------------------------------------------------------- + eta | -.4069664 .4087195 -1.00 0.319 -1.208042 .3941091 + lpop | 0 (omitted) + _k_eq_m4 | -.0049897 .0240196 -0.21 0.835 -.0520673 .0420878 + _k_eq_m3 | .0112779 .018761 0.60 0.548 -.025493 .0480487 + _k_eq_p0 | .0261852 .0385247 0.68 0.497 -.0493217 .1016922 + _k_eq_p1 | -.0483902 .0555549 -0.87 0.384 -.1572759 .0604955 + _k_eq_p2 | -.1188999 .0530936 -2.24 0.025 -.2229613 -.0148384 + _k_eq_p3 | 0 (omitted) + | + year | + 2004 | -.0590885 .0127085 -4.65 0.000 -.0839967 -.0341803 + 2005 | -.0450249 .0132708 -3.39 0.001 -.0710352 -.0190146 + 2006 | -.0147198 .0145478 -1.01 0.312 -.0432329 .0137933 + | + _cons | 6.001362 .2014297 29.79 0.000 5.606567 6.396157 +-------------+---------------------------------------------------------------- + sigma_u | 1.5017352 + sigma_e | .17710935 + rho | .9862818 (fraction of variance due to u_i) +------------------------------------------------------------------------------ + F test that all u_i=0: F(499,1491) = 36.10 Prob > F = 0.0000 +------------------------------------------------------------------------------ +Endogenous: eta +Exogenous: lpop _k_eq_m4 _k_eq_m3 _k_eq_p0 _k_eq_p1 _k_eq_p2 _k_eq_p3 + 2004.year 2005.year 2006.year _fd1__00000M + +. *balanced +. cap noi xtevent lemp lpop, timevar(year) panelvar(countyreal) policyvar(z) proxy(eta) impute(stag) window(bal +> anced) //cannot test "balanced" with this dataset, window is too narrow + +Proxy for the confound specified. Implementing FHS estimator +The calculated window by window(balanced) is (0,-1), plus the endpoints -1 and 0. + +Left window can not be positive and right window can not be negative. + +Check for first-treated units and last-treated units. Both types of units might have few common periods around +> treatment time which causes a narrow calculated window. + +. +. +. *Check that lead in proxyiv is not outside estimation window +. use example31, clear + +. cap noi xtevent y eta, panelvar(i) timevar(t) policyvar(z) proxy(x) impute(stag) window(max) proxyiv(5 e 20) + +Proxy for the confound specified. Implementing FHS estimator +The calculated window by window(max) is (-18,16), plus the endpoints -19 and 17. +Lead 20 of policy variable to be used as instrument is outside estimation window. + +. +. ** missing values in varlist +. use example31, clear + +. keep if inrange(t,5,15) // +(9,000 observations deleted) + +. gen pois = rpoisson(5) in 1/2000 +(9,000 missing values generated) + +. xtevent y eta i.pois, panelvar(i) timevar(t) pol(z) impute(stag) proxy(x) window(max) // window=(-9, 8) and +> endpoints={-10, 9} + +Proxy for the confound specified. Implementing FHS estimator +The calculated window by window(max) is (-9,8), plus the endpoints -10 and 9. + +proxyiv=select. Selecting lead order of differenced policy variable to use as instrument. + +Lead 1 selected. + +The corresponding coefficient of lead 1 and the normalized coefficient were the same. Lead 1 has been changed t +> o 2. + +The coefficient at -1 is normalized to zero. + +For estimation with proxy variables, an additional coefficient needs to be normalized to zero. + +The coefficient at -2 was selected to be normalized to zero. +The calculated window by window(max) is (-9,8), plus the endpoints -10 and 9. + +Fixed-effects (within) IV regression Number of obs = 1,819 +Group variable: i Number of groups = 182 + +R-squared: Obs per group: + Within = . min = 9 + Between = 0.1577 avg = 10.0 + Overall = 0.0305 max = 10 + + Wald chi2(42) = 332.82 +corr(u_i, Xb) = -0.2415 Prob > chi2 = 0.0000 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. z P>|z| [95% conf. interval] +-------------+---------------------------------------------------------------- + x | -2.386971 32.77031 -0.07 0.942 -66.6156 61.84166 + eta | 2.817379 34.74952 0.08 0.935 -65.29044 70.92519 + | + pois | + 1 | -.663667 11.51111 -0.06 0.954 -23.22503 21.89769 + 2 | -.8089784 16.85024 -0.05 0.962 -33.83485 32.21689 + 3 | .1175479 3.262533 0.04 0.971 -6.2769 6.511996 + 4 | -.4676437 10.42037 -0.04 0.964 -20.89119 19.9559 + 5 | -.7270336 13.38708 -0.05 0.957 -26.96524 25.51117 + 6 | .1756473 3.584847 0.05 0.961 -6.850524 7.201819 + 7 | -.0853095 7.974763 -0.01 0.991 -15.71556 15.54494 + 8 | .5211421 2.056263 0.25 0.800 -3.50906 4.551345 + 9 | 1.212277 11.26895 0.11 0.914 -20.87446 23.29902 + 10 | -1.387588 17.72476 -0.08 0.938 -36.12749 33.35231 + 11 | -.0536019 9.395798 -0.01 0.995 -18.46903 18.36182 + 12 | -.4624533 14.94769 -0.03 0.975 -29.75939 28.83448 + 13 | 3.94665 51.81453 0.08 0.939 -97.60796 105.5013 + 14 | -4.858832 63.41805 -0.08 0.939 -129.1559 119.4383 + | + _k_eq_m10 | .7586516 5.359799 0.14 0.887 -9.74636 11.26366 + _k_eq_m9 | 2.464847 30.11053 0.08 0.935 -56.5507 61.48039 + _k_eq_m8 | -4.159833 53.87442 -0.08 0.938 -109.7518 101.4321 + _k_eq_m7 | -1.975913 26.34342 -0.08 0.940 -53.60806 49.65623 + _k_eq_m6 | 2.654183 33.38124 0.08 0.937 -62.77184 68.08021 + _k_eq_m5 | 1.308718 14.14578 0.09 0.926 -26.4165 29.03393 + _k_eq_m4 | .902528 10.45473 0.09 0.931 -19.58837 21.39342 + _k_eq_m3 | .6764115 8.549338 0.08 0.937 -16.07998 17.43281 + _k_eq_p0 | .8228739 1.574053 0.52 0.601 -2.262214 3.907962 + _k_eq_p1 | .2921468 7.439311 0.04 0.969 -14.28864 14.87293 + _k_eq_p2 | .0449962 10.86288 0.00 0.997 -21.24586 21.33585 + _k_eq_p3 | 1.6397 16.94007 0.10 0.923 -31.56223 34.84163 + _k_eq_p4 | .3549602 6.55609 0.05 0.957 -12.49474 13.20466 + _k_eq_p5 | -1.55129 30.47876 -0.05 0.959 -61.28856 58.18598 + _k_eq_p6 | 1.11005 5.659892 0.20 0.845 -9.983135 12.20323 + _k_eq_p7 | -1.157127 22.94758 -0.05 0.960 -46.13355 43.8193 + _k_eq_p8 | 1.603007 21.46289 0.07 0.940 -40.46348 43.66949 + _k_eq_p9 | 0 (omitted) + | + t | + 6 | .1551033 1.388419 0.11 0.911 -2.566147 2.876354 + 7 | -.0937167 5.695068 -0.02 0.987 -11.25584 11.06841 + 8 | .2488547 4.826597 0.05 0.959 -9.211101 9.708811 + 9 | .8118331 .9452537 0.86 0.390 -1.04083 2.664496 + 10 | .7711543 5.871936 0.13 0.896 -10.73763 12.27994 + 11 | 1.786258 7.521736 0.24 0.812 -12.95607 16.52859 + 12 | 1.537305 4.132283 0.37 0.710 -6.561822 9.636431 + 13 | 1.758322 3.139918 0.56 0.575 -4.395803 7.912448 + 14 | 1.815617 .7492184 2.42 0.015 .3471762 3.284058 + | + _cons | .4368654 9.93247 0.04 0.965 -19.03042 19.90415 +-------------+---------------------------------------------------------------- + sigma_u | 1.8056404 + sigma_e | 4.8296807 + rho | .12263291 (fraction of variance due to u_i) +------------------------------------------------------------------------------ + F test that all u_i=0: F(181,1595) = 0.53 Prob > F = 1.0000 +------------------------------------------------------------------------------ +Endogenous: x +Exogenous: eta 1.pois 2.pois 3.pois 4.pois 5.pois 6.pois 7.pois 8.pois 9.pois + 10.pois 11.pois 12.pois 13.pois 14.pois _k_eq_m10 _k_eq_m9 + _k_eq_m8 _k_eq_m7 _k_eq_m6 _k_eq_m5 _k_eq_m4 _k_eq_m3 _k_eq_p0 + _k_eq_p1 _k_eq_p2 _k_eq_p3 _k_eq_p4 _k_eq_p5 _k_eq_p6 _k_eq_p7 + _k_eq_p8 _k_eq_p9 6.t 7.t 8.t 9.t 10.t 11.t 12.t 13.t 14.t + _fd1__00000M + +. * marksample (the marker for non-missing observations in varlist) doesn't interfer with mark (the marker for +> if & in conditions) +. xtevent y eta i.pois if i<40, panelvar(i) timevar(t) pol(z) window(max) impute(stag) // window=(-8, 7) and en +> dpoints={-9, 8} + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(max) is (-8,7), plus the endpoints -9 and 8. + +Linear regression, absorbing indicators Number of obs = 429 +Absorbed variable: i No. of categories = 39 + F(42, 348) = 9.00 + Prob > F = 0.0000 + R-squared = 0.7606 + Adj R-squared = 0.7056 + Root MSE = 0.9866 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m9 | -1.222397 1.138256 -1.07 0.284 -3.461123 1.016329 + _k_eq_m8 | -.6331533 1.143791 -0.55 0.580 -2.882766 1.616459 + _k_eq_m7 | -.4952045 1.153547 -0.43 0.668 -2.764006 1.773597 + _k_eq_m6 | .3738969 .6205139 0.60 0.547 -.8465325 1.594326 + _k_eq_m5 | .921998 .5685037 1.62 0.106 -.1961376 2.040134 + _k_eq_m4 | -.2756116 .557148 -0.49 0.621 -1.371413 .8201895 + _k_eq_m3 | -.4222255 .5267885 -0.80 0.423 -1.458315 .6138643 + _k_eq_m2 | -.754051 .4872485 -1.55 0.123 -1.712374 .2042714 + _k_eq_p0 | -.0393866 .4852337 -0.08 0.935 -.9937463 .9149732 + _k_eq_p1 | .6400723 .492907 1.30 0.195 -.3293793 1.609524 + _k_eq_p2 | .5818783 .4985484 1.17 0.244 -.3986688 1.562425 + _k_eq_p3 | .483556 .5059174 0.96 0.340 -.5114844 1.478596 + _k_eq_p4 | -.1156092 .5098069 -0.23 0.821 -1.1183 .8870812 + _k_eq_p5 | .1544659 .6404149 0.24 0.810 -1.105105 1.414037 + _k_eq_p6 | -.4923737 .7170311 -0.69 0.493 -1.902634 .9178861 + _k_eq_p7 | .8812236 .7142465 1.23 0.218 -.5235594 2.286007 + _k_eq_p8 | 1.735649 .8410862 2.06 0.040 .0813968 3.3899 + eta | .3872569 .0406274 9.53 0.000 .3073508 .4671631 + | + pois | + 1 | 1.024121 .8574382 1.19 0.233 -.6622921 2.710534 + 2 | 1.319408 .8010411 1.65 0.100 -.2560828 2.894899 + 3 | 1.346094 .7942247 1.69 0.091 -.2159901 2.908179 + 4 | 1.447297 .7932799 1.82 0.069 -.1129297 3.007523 + 5 | 1.288476 .7968269 1.62 0.107 -.2787262 2.855679 + 6 | 1.264799 .7988273 1.58 0.114 -.3063376 2.835936 + 7 | 1.676784 .8006013 2.09 0.037 .1021578 3.25141 + 8 | 1.718794 .8082658 2.13 0.034 .1290939 3.308495 + 9 | 1.098337 .8231514 1.33 0.183 -.5206405 2.717315 + 10 | .6605712 .8922671 0.74 0.460 -1.094343 2.415486 + 11 | 1.700229 1.009526 1.68 0.093 -.2853106 3.685769 + 12 | 1.67044 1.084571 1.54 0.124 -.4626987 3.803579 + 13 | 1.460362 1.057345 1.38 0.168 -.6192292 3.539953 + 14 | .9844408 1.082839 0.91 0.364 -1.145292 3.114174 + | + t | + 6 | .0892708 .2401444 0.37 0.710 -.3830462 .5615878 + 7 | .6729647 .2410624 2.79 0.006 .1988422 1.147087 + 8 | .6340544 .2364463 2.68 0.008 .1690107 1.099098 + 9 | .6553416 .2384376 2.75 0.006 .1863816 1.124302 + 10 | .8761683 .2419156 3.62 0.000 .4003676 1.351969 + 11 | 1.45511 .2419333 6.01 0.000 .9792746 1.930946 + 12 | 1.23137 .2466675 4.99 0.000 .7462228 1.716516 + 13 | 1.646094 .2467133 6.67 0.000 1.160857 2.13133 + 14 | 1.746896 .2497967 6.99 0.000 1.255594 2.238197 + 15 | 2.007687 .2522312 7.96 0.000 1.511597 2.503776 + | + _cons | .2436804 1.190173 0.20 0.838 -2.097157 2.584517 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(38, 348) = 12.098 Prob > F = 0.000 + +. +. +. ****************** interaction with other options ************************************** +. +. * coefficient to normalize is outside the calculated window +. use example31, clear + +. replace z= 0 if t==20 & inlist(i, 54, 187, 240, 312, 315, 357, 446, 479, 487, 635, 687, 709, 748, 751, 887, 9 +> 23, 943) // to overcome the problem with left window being positive or right window being negative +(17 real changes made) + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(balanced) norm(2) + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(balanced) is (-1,0), plus the endpoints -2 and 1. + +The coefficient to be normalized to 0 is outside of the estimation window. + +. +. *trend +. use example31, clear + +. xtevent y eta , panelvar(i) timevar(t) policyvar(z) trend(-10, method(ols)) impute(stag) window(max) + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(max) is (-18,16), plus the endpoints -19 and 17. + +Linear regression, absorbing indicators Number of obs = 20,000 +Absorbed variable: i No. of categories = 1,000 + F(48, 18952) = 818.80 + Prob > F = 0.0000 + R-squared = 0.8021 + Adj R-squared = 0.7912 + Root MSE = 1.0023 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m19 | .548126 .2582617 2.12 0.034 .04191 1.054342 + _k_eq_m18 | -.1823543 .2199888 -0.83 0.407 -.6135519 .2488433 + _k_eq_m17 | .116006 .1779868 0.65 0.515 -.232864 .4648761 + _k_eq_m16 | .02314 .1512703 0.15 0.878 -.2733633 .3196434 + _k_eq_m15 | -.0145661 .1370347 -0.11 0.915 -.2831665 .2540342 + _k_eq_m14 | -.1275672 .1239018 -1.03 0.303 -.3704259 .1152914 + _k_eq_m13 | -.2106697 .1115905 -1.89 0.059 -.429397 .0080577 + _k_eq_m12 | .1503794 .1008192 1.49 0.136 -.0472352 .3479939 + _k_eq_m11 | .0306668 .0926769 0.33 0.741 -.1509883 .2123219 + _k_eq_p0 | .9383843 .0699563 13.41 0.000 .8012637 1.075505 + _k_eq_p1 | .8586935 .0749081 11.46 0.000 .7118669 1.00552 + _k_eq_p2 | .945044 .0798445 11.84 0.000 .7885418 1.101546 + _k_eq_p3 | .9295944 .0856996 10.85 0.000 .7616155 1.097573 + _k_eq_p4 | .8898376 .0921219 9.66 0.000 .7092705 1.070405 + _k_eq_p5 | 1.036329 .098366 10.54 0.000 .843523 1.229135 + _k_eq_p6 | .8784859 .1051613 8.35 0.000 .6723604 1.084611 + _k_eq_p7 | .9030573 .112684 8.01 0.000 .6821867 1.123928 + _k_eq_p8 | .845658 .1208783 7.00 0.000 .6087259 1.08259 + _k_eq_p9 | .8984143 .129143 6.96 0.000 .6452826 1.151546 + _k_eq_p10 | .9684237 .1387213 6.98 0.000 .6965176 1.24033 + _k_eq_p11 | .8313483 .1494681 5.56 0.000 .5383775 1.124319 + _k_eq_p12 | 1.011724 .1613005 6.27 0.000 .6955608 1.327887 + _k_eq_p13 | .6484168 .1813493 3.58 0.000 .2929559 1.003878 + _k_eq_p14 | .9686662 .2035933 4.76 0.000 .5696052 1.367727 + _k_eq_p15 | .6305438 .2480196 2.54 0.011 .1444033 1.116684 + _k_eq_p16 | .5342442 .3338718 1.60 0.110 -.1201742 1.188663 + _k_eq_p17 | 1.370638 .5972577 2.29 0.022 .1999602 2.541317 + eta | .2512007 .0047291 53.12 0.000 .2419313 .2604701 + | + t | + 2 | .1432424 .0450809 3.18 0.001 .0548799 .231605 + 3 | .3316559 .0451517 7.35 0.000 .2431545 .4201572 + 4 | .5521498 .0452823 12.19 0.000 .4633924 .6409072 + 5 | .7730363 .0454418 17.01 0.000 .6839664 .8621062 + 6 | .9501268 .0455864 20.84 0.000 .8607735 1.03948 + 7 | 1.115999 .0457295 24.40 0.000 1.026365 1.205633 + 8 | 1.393598 .0458921 30.37 0.000 1.303646 1.483551 + 9 | 1.572721 .0460748 34.13 0.000 1.48241 1.663032 + 10 | 1.802743 .0462321 38.99 0.000 1.712124 1.893363 + 11 | 1.94845 .0464393 41.96 0.000 1.857425 2.039475 + 12 | 2.122523 .046645 45.50 0.000 2.031095 2.213952 + 13 | 2.361975 .0468817 50.38 0.000 2.270083 2.453867 + 14 | 2.512226 .0470748 53.37 0.000 2.419955 2.604497 + 15 | 2.746855 .0472425 58.14 0.000 2.654255 2.839454 + 16 | 2.967035 .0475088 62.45 0.000 2.873913 3.060156 + 17 | 3.172729 .047698 66.52 0.000 3.079237 3.266221 + 18 | 3.334493 .0479107 69.60 0.000 3.240584 3.428402 + 19 | 3.541588 .0481646 73.53 0.000 3.447181 3.635995 + 20 | 3.741856 .0486048 76.99 0.000 3.646586 3.837126 + | + _ttrend | .0049603 .0075998 0.65 0.514 -.009936 .0198566 + _cons | -.0992227 .1885849 -0.53 0.599 -.4688658 .2704205 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(999, 18952) = 21.592 Prob > F = 0.000 + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) trend(-20, method(gmm)) impute(stag) window(max) + +No proxy or instruments provided. Implementing OLS estimator + +Trend outside time range. + +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) trend(-15, method(ols)) impute(stag) window(balan +> ced) + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(balanced) is (-1,-1), plus the endpoints -2 and 0. + +Left window can not be positive and right window can not be negative. + +Check for first-treated units and last-treated units. Both types of units might have few common periods around +> treatment time which causes a narrow calculated window. + +. +. +. *** xteventplot overlay +. use example31, clear + +. *static +. xtevent y eta , panelvar(i) timevar(t) policyvar(z) impute(stag) window(max) + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(max) is (-18,16), plus the endpoints -19 and 17. + +Linear regression, absorbing indicators Number of obs = 20,000 +Absorbed variable: i No. of categories = 1,000 + F(56, 18944) = 702.23 + Prob > F = 0.0000 + R-squared = 0.8023 + Adj R-squared = 0.7913 + Root MSE = 1.0022 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m19 | .6423926 .2608484 2.46 0.014 .1311064 1.153679 + _k_eq_m18 | -.1775268 .2104908 -0.84 0.399 -.5901075 .2350538 + _k_eq_m17 | .1263326 .1698441 0.74 0.457 -.206577 .4592422 + _k_eq_m16 | .0380571 .1450188 0.26 0.793 -.2461928 .3223069 + _k_eq_m15 | .005294 .1337594 0.04 0.968 -.2568864 .2674743 + _k_eq_m14 | -.1028837 .1236077 -0.83 0.405 -.3451658 .1393984 + _k_eq_m13 | -.1811439 .1143673 -1.58 0.113 -.405314 .0430262 + _k_eq_m12 | .1848555 .1070519 1.73 0.084 -.0249757 .3946868 + _k_eq_m11 | .0700347 .1022051 0.69 0.493 -.1302964 .2703658 + _k_eq_m10 | .1192835 .0973245 1.23 0.220 -.0714811 .3100481 + _k_eq_m9 | -.1123919 .0934684 -1.20 0.229 -.2955984 .0708146 + _k_eq_m8 | -.0008947 .0905761 -0.01 0.992 -.1784318 .1766425 + _k_eq_m7 | .0825609 .0871064 0.95 0.343 -.0881755 .2532973 + _k_eq_m6 | .1123127 .0850227 1.32 0.187 -.0543394 .2789648 + _k_eq_m5 | .1134179 .082994 1.37 0.172 -.0492577 .2760935 + _k_eq_m4 | .1225368 .0815805 1.50 0.133 -.0373683 .2824418 + _k_eq_m3 | .1437796 .0806316 1.78 0.075 -.0142655 .3018246 + _k_eq_m2 | .0626728 .0801585 0.78 0.434 -.094445 .2197905 + _k_eq_p0 | 1.030078 .0803795 12.82 0.000 .872527 1.187629 + _k_eq_p1 | .9553605 .081658 11.70 0.000 .7953035 1.115418 + _k_eq_p2 | 1.046724 .0825916 12.67 0.000 .8848376 1.208611 + _k_eq_p3 | 1.036179 .084252 12.30 0.000 .8710377 1.20132 + _k_eq_p4 | 1.00154 .0863377 11.60 0.000 .8323109 1.17077 + _k_eq_p5 | 1.153019 .0880671 13.09 0.000 .9803992 1.325638 + _k_eq_p6 | 1.000366 .0902809 11.08 0.000 .8234072 1.177324 + _k_eq_p7 | 1.030018 .0935097 11.02 0.000 .8467308 1.213306 + _k_eq_p8 | .97777 .0975634 10.02 0.000 .7865371 1.169003 + _k_eq_p9 | 1.035819 .1016011 10.19 0.000 .8366717 1.234966 + _k_eq_p10 | 1.111073 .1076606 10.32 0.000 .9000485 1.322097 + _k_eq_p11 | .9799806 .1153 8.50 0.000 .7539823 1.205979 + _k_eq_p12 | 1.16532 .1240796 9.39 0.000 .9221132 1.408527 + _k_eq_p13 | .8056877 .143361 5.62 0.000 .5246875 1.086688 + _k_eq_p14 | 1.129944 .1649623 6.85 0.000 .8066028 1.453284 + _k_eq_p15 | .7956263 .2124408 3.75 0.000 .3792235 1.212029 + _k_eq_p16 | .7021863 .3051937 2.30 0.021 .1039793 1.300393 + _k_eq_p17 | 1.457152 .5985379 2.43 0.015 .2839648 2.63034 + eta | .2519384 .0047391 53.16 0.000 .2426494 .2612275 + | + t | + 2 | .1434719 .0450851 3.18 0.001 .0551011 .2318427 + 3 | .3312757 .0451509 7.34 0.000 .2427759 .4197754 + 4 | .5528668 .0452825 12.21 0.000 .464109 .6416247 + 5 | .7741836 .0454452 17.04 0.000 .6851069 .8632602 + 6 | .9513304 .0455863 20.87 0.000 .8619772 1.040684 + 7 | 1.116552 .0457312 24.42 0.000 1.026915 1.206189 + 8 | 1.394627 .0458923 30.39 0.000 1.304674 1.48458 + 9 | 1.574857 .0460787 34.18 0.000 1.484539 1.665176 + 10 | 1.803088 .0462321 39.00 0.000 1.712469 1.893707 + 11 | 1.950842 .046446 42.00 0.000 1.859804 2.041881 + 12 | 2.123341 .0466535 45.51 0.000 2.031896 2.214786 + 13 | 2.361859 .046878 50.38 0.000 2.269974 2.453744 + 14 | 2.511809 .0470803 53.35 0.000 2.419527 2.604091 + 15 | 2.747289 .0472441 58.15 0.000 2.654686 2.839891 + 16 | 2.968836 .0475149 62.48 0.000 2.875702 3.06197 + 17 | 3.174446 .0477045 66.54 0.000 3.080941 3.267952 + 18 | 3.336821 .0479173 69.64 0.000 3.242898 3.430743 + 19 | 3.544168 .0481713 73.57 0.000 3.449748 3.638588 + 20 | 3.743031 .0486024 77.01 0.000 3.647766 3.838296 + | + _cons | -.1941443 .1921508 -1.01 0.312 -.570777 .1824883 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(999, 18944) = 21.600 Prob > F = 0.000 + +. xteventplot, overlay(static) +Estimating static model... + +option static specified. Estimating static model + +Plotting options ignored + +No proxy or instruments provided. Implementing OLS estimator + +Linear regression, absorbing indicators Number of obs = 20,000 +Absorbed variable: i No. of categories = 1,000 + F(21, 18979) = 1869.16 + Prob > F = 0.0000 + R-squared = 0.8018 + Adj R-squared = 0.7911 + Root MSE = 1.0025 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + eta | .2528727 .0044686 56.59 0.000 .2441138 .2616316 + z_imputed | .9518764 .0368223 25.85 0.000 .8797014 1.024051 + | + t | + 2 | .1326704 .0448349 2.96 0.003 .0447899 .2205509 + 3 | .3256093 .0448351 7.26 0.000 .2377285 .41349 + 4 | .5442275 .044839 12.14 0.000 .4563391 .6321159 + 5 | .7678758 .0448489 17.12 0.000 .6799679 .8557837 + 6 | .9464576 .0448748 21.09 0.000 .8584991 1.034416 + 7 | 1.112496 .0449025 24.78 0.000 1.024483 1.200509 + 8 | 1.395807 .0449657 31.04 0.000 1.30767 1.483944 + 9 | 1.573173 .0450221 34.94 0.000 1.484926 1.66142 + 10 | 1.804388 .0450915 40.02 0.000 1.716005 1.892772 + 11 | 1.950891 .0451963 43.16 0.000 1.862303 2.03948 + 12 | 2.124391 .0452897 46.91 0.000 2.035619 2.213163 + 13 | 2.366152 .0454285 52.09 0.000 2.277108 2.455196 + 14 | 2.514806 .0455442 55.22 0.000 2.425535 2.604077 + 15 | 2.750965 .0456284 60.29 0.000 2.66153 2.840401 + 16 | 2.971668 .0457485 64.96 0.000 2.881997 3.061339 + 17 | 3.176473 .0458717 69.25 0.000 3.08656 3.266386 + 18 | 3.338556 .0459847 72.60 0.000 3.248422 3.42869 + 19 | 3.540866 .0460498 76.89 0.000 3.450604 3.631127 + 20 | 3.742714 .0462185 80.98 0.000 3.652122 3.833307 + | + _cons | .2687477 .0317031 8.48 0.000 .2066069 .3308886 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(999, 18979) = 21.616 Prob > F = 0.000 + +. *trend +. xtevent y eta , panelvar(i) timevar(t) policyvar(z) trend(-10, method(ols) saveoverlay) impute(stag) window(m +> ax) + +No proxy or instruments provided. Implementing OLS estimator +The calculated window by window(max) is (-18,16), plus the endpoints -19 and 17. + +Linear regression, absorbing indicators Number of obs = 20,000 +Absorbed variable: i No. of categories = 1,000 + F(48, 18952) = 818.80 + Prob > F = 0.0000 + R-squared = 0.8021 + Adj R-squared = 0.7912 + Root MSE = 1.0023 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m19 | .548126 .2582617 2.12 0.034 .04191 1.054342 + _k_eq_m18 | -.1823543 .2199888 -0.83 0.407 -.6135519 .2488433 + _k_eq_m17 | .116006 .1779868 0.65 0.515 -.232864 .4648761 + _k_eq_m16 | .02314 .1512703 0.15 0.878 -.2733633 .3196434 + _k_eq_m15 | -.0145661 .1370347 -0.11 0.915 -.2831665 .2540342 + _k_eq_m14 | -.1275672 .1239018 -1.03 0.303 -.3704259 .1152914 + _k_eq_m13 | -.2106697 .1115905 -1.89 0.059 -.429397 .0080577 + _k_eq_m12 | .1503794 .1008192 1.49 0.136 -.0472352 .3479939 + _k_eq_m11 | .0306668 .0926769 0.33 0.741 -.1509883 .2123219 + _k_eq_p0 | .9383843 .0699563 13.41 0.000 .8012637 1.075505 + _k_eq_p1 | .8586935 .0749081 11.46 0.000 .7118669 1.00552 + _k_eq_p2 | .945044 .0798445 11.84 0.000 .7885418 1.101546 + _k_eq_p3 | .9295944 .0856996 10.85 0.000 .7616155 1.097573 + _k_eq_p4 | .8898376 .0921219 9.66 0.000 .7092705 1.070405 + _k_eq_p5 | 1.036329 .098366 10.54 0.000 .843523 1.229135 + _k_eq_p6 | .8784859 .1051613 8.35 0.000 .6723604 1.084611 + _k_eq_p7 | .9030573 .112684 8.01 0.000 .6821867 1.123928 + _k_eq_p8 | .845658 .1208783 7.00 0.000 .6087259 1.08259 + _k_eq_p9 | .8984143 .129143 6.96 0.000 .6452826 1.151546 + _k_eq_p10 | .9684237 .1387213 6.98 0.000 .6965176 1.24033 + _k_eq_p11 | .8313483 .1494681 5.56 0.000 .5383775 1.124319 + _k_eq_p12 | 1.011724 .1613005 6.27 0.000 .6955608 1.327887 + _k_eq_p13 | .6484168 .1813493 3.58 0.000 .2929559 1.003878 + _k_eq_p14 | .9686662 .2035933 4.76 0.000 .5696052 1.367727 + _k_eq_p15 | .6305438 .2480196 2.54 0.011 .1444033 1.116684 + _k_eq_p16 | .5342442 .3338718 1.60 0.110 -.1201742 1.188663 + _k_eq_p17 | 1.370638 .5972577 2.29 0.022 .1999602 2.541317 + eta | .2512007 .0047291 53.12 0.000 .2419313 .2604701 + | + t | + 2 | .1432424 .0450809 3.18 0.001 .0548799 .231605 + 3 | .3316559 .0451517 7.35 0.000 .2431545 .4201572 + 4 | .5521498 .0452823 12.19 0.000 .4633924 .6409072 + 5 | .7730363 .0454418 17.01 0.000 .6839664 .8621062 + 6 | .9501268 .0455864 20.84 0.000 .8607735 1.03948 + 7 | 1.115999 .0457295 24.40 0.000 1.026365 1.205633 + 8 | 1.393598 .0458921 30.37 0.000 1.303646 1.483551 + 9 | 1.572721 .0460748 34.13 0.000 1.48241 1.663032 + 10 | 1.802743 .0462321 38.99 0.000 1.712124 1.893363 + 11 | 1.94845 .0464393 41.96 0.000 1.857425 2.039475 + 12 | 2.122523 .046645 45.50 0.000 2.031095 2.213952 + 13 | 2.361975 .0468817 50.38 0.000 2.270083 2.453867 + 14 | 2.512226 .0470748 53.37 0.000 2.419955 2.604497 + 15 | 2.746855 .0472425 58.14 0.000 2.654255 2.839454 + 16 | 2.967035 .0475088 62.45 0.000 2.873913 3.060156 + 17 | 3.172729 .047698 66.52 0.000 3.079237 3.266221 + 18 | 3.334493 .0479107 69.60 0.000 3.240584 3.428402 + 19 | 3.541588 .0481646 73.53 0.000 3.447181 3.635995 + 20 | 3.741856 .0486048 76.99 0.000 3.646586 3.837126 + | + _ttrend | .0049603 .0075998 0.65 0.514 -.009936 .0198566 + _cons | -.0992227 .1885849 -0.53 0.599 -.4688658 .2704205 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(999, 18952) = 21.592 Prob > F = 0.000 + +. xteventplot, overlay(trend) + +. +. *************** Examples to check that implementation doesn't alter other functionalities ****************** +> ****** +. +. * window +. use example31, clear + +. xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(3) + +No proxy or instruments provided. Implementing OLS estimator + +Linear regression, absorbing indicators Number of obs = 13,000 +Absorbed variable: i No. of categories = 1,000 + F(21, 11979) = 572.74 + Prob > F = 0.0000 + R-squared = 0.7653 + Adj R-squared = 0.7453 + Root MSE = 1.0058 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m4 | .1354244 .0756957 1.79 0.074 -.0129515 .2838003 + _k_eq_m3 | .1927795 .0902369 2.14 0.033 .0159005 .3696585 + _k_eq_m2 | .1540638 .0894043 1.72 0.085 -.0211831 .3293106 + _k_eq_p0 | 1.068977 .0892098 11.98 0.000 .8941116 1.243843 + _k_eq_p1 | 1.006862 .0907016 11.10 0.000 .8290722 1.184652 + _k_eq_p2 | 1.062882 .0922647 11.52 0.000 .8820284 1.243736 + _k_eq_p3 | 1.031628 .0947797 10.88 0.000 .8458445 1.217412 + _k_eq_p4 | 1.056418 .0782796 13.50 0.000 .9029772 1.209858 + eta | .2593535 .0068421 37.91 0.000 .2459418 .2727651 + | + t | + 6 | .1795681 .0450092 3.99 0.000 .0913429 .2677934 + 7 | .347742 .0450596 7.72 0.000 .2594178 .4360661 + 8 | .630268 .0451644 13.95 0.000 .5417385 .7187975 + 9 | .8095375 .0453086 17.87 0.000 .7207253 .8983497 + 10 | 1.040501 .0454959 22.87 0.000 .9513215 1.12968 + 11 | 1.187814 .0457683 25.95 0.000 1.098101 1.277527 + 12 | 1.362563 .0460682 29.58 0.000 1.272262 1.452864 + 13 | 1.605032 .0464086 34.58 0.000 1.514063 1.696 + 14 | 1.75353 .0467701 37.49 0.000 1.661854 1.845207 + 15 | 1.989215 .0471243 42.21 0.000 1.896844 2.081587 + 16 | 2.211903 .0475437 46.52 0.000 2.11871 2.305097 + 17 | 2.415992 .0479468 50.39 0.000 2.322008 2.509975 + | + _cons | .9034138 .0791741 11.41 0.000 .7482197 1.058608 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(999, 11979) = 14.229 Prob > F = 0.000 + +. xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(-3 5) + +No proxy or instruments provided. Implementing OLS estimator + +Linear regression, absorbing indicators Number of obs = 11,000 +Absorbed variable: i No. of categories = 1,000 + F(21, 9979) = 362.27 + Prob > F = 0.0000 + R-squared = 0.7677 + Adj R-squared = 0.7439 + Root MSE = 0.9993 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m4 | .1634581 .085013 1.92 0.055 -.0031846 .3301008 + _k_eq_m3 | .2175758 .0989277 2.20 0.028 .0236576 .411494 + _k_eq_m2 | .1505355 .0974979 1.54 0.123 -.04058 .341651 + _k_eq_p0 | 1.054959 .0957811 11.01 0.000 .8672088 1.242709 + _k_eq_p1 | .979135 .0967646 10.12 0.000 .7894569 1.168813 + _k_eq_p2 | 1.052212 .0979097 10.75 0.000 .8602893 1.244135 + _k_eq_p3 | 1.052049 .1001598 10.50 0.000 .8557159 1.248383 + _k_eq_p4 | 1.022533 .1038096 9.85 0.000 .8190456 1.226021 + _k_eq_p5 | 1.180834 .1087591 10.86 0.000 .9676444 1.394024 + _k_eq_p6 | 1.090549 .0957034 11.40 0.000 .9029514 1.278147 + eta | .2591088 .0079103 32.76 0.000 .2436029 .2746147 + | + t | + 8 | .28304 .0447331 6.33 0.000 .195354 .370726 + 9 | .4622753 .044829 10.31 0.000 .3744015 .5501491 + 10 | .6929961 .0450073 15.40 0.000 .6047727 .7812195 + 11 | .8394604 .0452951 18.53 0.000 .7506728 .928248 + 12 | 1.014871 .0456399 22.24 0.000 .9254072 1.104334 + 13 | 1.255516 .0460767 27.25 0.000 1.165196 1.345836 + 14 | 1.404711 .0465826 30.16 0.000 1.313399 1.496022 + 15 | 1.640011 .0470833 34.83 0.000 1.547718 1.732303 + 16 | 1.861862 .0476958 39.04 0.000 1.768369 1.955356 + 17 | 2.066092 .0483136 42.76 0.000 1.971388 2.160796 + | + _cons | 1.227235 .0852159 14.40 0.000 1.060195 1.394276 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(999, 9979) = 12.364 Prob > F = 0.000 + +. *impute +. cap noi xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(-18 16) // need to add impute() + +No proxy or instruments provided. Implementing OLS estimator +no observations + +. xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(-18 16) impute(nuchange) + +No proxy or instruments provided. Implementing OLS estimator + +Linear regression, absorbing indicators Number of obs = 20,000 +Absorbed variable: i No. of categories = 1,000 + F(56, 18944) = 702.23 + Prob > F = 0.0000 + R-squared = 0.8023 + Adj R-squared = 0.7913 + Root MSE = 1.0022 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m19 | .6423926 .2608484 2.46 0.014 .1311064 1.153679 + _k_eq_m18 | -.1775268 .2104908 -0.84 0.399 -.5901075 .2350538 + _k_eq_m17 | .1263326 .1698441 0.74 0.457 -.206577 .4592422 + _k_eq_m16 | .0380571 .1450188 0.26 0.793 -.2461928 .3223069 + _k_eq_m15 | .005294 .1337594 0.04 0.968 -.2568864 .2674743 + _k_eq_m14 | -.1028837 .1236077 -0.83 0.405 -.3451658 .1393984 + _k_eq_m13 | -.1811439 .1143673 -1.58 0.113 -.405314 .0430262 + _k_eq_m12 | .1848555 .1070519 1.73 0.084 -.0249757 .3946868 + _k_eq_m11 | .0700347 .1022051 0.69 0.493 -.1302964 .2703658 + _k_eq_m10 | .1192835 .0973245 1.23 0.220 -.0714811 .3100481 + _k_eq_m9 | -.1123919 .0934684 -1.20 0.229 -.2955984 .0708146 + _k_eq_m8 | -.0008947 .0905761 -0.01 0.992 -.1784318 .1766425 + _k_eq_m7 | .0825609 .0871064 0.95 0.343 -.0881755 .2532973 + _k_eq_m6 | .1123127 .0850227 1.32 0.187 -.0543394 .2789648 + _k_eq_m5 | .1134179 .082994 1.37 0.172 -.0492577 .2760935 + _k_eq_m4 | .1225368 .0815805 1.50 0.133 -.0373683 .2824418 + _k_eq_m3 | .1437796 .0806316 1.78 0.075 -.0142655 .3018246 + _k_eq_m2 | .0626728 .0801585 0.78 0.434 -.094445 .2197905 + _k_eq_p0 | 1.030078 .0803795 12.82 0.000 .872527 1.187629 + _k_eq_p1 | .9553605 .081658 11.70 0.000 .7953035 1.115418 + _k_eq_p2 | 1.046724 .0825916 12.67 0.000 .8848376 1.208611 + _k_eq_p3 | 1.036179 .084252 12.30 0.000 .8710377 1.20132 + _k_eq_p4 | 1.00154 .0863377 11.60 0.000 .8323109 1.17077 + _k_eq_p5 | 1.153019 .0880671 13.09 0.000 .9803992 1.325638 + _k_eq_p6 | 1.000366 .0902809 11.08 0.000 .8234072 1.177324 + _k_eq_p7 | 1.030018 .0935097 11.02 0.000 .8467308 1.213306 + _k_eq_p8 | .97777 .0975634 10.02 0.000 .7865371 1.169003 + _k_eq_p9 | 1.035819 .1016011 10.19 0.000 .8366717 1.234966 + _k_eq_p10 | 1.111073 .1076606 10.32 0.000 .9000485 1.322097 + _k_eq_p11 | .9799806 .1153 8.50 0.000 .7539823 1.205979 + _k_eq_p12 | 1.16532 .1240796 9.39 0.000 .9221132 1.408527 + _k_eq_p13 | .8056877 .143361 5.62 0.000 .5246875 1.086688 + _k_eq_p14 | 1.129944 .1649623 6.85 0.000 .8066028 1.453284 + _k_eq_p15 | .7956263 .2124408 3.75 0.000 .3792235 1.212029 + _k_eq_p16 | .7021863 .3051937 2.30 0.021 .1039793 1.300393 + _k_eq_p17 | 1.457152 .5985379 2.43 0.015 .2839648 2.63034 + eta | .2519384 .0047391 53.16 0.000 .2426494 .2612275 + | + t | + 2 | .1434719 .0450851 3.18 0.001 .0551011 .2318427 + 3 | .3312757 .0451509 7.34 0.000 .2427759 .4197754 + 4 | .5528668 .0452825 12.21 0.000 .464109 .6416247 + 5 | .7741836 .0454452 17.04 0.000 .6851069 .8632602 + 6 | .9513304 .0455863 20.87 0.000 .8619772 1.040684 + 7 | 1.116552 .0457312 24.42 0.000 1.026915 1.206189 + 8 | 1.394627 .0458923 30.39 0.000 1.304674 1.48458 + 9 | 1.574857 .0460787 34.18 0.000 1.484539 1.665176 + 10 | 1.803088 .0462321 39.00 0.000 1.712469 1.893707 + 11 | 1.950842 .046446 42.00 0.000 1.859804 2.041881 + 12 | 2.123341 .0466535 45.51 0.000 2.031896 2.214786 + 13 | 2.361859 .046878 50.38 0.000 2.269974 2.453744 + 14 | 2.511809 .0470803 53.35 0.000 2.419527 2.604091 + 15 | 2.747289 .0472441 58.15 0.000 2.654686 2.839891 + 16 | 2.968836 .0475149 62.48 0.000 2.875702 3.06197 + 17 | 3.174446 .0477045 66.54 0.000 3.080941 3.267952 + 18 | 3.336821 .0479173 69.64 0.000 3.242898 3.430743 + 19 | 3.544168 .0481713 73.57 0.000 3.449748 3.638588 + 20 | 3.743031 .0486024 77.01 0.000 3.647766 3.838296 + | + _cons | -.1941443 .1921508 -1.01 0.312 -.570777 .1824883 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(999, 18944) = 21.600 Prob > F = 0.000 + +. * trend adjustment +. xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(-18 16) impute(nuchange) trend(-3) + +No proxy or instruments provided. Implementing OLS estimator + +Linear regression, absorbing indicators Number of obs = 20,000 +Absorbed variable: i No. of categories = 1,000 + F(56, 18944) = 702.23 + Prob > F = 0.0000 + R-squared = 0.8023 + Adj R-squared = 0.7913 + Root MSE = 1.0022 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m19 | -.6514156 1.877014 -0.35 0.729 -4.330531 3.0277 + _k_eq_m18 | -1.399457 1.577052 -0.89 0.375 -4.490619 1.691706 + _k_eq_m17 | -1.023719 1.661885 -0.62 0.538 -4.281161 2.233723 + _k_eq_m16 | -1.040116 1.557524 -0.67 0.504 -4.093002 2.012769 + _k_eq_m15 | -1.001001 1.453157 -0.69 0.491 -3.849318 1.847315 + _k_eq_m14 | -1.037301 1.348925 -0.77 0.442 -3.681314 1.606712 + _k_eq_m13 | -1.043683 1.244384 -0.84 0.402 -3.482786 1.39542 + _k_eq_m12 | -.605805 1.13976 -0.53 0.595 -2.839837 1.628227 + _k_eq_m11 | -.6487477 1.035296 -0.63 0.531 -2.678021 1.380526 + _k_eq_m10 | -.5276206 .9309507 -0.57 0.571 -2.352367 1.297126 + _k_eq_m9 | -.6874178 .826562 -0.83 0.406 -2.307553 .9327174 + _k_eq_m8 | -.5040423 .7223595 -0.70 0.485 -1.919931 .9118467 + _k_eq_m7 | -.3487085 .6182131 -0.56 0.573 -1.560461 .8630443 + _k_eq_m6 | -.2470785 .5143833 -0.48 0.631 -1.255316 .7611587 + _k_eq_m5 | -.174095 .411156 -0.42 0.672 -.9799975 .6318074 + _k_eq_m4 | -.0930979 .3088876 -0.30 0.763 -.6985452 .5123493 + _k_eq_m3 | .0000231 .2092566 0.00 1.000 -.4101385 .4101847 + _k_eq_m2 | -.0092055 .1188901 -0.08 0.938 -.2422406 .2238297 + _k_eq_p0 | 1.101956 .1432687 7.69 0.000 .8211368 1.382776 + _k_eq_p1 | 1.099117 .2378292 4.62 0.000 .6329505 1.565283 + _k_eq_p2 | 1.262359 .3383262 3.73 0.000 .5992095 1.925509 + _k_eq_p3 | 1.323692 .4410873 3.00 0.003 .4591215 2.188262 + _k_eq_p4 | 1.360932 .5447333 2.50 0.012 .2932057 2.428657 + _k_eq_p5 | 1.584288 .6487774 2.44 0.015 .3126266 2.85595 + _k_eq_p6 | 1.503513 .7531707 2.00 0.046 .0272317 2.979795 + _k_eq_p7 | 1.605044 .8577175 1.87 0.061 -.0761587 3.286247 + _k_eq_p8 | 1.624674 .9624667 1.69 0.091 -.2618466 3.511195 + _k_eq_p9 | 1.754601 1.067378 1.64 0.100 -.3375544 3.846757 + _k_eq_p10 | 1.901733 1.172446 1.62 0.105 -.3963655 4.199832 + _k_eq_p11 | 1.842519 1.277571 1.44 0.149 -.6616332 4.346672 + _k_eq_p12 | 2.099737 1.382973 1.52 0.129 -.6110138 4.810488 + _k_eq_p13 | 1.811983 1.489361 1.22 0.224 -1.107297 4.731263 + _k_eq_p14 | 2.208117 1.596147 1.38 0.167 -.9204731 5.336707 + _k_eq_p15 | 1.945678 1.706152 1.14 0.254 -1.398533 5.289889 + _k_eq_p16 | 1.924116 1.823224 1.06 0.291 -1.649566 5.497798 + _k_eq_p17 | 2.750961 1.994572 1.38 0.168 -1.158579 6.6605 + eta | .2519384 .0047391 53.16 0.000 .2426494 .2612275 + | + t | + 2 | .1434719 .0450851 3.18 0.001 .0551011 .2318427 + 3 | .3312757 .0451509 7.34 0.000 .2427759 .4197754 + 4 | .5528668 .0452825 12.21 0.000 .464109 .6416247 + 5 | .7741836 .0454452 17.04 0.000 .6851069 .8632602 + 6 | .9513304 .0455863 20.87 0.000 .8619772 1.040684 + 7 | 1.116552 .0457312 24.42 0.000 1.026915 1.206189 + 8 | 1.394627 .0458923 30.39 0.000 1.304674 1.48458 + 9 | 1.574857 .0460787 34.18 0.000 1.484539 1.665176 + 10 | 1.803088 .0462321 39.00 0.000 1.712469 1.893707 + 11 | 1.950842 .046446 42.00 0.000 1.859804 2.041881 + 12 | 2.123341 .0466535 45.51 0.000 2.031896 2.214786 + 13 | 2.361859 .046878 50.38 0.000 2.269974 2.453744 + 14 | 2.511809 .0470803 53.35 0.000 2.419527 2.604091 + 15 | 2.747289 .0472441 58.15 0.000 2.654686 2.839891 + 16 | 2.968836 .0475149 62.48 0.000 2.875702 3.06197 + 17 | 3.174446 .0477045 66.54 0.000 3.080941 3.267952 + 18 | 3.336821 .0479173 69.64 0.000 3.242898 3.430743 + 19 | 3.544168 .0481713 73.57 0.000 3.449748 3.638588 + 20 | 3.743031 .0486024 77.01 0.000 3.647766 3.838296 + | + _cons | -.1941443 .1921508 -1.01 0.312 -.570777 .1824883 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(999, 18944) = 21.600 Prob > F = 0.000 + +. xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(-18 16) impute(nuchange) trend(-3, method(gmm)) + +No proxy or instruments provided. Implementing OLS estimator + +Linear regression, absorbing indicators Number of obs = 20,000 +Absorbed variable: i No. of categories = 1,000 + F(56, 18944) = 702.23 + Prob > F = 0.0000 + R-squared = 0.8023 + Adj R-squared = 0.7913 + Root MSE = 1.0022 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. t P>|t| [95% conf. interval] +-------------+---------------------------------------------------------------- + _k_eq_m19 | -.6514156 1.877014 -0.35 0.729 -4.330531 3.0277 + _k_eq_m18 | -1.399457 1.577052 -0.89 0.375 -4.490619 1.691706 + _k_eq_m17 | -1.023719 1.661885 -0.62 0.538 -4.281161 2.233723 + _k_eq_m16 | -1.040116 1.557524 -0.67 0.504 -4.093002 2.012769 + _k_eq_m15 | -1.001001 1.453157 -0.69 0.491 -3.849318 1.847315 + _k_eq_m14 | -1.037301 1.348925 -0.77 0.442 -3.681314 1.606712 + _k_eq_m13 | -1.043683 1.244384 -0.84 0.402 -3.482786 1.39542 + _k_eq_m12 | -.605805 1.13976 -0.53 0.595 -2.839837 1.628227 + _k_eq_m11 | -.6487477 1.035296 -0.63 0.531 -2.678021 1.380526 + _k_eq_m10 | -.5276206 .9309507 -0.57 0.571 -2.352367 1.297126 + _k_eq_m9 | -.6874178 .826562 -0.83 0.406 -2.307553 .9327174 + _k_eq_m8 | -.5040423 .7223595 -0.70 0.485 -1.919931 .9118467 + _k_eq_m7 | -.3487085 .6182131 -0.56 0.573 -1.560461 .8630443 + _k_eq_m6 | -.2470785 .5143833 -0.48 0.631 -1.255316 .7611587 + _k_eq_m5 | -.174095 .411156 -0.42 0.672 -.9799975 .6318074 + _k_eq_m4 | -.0930979 .3088876 -0.30 0.763 -.6985452 .5123493 + _k_eq_m3 | .0000231 .2092566 0.00 1.000 -.4101385 .4101847 + _k_eq_m2 | -.0092055 .1188901 -0.08 0.938 -.2422406 .2238297 + _k_eq_p0 | 1.101956 .1432687 7.69 0.000 .8211368 1.382776 + _k_eq_p1 | 1.099117 .2378292 4.62 0.000 .6329505 1.565283 + _k_eq_p2 | 1.262359 .3383262 3.73 0.000 .5992095 1.925509 + _k_eq_p3 | 1.323692 .4410873 3.00 0.003 .4591215 2.188262 + _k_eq_p4 | 1.360932 .5447333 2.50 0.012 .2932057 2.428657 + _k_eq_p5 | 1.584288 .6487774 2.44 0.015 .3126266 2.85595 + _k_eq_p6 | 1.503513 .7531707 2.00 0.046 .0272317 2.979795 + _k_eq_p7 | 1.605044 .8577175 1.87 0.061 -.0761587 3.286247 + _k_eq_p8 | 1.624674 .9624667 1.69 0.091 -.2618466 3.511195 + _k_eq_p9 | 1.754601 1.067378 1.64 0.100 -.3375544 3.846757 + _k_eq_p10 | 1.901733 1.172446 1.62 0.105 -.3963655 4.199832 + _k_eq_p11 | 1.842519 1.277571 1.44 0.149 -.6616332 4.346672 + _k_eq_p12 | 2.099737 1.382973 1.52 0.129 -.6110138 4.810488 + _k_eq_p13 | 1.811983 1.489361 1.22 0.224 -1.107297 4.731263 + _k_eq_p14 | 2.208117 1.596147 1.38 0.167 -.9204731 5.336707 + _k_eq_p15 | 1.945678 1.706152 1.14 0.254 -1.398533 5.289889 + _k_eq_p16 | 1.924116 1.823224 1.06 0.291 -1.649566 5.497798 + _k_eq_p17 | 2.750961 1.994572 1.38 0.168 -1.158579 6.6605 + eta | .2519384 .0047391 53.16 0.000 .2426494 .2612275 + | + t | + 2 | .1434719 .0450851 3.18 0.001 .0551011 .2318427 + 3 | .3312757 .0451509 7.34 0.000 .2427759 .4197754 + 4 | .5528668 .0452825 12.21 0.000 .464109 .6416247 + 5 | .7741836 .0454452 17.04 0.000 .6851069 .8632602 + 6 | .9513304 .0455863 20.87 0.000 .8619772 1.040684 + 7 | 1.116552 .0457312 24.42 0.000 1.026915 1.206189 + 8 | 1.394627 .0458923 30.39 0.000 1.304674 1.48458 + 9 | 1.574857 .0460787 34.18 0.000 1.484539 1.665176 + 10 | 1.803088 .0462321 39.00 0.000 1.712469 1.893707 + 11 | 1.950842 .046446 42.00 0.000 1.859804 2.041881 + 12 | 2.123341 .0466535 45.51 0.000 2.031896 2.214786 + 13 | 2.361859 .046878 50.38 0.000 2.269974 2.453744 + 14 | 2.511809 .0470803 53.35 0.000 2.419527 2.604091 + 15 | 2.747289 .0472441 58.15 0.000 2.654686 2.839891 + 16 | 2.968836 .0475149 62.48 0.000 2.875702 3.06197 + 17 | 3.174446 .0477045 66.54 0.000 3.080941 3.267952 + 18 | 3.336821 .0479173 69.64 0.000 3.242898 3.430743 + 19 | 3.544168 .0481713 73.57 0.000 3.449748 3.638588 + 20 | 3.743031 .0486024 77.01 0.000 3.647766 3.838296 + | + _cons | -.1941443 .1921508 -1.01 0.312 -.570777 .1824883 +------------------------------------------------------------------------------ +F test of absorbed indicators: F(999, 18944) = 21.600 Prob > F = 0.000 + +. * IV +. xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(6) impute(nuchange) proxy(zeta) + +Proxy for the confound specified. Implementing FHS estimator + +proxyiv=select. Selecting lead order of differenced policy variable to use as instrument. + +Lead 1 selected. + +The corresponding coefficient of lead 1 and the normalized coefficient were the same. Lead 1 has been changed t +> o 2. + +The coefficient at -1 is normalized to zero. + +For estimation with proxy variables, an additional coefficient needs to be normalized to zero. + +The coefficient at -2 was selected to be normalized to zero. + +Fixed-effects (within) IV regression Number of obs = 19,000 +Group variable: i Number of groups = 1,000 + +R-squared: Obs per group: + Within = . min = 19 + Between = 0.1551 avg = 19.0 + Overall = 0.0831 max = 19 + + Wald chi2(33) = 7945.71 +corr(u_i, Xb) = -0.2229 Prob > chi2 = 0.0000 + +------------------------------------------------------------------------------ + y | Coefficient Std. err. z P>|z| [95% conf. interval] +-------------+---------------------------------------------------------------- + zeta | -4.167275 20.4801 -0.20 0.839 -44.30753 35.97298 + eta | 1.168554 4.495844 0.26 0.795 -7.643138 9.980247 + _k_eq_m7 | .8912123 4.422298 0.20 0.840 -7.776333 9.558758 + _k_eq_m6 | .4769751 1.967847 0.24 0.808 -3.379935 4.333885 + _k_eq_m5 | .1394762 .3988766 0.35 0.727 -.6423075 .9212599 + _k_eq_m4 | .0230451 .4394358 0.05 0.958 -.8382332 .8843234 + _k_eq_m3 | -.0141381 .6839534 -0.02 0.984 -1.354662 1.326386 + _k_eq_p0 | 2.272248 6.262197 0.36 0.717 -10.00143 14.54593 + _k_eq_p1 | -3.970184 24.08799 -0.16 0.869 -51.18178 43.24141 + _k_eq_p2 | -3.837054 23.8441 -0.16 0.872 -50.57064 42.89653 + _k_eq_p3 | -4.044908 24.71566 -0.16 0.870 -52.48671 44.39689 + _k_eq_p4 | -4.321646 26.07169 -0.17 0.868 -55.42121 46.77792 + _k_eq_p5 | -4.475384 27.53705 -0.16 0.871 -58.44701 49.49624 + _k_eq_p6 | -5.149429 30.16954 -0.17 0.864 -64.28064 53.98179 + _k_eq_p7 | -5.333658 31.1785 -0.17 0.864 -66.44239 55.77508 + | + t | + 2 | .0642902 .3706927 0.17 0.862 -.6622542 .7908346 + 3 | .2241798 .5154165 0.43 0.664 -.7860179 1.234378 + 4 | .3197718 1.100604 0.29 0.771 -1.837372 2.476915 + 5 | .8040347 .2666273 3.02 0.003 .2814548 1.326615 + 6 | 1.039059 .5079942 2.05 0.041 .0434086 2.034709 + 7 | 1.496685 1.922336 0.78 0.436 -2.271025 5.264394 + 8 | 1.832236 2.187265 0.84 0.402 -2.454725 6.119197 + 9 | 2.106819 2.665329 0.79 0.429 -3.117131 7.330768 + 10 | 2.568523 3.807115 0.67 0.500 -4.893284 10.03033 + 11 | 2.578027 3.140769 0.82 0.412 -3.577767 8.733821 + 12 | 3.017284 4.447032 0.68 0.497 -5.698739 11.73331 + 13 | 3.283242 4.577922 0.72 0.473 -5.68932 12.2558 + 14 | 3.848724 6.625811 0.58 0.561 -9.137627 16.83508 + 15 | 4.310276 7.733711 0.56 0.577 -10.84752 19.46807 + 16 | 4.175555 5.985804 0.70 0.485 -7.556405 15.90752 + 17 | 4.890768 8.493666 0.58 0.565 -11.75651 21.53805 + 18 | 5.083125 8.63933 0.59 0.556 -11.84965 22.0159 + 19 | 5.323401 8.829953 0.60 0.547 -11.98299 22.62979 + | + _cons | -.4663991 3.629229 -0.13 0.898 -7.579556 6.646758 +-------------+---------------------------------------------------------------- + sigma_u | 1.5905591 + sigma_e | 3.931836 + rho | .14063307 (fraction of variance due to u_i) +------------------------------------------------------------------------------ + F test that all u_i=0: F(999,17967) = 1.33 Prob > F = 0.0000 +------------------------------------------------------------------------------ +Endogenous: zeta +Exogenous: eta _k_eq_m7 _k_eq_m6 _k_eq_m5 _k_eq_m4 _k_eq_m3 _k_eq_p0 _k_eq_p1 + _k_eq_p2 _k_eq_p3 _k_eq_p4 _k_eq_p5 _k_eq_p6 _k_eq_p7 2.t 3.t 4.t + 5.t 6.t 7.t 8.t 9.t 10.t 11.t 12.t 13.t 14.t 15.t 16.t 17.t 18.t + 19.t _fd1__00000M + +. +. log close + name: + log: C:\Users\B18945\Downloads\xtevent-170-let-the-window-option-choose-a-window-range\issue170\issue17 +> 0.txt + log type: text + closed on: 3 May 2024, 15:45:15 +---------------------------------------------------------------------------------------------------------------