From | Ernest Berkhout <[email protected]> |
To | [email protected], [email protected] |
Subject | Re: st: Re: Question about merging two datasets |
Date | Mon, 01 Sep 2003 10:56:14 +0200 |
At 00:03 1-9-2003, [email protected] 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 <[email protected]>:
> 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–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |