How to use Stata - Detailed introduction to the method of merging data with Stata

Time: 2020-12-28Source: Huajun Software TutorialAuthor: Xiaoyuer

Maybe some friends still don’t know how to use Stata to merge data? So for those who don’t know, come and take a look at the detailed method of merging data with Stata shared by the editor. I hope that through the study of this tutorial, it can be helpful to everyone.

Use the merge command syntax: merge [varlist] using filename [filename...] [optione]; where [varlist] represents the new variable to be merged, and using filename refers to the file path to be merged with the original file.

Stata screenshot

First open the first source file water1.dta, sort it by year, and then save it in overwrite mode

Open the second source file water2.dta and sort it by year.

Use the merge command to merge two files

Save the merged results and view the merged data

Stata screenshot

The above is the detailed method of merging data with Stata shared by the editor. Friends in need should not miss it.

Related articles更多>>

Popular recommendations