Hi, I got stuck and cannot find out what's wrong with my commands.
Anybody can help me check on them? Thanks!
Jingbo
___________________________________
Child data file:
DUID (family ID, 5 digits)
PID (person ID within family, 3 digits)
DUPERSID (unique person, 8 digits) *DUPERSID=DUID+PID
MOPID (mom PID)
DAPID (dad PID)
Parents data file:
DUID
PID
DUPERSID
I am trying to link the two files together with those commands:
use parents, clear
generate duidpid=dupersid
sort duidpid
save parents, replace
use child, clear
generate duidpid=(duid*1000)+mopid
sort duidpid
merge duidpid using "child"
tab _merge
. tab _merge
_merge | Freq. Percent Cum.
------------+-----------------------------------
1 | 16,956 33.01 33.01
2 | 34,403 66.99 100.00
------------+-----------------------------------
Total | 51,359 100.00
*
* 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/