
I'd like to store the results of my .do file in a new dataset.
For example, I have four different datasets named IT_2018, IT_2019, UK_2018 and UK_2019.
I calculated in a unique .do file the number of individuals, children, working age, elderly for each dataset and I obtained these locals: IT_2018_i_no ; IT_2018_k_no ; IT_2018_w_no and so on and so forth.
I created a different dataset in which I'd like to store all of these results. The datasets will have 6 variables:
- country
- year
- i_no (number of individual)
- k_no (number of children)
- w_no (number of working age people)
- e_no (number of elderly)
and 4 observations:
- IT 2018
- IT 2019
- UK 2018
- UK 2019
How can i say to Stata: "take each local, see its name and fill the corresponding cell in the new dataset?".
At the end of the day, I'd like to have a "results dataset" like this:
country years i_no k_no w_no e_no
IT 2018 564 45 ... 136
IT 2019 573 51 ... 127
and so on and so forth.
0 Response to How to save the value of a local in another dataset
Post a Comment