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
Table command in stata 16 does not allow statistic optionHello there, I am running a 3-way table using table command. I tried to add statistic and no totals…
Panel-Data regression with time dummies, FE and time variant treatment effectsDear Stata-Experts, I have some trouble concerning my regression model for a panel data analysis. T…
Converting a variable like Income in Nominal Terms to Real Terms?Hi, I have cross-sectional data covering 5 different years. Using the last year, 2011 as the base y…
Mixed or xthybrid for time varying covariates in longitudinal data setHi, I am working on data set with two-time points. Exposure (y) at the first time point and outcome …
Whether we should control for country-level control variables for studying a single country?In an international setting, when I used the Difference-in-Differences (DiD) approach to examine the…
Subscribe to:
Post Comments (Atom)
0 Response to Loop over certain stata files in one folder
Post a Comment