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

From |
"Michael Blasnik" <michael.blasnik@verizon.net> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: Re: Question about merging two datasets |

Date |
Sun, 31 Aug 2003 16:34:48 -0400 |

This appears to be a most basic merge. assuming that dataset A is already sorted by city, then: use B sort city merge city using A These commands will result in a combined dataset where the value of income from B takes precedence. Michael Blasnik michael.blasnik@verizon.net ----- Original Message ----- From: "Michael Horowitz" <horowitz@fas.harvard.edu> To: <statalist@hsphsun2.harvard.edu> Sent: Sunday, August 31, 2003 4:08 PM 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 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. > > Sincerely, > Michael Horowitz > > **************************************************************************** ******************************* > > Michael Horowitz > 78 Kirkland Street, #1 > Cambridge, MA 02138 > > > * > * 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/ > * * 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/

**Follow-Ups**:**Re: st: Re: Question about merging two datasets***From:*horowitz@fas.harvard.edu

**References**:**st: Question about merging two datasets***From:*Michael Horowitz <horowitz@fas.harvard.edu>

- Prev by Date:
**st: [CITASA] CALL FOR PAPERS: COMPUTING AND SOCIOLOGY SPECIAL ISSUE OF SSCORE (fwd)** - Next by Date:
**Re: st: Re: Question about merging two datasets** - Previous by thread:
**st: Question about merging two datasets** - Next by thread:
**Re: st: Re: Question about merging two datasets** - Index(es):

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