![]() These observations were therefore not merged. Observations for which _merge = 1 existed only in the master dataset but not the using dataset.This variable describes the outcome of the merge, as follows: When you're done executing the merge command, you will notice that a new variable called _merge has been generated. In this example dataset1 is the master dataset while dataset2 is the using dataset. The dataset that you would like to add to the currently open dataset is the using dataset. In Stata parlance, the dataset that is currently open is called the master dataset. Here you would type duplicates report person.Īnd here's how to do it (assuming Dataset 1 and Dataset 2 are stored as dataset1.dta and dataset2.dta respectively): This means that we should perform a one-to-one merge of the two datasets based on person.īefore merging, it is good practice to verify whether or not your identifier variable/s is/are unique across observations with duplicates report. ![]() In Dataset 1, each person appears only once, so person uniquely identifies each person in the dataset. ![]() Since we wish to combine data on a person's age and data on a person's sex, the identifier variable is person.Let's evaluate the two items above in turn. Is each observation (row) of the identifier variable unique? In other words, does each row value for the identifier variable occur only once? The answer to this question matters for how you would merge the two datasets, as you will see. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |