Hi all,
Im new to STATA so I apologise if this is a silly question. I am trying to combine two datasets; these datasets represent two waves of data (time 1 & time 3). I've used the following code:
*import excel dataset
import excel "/Users/bridget/Dropbox/PhD/Data/T1.xlsx", sheet("Sheet1") firstrow clear
*save dataset as dta
save T1.dta
*import excel dataset
import excel "/Users/bridget/Dropbox/PhD/Data/T3.xlsx", sheet("Sheet1") firstrow clear
*save dataset as dta
save T3.dta
*merge datasets
merge 1:1 ID using T1.dta, generate(_mergeT1)
merge 1:1 ID using T3.dta, generate(_mergeT3)
save MERGED.dta
However, I get the following error message:
"variable ID does not uniquely identify observations in the master data
r(459)"
Any guidance on this would be greatly appreciated!!
0 Response to Merging two datasets
Post a Comment