This is very common when you have groups of observations in one file (the file with the identifying variable which is not unique), and information regarding each group in another file (the other file). One-to-Many matching: If the identifying variable is unique in one file, but not unique in the other, then it's a one-to-many matching.In both datasets, each country has only one observation. In the figure below, country is the identifying variable. Unique means that for each value of this variable, there is only one observation that contains it. One-to-One matching: If the identifying variable which appears in the files is unique in both files, then it's a one-to-one match.There are three types of matches of this kind: If we have an identifying variable in both files (e.g Social Security Number), we can assign each student his/her SAT score. For example, if we're dealing with high school students and we have one file with their personal information and grades, and another file with SAT scores only.
The observations appear in both files (at least most of them), but in each file there is different information about them. "Horizontal" combination - This is the kind of combinations in which you want to add variables, and not observations.The command in Stata we will use is append. As long as the variables in the files are the same and the only thing you need to do is to add observations, this is vertical combination. Another possibility is that the data is separated according to different leagues, groups, etc. For instance, if you are working on a sports statistics project and you have data for players performance in four separate files, one for each year between 20. "Vertical" combination - You want to do this when you want to add observations from one file to another file.There are actually two main types of combinations:
Stata 13 dataset in stata 12 how to#
In this post I will try to elaborate a bit on how to make it work. Another case is when you have one dataset which is divided into multiple files. For example, if you want to analyze international growth, you might find economic indicators in a dataset of the World Bank, political indicators in think tanks such as Freedom House, and climate data in another dataset. In many cases, the data needed for the statistical analyses come from different sources.