Dear Stata community,
I am using data from multiple countries and from varying time periods. These data sets follow the general format "Data\household\country\year\purchases" for the file names. While the list of countries is fixed so I can create a local or global country-list, the beginnings and endings of the time periods (in years) vary from country to country: Example:
"Data\household\Mexico\2017\purchases"
"Data\household\Mexico\2018\purchases"
"Data\household\Brazil\2015\purchases"
"Data\household\Brazil\2016\purchases"
I would prefer not to resort to typing the beginning and ending years in each period by hand. So I am trying to code this process in a loop, but can’t seem to manage the time loop. Is it possible to code so that the beginning/ending of each period is identified from the file name?
Many thanks in advance.
I am using data from multiple countries and from varying time periods. These data sets follow the general format "Data\household\country\year\purchases" for the file names. While the list of countries is fixed so I can create a local or global country-list, the beginnings and endings of the time periods (in years) vary from country to country: Example:
"Data\household\Mexico\2017\purchases"
"Data\household\Mexico\2018\purchases"
"Data\household\Brazil\2015\purchases"
"Data\household\Brazil\2016\purchases"
I would prefer not to resort to typing the beginning and ending years in each period by hand. So I am trying to code this process in a loop, but can’t seem to manage the time loop. Is it possible to code so that the beginning/ending of each period is identified from the file name?
Many thanks in advance.
Comment