Hi statausers:
I'm trying to run a Bootstrap code to get standard errors out of a matrix. The code runs well but when generating the matrix, all the entrances get used by the last data introduced. To avoid this, I tried generating different databases to get the statistics from. The code (simplified) looks like this:
global k = "2009/2011"
global l = "1/20"
forvalues i = $l {
forvalues i = $k {
use "$final_bootstrap\panel_2007-2011_stats.dta"
keep if year == 2008 | year ==`i'
save "$final_teffects\base_2008-`i'_stats_$l.dta"
clear
}
}
The idea was to generate 60 databases, 20 for each year (2009, 2010, 2011). However, Stata says the resulting file could not be opened and therefore it doesn't save the different databases, with the different names assigned.
Any help? Thanks in advance,
Adrian
Related Posts with How to create databases by loops
Regress data with multiple imputation using micombineDear stata-community, we are working on a regression model using SCF-data (https://www.federalreser…
Interpreting the marginal effect in Probit with a logged transformed covariateHi everyone, I have a challenge with interpreting the marginal effect in Probit model with a logge…
Negative Binomial regressionI have number of children as count variable which I am regressing on the log of parent's income. How…
ARDL short run coefficientDear community, I am coming back to you because I have a small problem concerning the estimation of…
Event study with Bitcoin and stock prices: How should I approach non-trading days?Hi everyone, I am trying to run a basic event study using daily Bitcoin returns and the S&P500 …
Subscribe to:
Post Comments (Atom)
0 Response to How to create databases by loops
Post a Comment