Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: merge vs append


From   baum <[email protected]>
To   StataList <[email protected]>
Subject   st: merge vs append
Date   Sat, 21 Dec 2002 12:05:23 -0500

K. Ida wrote The structure of the data files at hand is as follows:

personnel_1997.dta  personnel_1998.dta ...  personnel_2001.dta
------------------------------------------------
         id   year             id  year                       id  year
  101818  1997      101818  1998               101818  2001
  102270  1997      102881  1998               103454  2001
  102881  1997      103454  1998               104043  2001
  103241  1997      103586  1998               104124  2001
  103373  1997      103799  1998               104132  2001
  103438  1997      104043  1998               104710  2001
  103454  1997      104124  1998               104868  2001
  103586  1997      104132  1998               105210  2001
  103799  1997      104281  1998               105635  2001
  103888  1997      104523  1998               105708  2001
  ...

Namely, there are attrition and/or entry of employees
during the panel period, though most of them survive
from start to end.
So, I thought using -merge- with each file matched by id
variable would be a better choice.
I'd appreciate additional advice if I am wrong.
It seems to me that you want to -append- all of these into a long format file, where each record will be uniquely keyed by id -and- year. You can then reshape wide, if you wish, to create variables where the same individual shows up in the workforce (or not) year by year.

Kit
________________________________________________________________________
Christopher F Baum, Boston College Economics, Chestnut Hill MA 02467 USA
[email protected] http://fmwww.bc.edu/ec-v/baum.fac.html
*
* 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/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index