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" <michael.blasnik@verizon.net>
To   <statalist@hsphsun2.harvard.edu>
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
michael.blasnik@verizon.net

----- Original Message ----- "Anibal Santos" <ssrnmail@gmail.com> wrote
To: <statalist@hsphsun2.harvard.edu>
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index