Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: putting files together


From   "Gauri Khanna" <gwkhanna@hotmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: putting files together
Date   Wed, 28 Mar 2007 12:09:33 +0000

Hi,

In case this is of help.

Do you have the same id's in all three files and the same no. of observations? If you are getting missing values that means that these id's do not exist in the master file.

I would normally do the following:-

use mydatatomerge
sort id
save, replace
clear

use mydata
sort id
merge id using mydatatomerge
tab _merge


Regards,

Gauri


From: elin zetterlund <elinbelin@yahoo.com>
Reply-To: statalist@hsphsun2.harvard.edu
To: statalist@hsphsun2.harvard.edu
Subject: st: putting files together
Date: Wed, 28 Mar 2007 01:01:35 +0200 (CEST)

Hi,
I have some problems putting files together in
Stata...
I have 3 files containing different individuals, and
must of the varibles are the same but some differ. I
have tried the merge comand and the append comand, and
the same thing happends both times... All the
individuales are in the new dataset but 970 (about
half of them) have missing values in the other
varibles. Whats my misstake?

my code:
sort id

cd "C:\Documents and settings\..."

merge id using p777.dta

sort id

cd "C:\Documents and settings\..."

merge id using L777.dta







_________________________________________________________
Flyger tiden iv=E4g? F=E5nga dagen med Yahoo! Mails inbyggda
kalender. Dessutom 250 MB gratis, virusscanning och antispam. F=E5 den p=E5=
: http://se.mail.yahoo.com
*
* 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/
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index