Dear all,

I have a panel dataset No.1 with multiple variables, including time, personal id, education level, training etc. I now need to add another variable - ethnicity - which needs to be imported from dataset No.2 and matched with the original one, No.1, based on personal id. The problem is that the data in the original dataset had been "cleaned up" - missing observations were dropped, some variables were winsorised. This means the number of observations in datasets No.1 and No.2 are not the same anymore for me simply to import the data.

I need to merge the two datasets and figure out if there is a code that matches observations based on personal id, so that I can get rid of all other observations that have not been used in dataset No.1? Thank you in advance!