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

st: St: re merging two datasets

From   Pamela Meadows <>
Subject   st: St: re merging two datasets
Date   Mon, 1 Sep 2003 12:13:54 +0100 (BST)

If you only want the income variable from the B
dataset, you need to create a temporary C dataset
which is a subset of the B dataset

use B
keep city income
save as C

You then sort this new C dataset on city, sort the A
datset on city and follow Michael Blasnik's
suggestion. You then save this new merged dataset as
some variant of A. You can then delete the C datset if
you wish.(I only mention this because I tend not to do
this and have messy little data sub-sets littering my
data folders.)

Pamela Meadows

> Date: Sun, 31 Aug 2003 16:08:54 -0400 (EDT)
> From: Michael Horowitz <>
> Subject: st: Question about merging two datasets
> 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 
=== message truncated === 

Want to chat instantly with your online friends?  Get the FREE Yahoo!
*   For searches and help try:

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