I am trying to perform the following: extract n bootstrap samples from a strongly balanced panel dataset with the following structure:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(idatc3 Year tot_count y) 1 2004 0 16.353962 1 2005 1 16.340631 1 2006 0 16.286907 1 2007 0 16.273083 1 2008 0 16.255836 1 2009 0 15.925304 1 2010 0 15.859792 2 2004 0 18.146786 2 2005 1 18.185635 2 2006 0 18.199041 2 2007 0 18.194345 2 2008 0 18.213171 2 2009 0 18.345274 2 2010 0 18.226433 3 2004 3 13.705626 3 2005 7 15.13613 3 2006 1 16.208109 3 2007 3 16.591629 3 2008 0 16.917368 3 2009 2 17.030642 3 2010 5 17.209492 4 2004 25 16.50014 4 2005 8 16.745003 4 2006 6 16.75969 4 2007 14 17.048187 4 2008 2 17.244335 4 2009 0 17.343176 4 2010 2 17.933966 5 2004 0 17.868816 5 2005 0 17.693306 5 2006 2 17.696056 5 2007 4 17.748852 5 2008 0 17.76949 5 2009 0 17.838858 5 2010 0 17.91857 6 2004 0 19.07523 6 2005 0 18.995157 6 2006 0 18.959908 6 2007 1 18.898798 6 2008 0 18.66919 6 2009 0 18.642822 6 2010 0 18.255278 7 2004 1 22.090456 7 2005 0 22.101965 7 2006 2 22.116083 7 2007 0 22.14667 7 2008 2 22.0739 7 2009 0 22.06895 7 2010 0 21.95814 8 2004 2 17.097506 8 2005 2 16.42637 8 2006 0 16.32611 8 2007 0 16.537579 8 2008 0 16.272715 8 2009 0 16.364277 8 2010 0 15.86466 9 2004 2 18.293467 9 2005 0 18.54712 9 2006 0 18.760092 9 2007 0 17.585657 9 2008 1 15.65171 9 2009 0 15.918745 9 2010 0 18.139769 10 2004 0 20.34576 10 2005 2 20.38664 10 2006 1 20.52285 10 2007 0 20.07849 10 2008 0 19.609467 10 2009 1 19.61134 10 2010 0 19.63593 11 2004 0 15.633678 11 2005 0 16.186264 11 2006 2 16.36874 11 2007 0 16.868628 11 2008 0 16.864525 11 2009 0 16.66895 11 2010 0 16.688057 12 2004 2 18.850607 12 2005 0 18.661394 12 2006 0 18.685404 12 2007 0 18.935335 12 2008 0 19.289694 12 2009 0 19.490005 12 2010 0 18.965286 13 2004 1 15.167782 13 2005 0 15.652504 13 2006 0 16.465668 13 2007 0 16.760597 13 2008 0 16.878334 13 2009 0 17.17612 13 2010 0 18.00114 14 2004 2 19.100143 14 2005 0 18.629805 14 2006 0 18.49677 14 2007 0 18.35715 14 2008 0 18.183216 14 2009 0 18.108658 14 2010 0 18.07056 15 2004 0 17.956966 15 2005 0 18.202034 end
Code:
xtset idatc3 Year xtreg y x, fe vce(cluster idatc3) predict residuals, e xtpoisson tot_count residuals x, fe vce(robust)
Then, I would like to save the coefficients for each of the n samples and compute the standard errors of the n coefficients.
Is it possible to perform it within STATA?
Thank you,
Federico
0 Response to Bootstrap two stages
Post a Comment