| From | Ernest Berkhout <ernestb@seo.fee.uva.nl> |
| To | statalist@hsphsun2.harvard.edu, statalist@hsphsun2.harvard.edu |
| Subject | Re: st: Re: Question about merging two datasets |
| Date | Mon, 01 Sep 2003 10:56:14 +0200 |
At 00:03 1-9-2003, horowitz@fas.harvard.edu wrote:
What if I have other variables besides city and income in dataset A and datasetPlease take a look at the magnificent mmerge.ado by Jeroen Weesie, it should handle your problem quite easily (type -ssc inst mmerge- ).
B (and they are different variables in each dataset) but I only want to merge
in the matching incomes from dataset B to replace the incorrect ones in dataset
A (i.e. I want to leave alone the rest of the variables in dataset A)?
Quoting Michael Blasnik <michael.blasnik@verizon.net>:
> 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.
| © Copyright 1996–2013 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |