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

st: Question about merging two datasets

From   Michael Horowitz <>
Subject   st: Question about merging two datasets
Date   Sun, 31 Aug 2003 16:08:54 -0400 (EDT)

I have a problem that I was wondering if someone out there could help me
with. I have two datasets.  Lets call them dataset A and dataset B.
Dataset A contains contains two variables, <city> and <income>.  Dataset B
also contains two variables, <city> and <income>.  Dataset A is much
larger than Dataset B and the data in Dataset B is more accurate than the
data in Dataset A.  Specifically, the income levels for the cities in
dataset A are sometimes incorrect and I need to replace them with the
correct income levels from dataset B.

So I need to merge datasets A and B, matching for when the name of the
city is the same and inserting the income score from dataset B into
dataset A when the two disagree.

I've tried the various merge commands but I cannot seem to get the command
right to make it work.

Could someone please assist?  I would be quite appreciative.

Michael Horowitz


Michael Horowitz
78 Kirkland Street, #1
Cambridge, MA 02138

*   For searches and help try:

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