> How do I merge two files containing panel data on the basis of case ID as
> well as the year.
> Thanks
> anurag
Make sure both data sets are in Stata format and sorted by ID
year. Commands should be similar to...
use file1, clear
sort ID year
save, replace
use file2, clear
sort ID year
merge ID year using file1
tab _merge
The -tab _merge- tells you how many of the observations match up
from each of the datasets.
See -help merge-
Neil
Neil Shephard
Genetics Statistician
ARC Epidemiology Unit, University of Manchester
[email protected]
[email protected]
"Contrariwise, if it was so, it might be; and if it
were so it would be; but as it isn't, it ain't. That's
logic" - Tweedledee (Alice Through the Looking Glass)
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/