Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Multiple Sequential Merges

From   Lisa Wang <>
Subject   st: Multiple Sequential Merges
Date   Wed, 3 Apr 2013 16:36:05 +1100

Hi all,

I am unsure as to whether I am applying the merge function correctly
or not. I would like to merge values from multiple spreadsheets/.dta
files into one master sheet "master". Here is the code I have at the

merge 1:1 ID using "C:\Users\Admin\Documents\Data1.dta", force

All good as it will merge all the data into my "master" and then put .
(missing values) for all the observations where it is not matched.
However, if I then run:

merge 1:1 ID using "C:\Users\Admin\Documents\Data2.dta", force

then the values from Data2 do not appear in my "master" file even
though the results say it has been merged (i.e. still appears as . )

What I want to achieve is similar to a VLOOKUP in Excel over multiple
sheets but I thought I would just do a merge in STATA instead.

Data1, Data2, Data3...files all have the same columns as each other if
that is any assistance.

Thank you,
*   For searches and help try:

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