Statalist The Stata Listserver

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

RE: st: putting files together

From   "Gauri Khanna" <>
Subject   RE: st: putting files together
Date   Wed, 28 Mar 2007 12:09:33 +0000


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

use mydata
sort id
merge id using mydatatomerge
tab _merge



From: elin zetterlund <>
Subject: st: putting files together
Date: Wed, 28 Mar 2007 01:01:35 +0200 (CEST)

I have some problems putting files together in
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=
* For searches and help try:
Express yourself instantly with MSN Messenger! Download today it's FREE!

* For searches and help try:

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