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" <[email protected]>
To   <[email protected]>
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
[email protected]

----- Original Message ----- "Anibal Santos" <[email protected]> wrote
To: <[email protected]>
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.:
<snip>

*
*   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/



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