Hello,
I am constructing a pooled dataset from the demographic and health surveys (DHS).
Currently, I have all my data stored in one huge folder, in which each file represents a data for a country, say, Albenia 2008, Albenia 2014; Kenya 2003, Kenya 2008.
I have harmonized all the datasets to ensure that the variables are equivalent. The next stage is to append them to each other.
However, there are a set of operations that I need to do on each dataset before trying to append/pool them. Some of these are computing and developing new variable weights (for denormalization processes), creating country level summaries (for example, GNP, HIV prevalence etc).
At the moment, i call each dataset, execute the commands for that dataset, close it, and open the next etc. One way is to write a major do file that will call each dataset, run it, save the output and move on to the next. I think there can be a more efficient way of doing this - a sort of loop that will input and output a new dataset with the changes.
I would appreciate some thoughts on whether this is possible/feasible.
cheers, Yy
Related Posts with Execute same syntax across multiple stata datasets
Means around Switches in a PanelDear STATALIST Community, I have an unbalanced panel, where individual status changes within groups…
Beginner User: invalid variable r(198)Hi All- Each time I run the code below, I receive an invalid 'data' r(198) response from STATA. I a…
Beginner User: Using all files within a folderHello All, I am using the updated STATA 17. I downloaded a folder of files that are already in .dt…
How STATA Works With Missing Data in Panel Data RegressionI will be grateful if anyone here could help me with panel data regression using STATA. I am current…
How to calculate a value from a stringColleagues, I have a dataset with a land-use description codified with a alphanumeric string. Some …
Subscribe to:
Post Comments (Atom)
0 Response to Execute same syntax across multiple stata datasets
Post a Comment