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
Matching to identify a sub-sample of individuals that share similar characteristicsHi all, As opposed to using PSMTACH2 to calculate the propensity scores to identify treatment and c…
creating a variable from multiple string variablesI am working with NHANES examination data and would like to create a variable that includes the sum …
Create a table comparing output from diffrent regression modelsHello All, A frequent problem I have in Stata is that I have to run different regression models (fo…
Odds ratio or hazard riskhi all, how can i calculate odds ratio or hazard risk with a contingency table. for example: tabulat…
Question on How to Make a Panel Table Output with Categorical RegressionHi, I am new to Stata and this forum. I have a question which I spent lots of time on but did not fi…
Subscribe to:
Post Comments (Atom)
0 Response to Split to multiple files, merge and append
Post a Comment