Hi -
Another data management question:
I have 7 country datasets. I want to be able to run one cleaning do file that cleans all 7 datasets with a loop.
It needs to:
1. import the baseline survey data .csv
2. save the baseline survey data .dta
3. import the endline survey data .csv
3. save the endline survey data .dta
4. merge 1:1 baseline and endline
5. save the merged baseline and endline data as one dataset
6. clean the data (various commands and steps)
7. save the cleaned data .dta
I have all of the code written to do this country by country, but I want to be able to do it in a loop. All of the datasets are saved in gl macros.
It is possible to create a loop that does those 7 steps, right? If so, any recommendations on where to start/find example code for that? Happy to try to explain again if that doesn't make sense.
Thanks!
Another data management question:
I have 7 country datasets. I want to be able to run one cleaning do file that cleans all 7 datasets with a loop.
It needs to:
1. import the baseline survey data .csv
2. save the baseline survey data .dta
3. import the endline survey data .csv
3. save the endline survey data .dta
4. merge 1:1 baseline and endline
5. save the merged baseline and endline data as one dataset
6. clean the data (various commands and steps)
7. save the cleaned data .dta
I have all of the code written to do this country by country, but I want to be able to do it in a loop. All of the datasets are saved in gl macros.
It is possible to create a loop that does those 7 steps, right? If so, any recommendations on where to start/find example code for that? Happy to try to explain again if that doesn't make sense.
Thanks!