Hello All,
I am trying to import d.ta file and append them, what is wrong with this code? For some reason it only uses the first file from 1995, but does not continue with the subsequent years. Thanks in advance
clear all
cd "mydir"
save file_all_green, replace emptyok
forvalues i= 1995(1)2018 {
use country_partner_hsproduct6digit_year_`i',clear
keep year export_value location_code partner_code hs_product_code
append using "file_all_green"
save file_all_green,replace
}
Related Posts with Loop and Append .dta files
mfp functionHow to estimate the function after fitting an mfp? I'm not looking at predict. I need the function s…
"Varlist required" error message in loop using local macroHi I'm trying to use a loop to generate a set of new variables representing the format of an existi…
misum error: variable _mj not foundDear all, I had used Daniel Klein's misum command in the past and never had an issue until now. I a…
How to graph the interaction effects of two dummy variables?Hi, I am trying to graph an interaction between two dummy variables (s and p) to see if the interact…
mean regression vs. regression toward the meanDear All, I just have a few dumb questions. Hopefully, someone here will help me understand econome…
Subscribe to:
Post Comments (Atom)
0 Response to Loop and Append .dta files
Post a Comment