Hi all,
I am trying to let Stata loop over only certain files ending with _p in one folder. The files meant are named "2004_c_y_cross_pers_data_p", the year however varies 2004 2006 2008 2012 etc. till 2018. I tried adjusting the syntax by adding this part files "*_cross_eu_silc_pers_data_p.dta" but something does not work. Any clue about the right syntax? Thanks!
cd "Y:\Cross\All_countries"
local statafiles : dir . files "*.dta
foreach file of local statafiles {
tab PB020 if PY000 <0
}
Array
Related Posts with Loop over certain stata files in one folder
Power analysis for conditional logistic regression with variable ratio matchingDoes anyone know how to do a power analysis for conditional logistic regression on matched case-cont…
Transforming a quarterly variable into a monthly variable and merging two databasesDear Statalist, I'm looking to transform a quarterly variable into a monthly variable so that it ma…
Cross sectional or panel dataDear Stata users, I will please like some explanation. I am working on the topic "the effect of chi…
tolong: a faster reshape longtolong, a faster implementation of reshape long, is now available on ssc. Type ssc install tolong an…
Remove prefix in ID variable individual row namesI want to rename the individual rows in one column which represents the ID variable for each individ…
Subscribe to:
Post Comments (Atom)
0 Response to Loop over certain stata files in one folder
Post a Comment