The updates will not take place until you either restart Stata, or clear all memory. Otherwise, if you can make a reproducible example? I can check why its not working for you
-
Login or Register
- Log in with
local vars "var_1 var_2 var_3" forvalues k = 1(1)2 { foreach v of local vars { jwdid `v', ivar(ID) tvar(YEAR) gvar(treatyear_`k') cluster(cluster) never level(99) estat event estore (jw_`v'_`k') level(99) } }
* Example generated by -dataex-. To install: ssc install dataex clear input double(var_1 var_2 var_3 ID) long YEAR float treatyear_2 byte cluster 4000 87508.742467 19866 2370032007 2004 0 3 4000 87361.863929 17448 2370032007 2005 0 3 4800 89639.394623 21961 2370032007 2006 0 3 4000 112263.38637 17773 2370032007 2007 0 3 4000 106307.30297 5746 2370032007 2008 0 3 4000 90779.428247 4834 2370032007 2009 0 3 4000 100827.5789 4936 2370032007 2010 0 3 4000 128809.85223 5042 2370032007 2011 0 3 4000 117941.40921 6301 2370032007 2012 0 3 4000 146357.55419 4521 2370032007 2013 0 3 4000 144360.90143 2859 2370032007 2014 0 3 4000 134682.75648 4776 2370032007 2015 0 3 4000 125082.04183 4053.53 2370032007 2016 0 3 4000 204982.05068 4427 2370032007 2017 0 3 1700 48042 36752 2370043001 2007 0 4 1200 34957 26538 2370043001 2008 0 4 7200 936087.49 15018.57 2370044004 2017 0 4 1800 41355.786797 877 2370044007 2011 0 4 1800 113099.64508 4160 2370044007 2014 0 4 1800 116092.65223 9088 2370044007 2015 0 4 1800 76711.130607 0 2370044007 2017 0 4 1800 97198.854752 2745 2370044007 2018 0 4 3300 35425.311906 11798 2370047001 2007 0 4 2430 38745.458739 5219 2370047001 2008 0 4 2430 49367.363279 12325 2370047001 2009 0 4 2430 40580.994763 10284 2370047001 2010 0 4 2430 46729.022553 23775 2370047001 2011 0 4 3350 120627.14621 43026 2370047004 2004 2009 4 3400 121589.02758 48050 2370047004 2005 2009 4 3400 146550.22526 70780 2370047004 2006 2009 4 3400 170518.94934 91297 2370047004 2007 2009 4 3400 137507.24861 71150 2370047004 2008 2009 4 3400 126478.33888 75471 2370047004 2009 2009 4 3400 162778.66367 102720 2370047004 2010 2009 4 3400 151976.50287 97464 2370047004 2011 2009 4 3400 156173.18019 125127 2370047004 2012 2009 4 3400 143110.02296 107581 2370047004 2013 2009 4 3400 151049.05715 113260 2370047004 2014 2009 4 4300 133266.3016 96537 2370047004 2015 2009 4 end
jwdid var_1, ivar(ID) tvar(YEAR) gvar(treatyear_2) cluster(cluster) never level(99) WARNING: Singleton observations not dropped; statistical significance is biased (link) (MWFE estimator converged in 7 iterations) warning: missing F statistic; dropped variables due to collinearity or too few clusters HDFE Linear regression Number of obs = 16,363 Absorbing 2 HDFE groups F( 111, 9) = . Statistics robust to heteroskedasticity Prob > F = . R-squared = 0.8736 Adj R-squared = 0.8515 Within R-sq. = 0.0110 Number of clusters (cluster) = 10 Root MSE = 694.0238 (Std. Err. adjusted for 10 clusters in cluster) ------------------------------------------------------------------------------------------- | Robust var_1 | Coef. Std. Err. t P>|t| [99% Conf. Interval] --------------------------+---------------------------------------------------------------- treatyear_2#YEAR#c.__tr__ | 2006 2004 | -143.3621 105.9916 -1.35 0.209 -487.8173 201.093 2006 2006 | -347.3493 167.3154 -2.08 0.068 -891.097 196.3983 2006 2007 | -534.5825 323.9352 -1.65 0.133 -1587.319 518.1537 2006 2008 | -583.1733 293.0042 -1.99 0.078 -1535.389 369.0423 2006 2009 | -645.8113 168.0614 -3.84 0.004 -1191.983 -99.63922 2006 2010 | -1209.718 466.7972 -2.59 0.029 -2726.732 307.2965 2006 2011 | -1328.857 474.1097 -2.80 0.021 -2869.635 211.9219 2006 2012 | -1299.695 473.836 -2.74 0.023 -2839.584 240.1935 2006 2013 | -1546.798 306.1293 -5.05 0.001 -2541.668 -551.9284 2006 2015 | -2901.141 311.2972 -9.32 0.000 -3912.805 -1889.476 --> 2017 2004 | 914.5714 80.99699 11.29 0.000 651.3445 1177.798 2017 2005 | 868.7669 76.65351 11.33 0.000 619.6556 1117.878 2017 2006 | 464.2509 57.21763 8.11 0.000 278.303 650.1988 2017 2007 | 541.0177 57.49802 9.41 0.000 354.1586 727.8768 2017 2008 | 279.7603 35.43216 7.90 0.000 164.6116 394.909 2017 2009 | 392.1223 41.13132 9.53 0.000 258.4523 525.7923 2017 2010 | 876.5494 35.52366 24.68 0.000 761.1033 991.9954 2017 2011 | 674.0768 35.15342 19.18 0.000 559.834 788.3196 2017 2012 | 704.9049 25.47408 27.67 0.000 622.1183 787.6914 2017 2013 | 754.1909 24.70185 30.53 0.000 673.9139 834.4678 2017 2014 | 529.5378 36.8533 14.37 0.000 409.7707 649.305 2017 2015 | 416.5151 22.31546 18.66 0.000 343.9935 489.0366 2017 2017 | 20.02007 25.15492 0.80 0.447 -61.7293 101.7694 2017 2018 | -74.12614 24.28336 -3.05 0.014 -153.0431 4.790805 | _cons | 4580.022 2.739739 1671.70 0.000 4571.119 4588.926 ------------------------------------------------------------------------------------------- Absorbed degrees of freedom: -----------------------------------------------------+ Absorbed FE | Categories - Redundant = Num. Coefs | -------------+---------------------------------------| ID | 2305 2305 0 *| YEAR | 15 1 14 | -----------------------------------------------------+ * = FE nested within cluster; treated as redundant for DoF computation estat event varlist required
frause mpdta.dta, clear
jwdid lemp, ivar(countyreal) tvar(year) gvar(first_treat)
estat event
varlist required
. which jwdid
c:\ado\plus\j\jwdid.ado
*!v2.00 Paper Out
. which jwdid
c:\ado\plus\j\jwdid.ado
*!v2.01 xattvar
frause mpdta.dta, clear
jwdid lemp, ivar(countyreal) tvar(year) gvar(first_treat)
estat event
varlist required
. ado uninstall jwdid
package jwdid from http://fmwww.bc.edu/repec/bocode/j
'JWDID': module to estimate Difference-in-Difference models using Mundlak approach
(package uninstalled)
. ssc install jwdid checking jwdid consistency and verifying not already installed... installing into c:\ado\plus\... installation complete.
. which jwdid
c:\ado\plus\j\jwdid.ado
*!v2.00 Paper Out
. ado update reghdfe
note: ado update updates community-contributed files; type update to check for updates to official Stata.
Checking status of specified packages:
[36] reghdfe at http://fmwww.bc.edu/RePEc/bocode/r:
installed package is up to date
(no packages require updating)
margins , subpop(if __etr__==1 ) at(__tr__=(0 1)) over(__event__) noestimcheck contrast(atcontrast(r)) post Contrasts of predictive margins Number of obs = 2,500 Model VCE: Robust Subpop. no. obs = 291 Expression: Linear prediction, predict() Over: __event__ 1._at: 5.__event__ __tr__ = 0 6.__event__ __tr__ = 0 7.__event__ __tr__ = 0 8.__event__ __tr__ = 0 2._at: 5.__event__ __tr__ = 1 6.__event__ __tr__ = 1 7.__event__ __tr__ = 1 8.__event__ __tr__ = 1 ------------------------------------------------- | df chi2 P>chi2 --------------+---------------------------------- _at@__event__ | (2 vs 1) 0 | 1 5.20 0.0226 (2 vs 1) 1 | 1 7.66 0.0056 (2 vs 1) 2 | 1 14.73 0.0001 (2 vs 1) 3 | 1 9.55 0.0020 Joint | 4 18.00 0.0012 ------------------------------------------------- --------------------------------------------------------------- | Delta-method | Contrast std. err. [95% conf. interval] --------------+------------------------------------------------ _at@__event__ | (2 vs 1) 0 | -.0310669 .0136209 -.0577633 -.0043705 (2 vs 1) 1 | -.0522349 .0188729 -.089225 -.0152448 (2 vs 1) 2 | -.1360781 .0354555 -.2055696 -.0665866 (2 vs 1) 3 | -.1047075 .0338743 -.1710999 -.0383151 --------------------------------------------------------------- .
Comment