Merging of NSSO Data

Merging of NSSO data is one of the most common FAQ. This will help in providing link or merging of two or more files in one file. Merging in STATA is done by comparing two variables that are in two different files.

Merging of two files does not involve much complexities when the number of cases are same and they are at the same level of measurement i.e. both of the files are either at household level or individual level. But, it becomes more complex when the two datasets are at different measurement level i.e. one is at the household level and another one is at the individual level.

With Same Level of Measurement:


Adding variables with the same level of measurement implies that to files are being merged at the same level of measurement, i.e. both files are household files. In order to merge two files, follow the steps given below:

a) Generation of Common ID
b) Sort both files based on common ID and
c) Merging Data

These variables include FSU_NO, HG_SB_NO, SSS_NO and SAMPLE_HH_NO.
After generating common ID for both files, sort both files with common ID using "sort ID" command.

After generating and sorting the data, one can merge both the files using the following command:

joinby ID using  <filename>

This command merge two files based on one common ID, i.e. ID. In this example, the following STATA code is used:

joinby ID using "H:\User\Stata\Block-6.dta"


With Different Level of Measurement:


For merging two files having different level of measurement, i.e. one at individual level and other at household level, first sort the data by the common ID.

After sorting data, merge the two files by using either "one to many" or "many to one "command in Stata.

While merging data from individual level to household level, use the following command:

merge 1: m ID using <name of individual file name>

While merging data from household to individual level, use the following command:

merge m: 1 ID using <name of household file name>


For more details on NSSO Data support, please contact on below address:


Ajay Srivastava

NSSO Data Expert

Email ID: analyzingnssodata@gmail.com


Popular posts from this blog

Extraction of NSSO Data

Weights of NSSO Data

Consumer Expenditure Survey of NSSO Data