I have two files, each with 3 variables.
The first one has date, city, and score. The second one has date, city and ret. Each has 49 cities.
I want to split each files to 49 stata files, by city.
Then merge the 49 score files with the 49 ret files by city and date.
Then merge each of the 49 files with a fulldate file (only one variable date with all the 365/366 dates per year).
merge 1:1 date using fulldate
Then for the 49 files, each
replace city="cityname" if missing(city)
Then append all the 49 files to one file.
Anyone can help?
Great thanks!
Related Posts with Split to multiple files, merge and append
How to interpret results of Bayesian regressionHi everyone, Stata has an example of how to do Bayesian regression (https://www.stata.com/features/…
How to do the unitroot test for the panel data with gaps?I want to use the "xtunitroot" to do the unitroot test for the panel data, but I find that the comma…
For loop: Possibility to append columns to the right in a tableHello, I have several dependent variables and am running a loop. The goal is to save the regression…
Presenting the list of countries in a tableHello everyone, For my Master' thesis, I am trying to create a table like the one attached below. U…
Importing multiple text files to StataDear all, I am trying to import ASCII files to Stata. The problem is that there are two ASCII files …
Subscribe to:
Post Comments (Atom)
0 Response to Split to multiple files, merge and append
Post a Comment