Statalist The Stata Listserver

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

st: Re: Issues with merging data

From   "Michael Blasnik" <>
To   <>
Subject   st: Re: Issues with merging data
Date   Mon, 15 May 2006 19:57:11 -0400

I think the -nokeep- option to merge does exactly what you want. If you had read the help on merge you would have found this out for yourself. Stata's merge command is not a SQL inner join.

Michael Blasnik

----- Original Message ----- "Anibal Santos" <> wrote
To: <>
Sent: Monday, May 15, 2006 7:12 PM
Subject: st: Issues with merging data

Hi everyone,

I'm trying to merge two datasets: one with accounting data for several
companies and the other with monthly stock returns and market value. I'm
using the following command:

. merge dscd Year Month using "C:\DATA\mktdata\ret_mv.dta", unique sort
With the accounting data loaded in memory.
After running this command I edited the merged file and found that stata
used all the observations from ret_mv.dta, even though the accounting data
file only has information for one Year and one Month per observation. Ex.:

*   For searches and help try:

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