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
VAR models on raw or filtered/smoothed data?Dear all, I just started to learn time series analysis and I'm reading Becketti's book at the moment…
How will I be able to have a count of certain string variable when using collapse command ??This is how my data looks like..... Student Name SchoolName Location NScore EScore MScore A X 5…
Issues with the dependent variable being too common in Logistic regressions? Good morning/afternoon/evening Ladies and Gents of Statalist, I'm using logistic regression to p…
Calculating the percentage changes with longitudinal data (not a panel)Hi, My name is Jiwan. I'm currently working on Korean Household Income and Expenditure Survey, to s…
Least Square Method for parametric survival curve fittingDear All, Hope you're doing well and safe! Can anyone let me know Stata codes for parametric survi…
Subscribe to:
Post Comments (Atom)
0 Response to How to create databases by loops
Post a Comment