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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: how can I merge two data sets over a range of values


From   Lim Lee <lee.haklim@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: how can I merge two data sets over a range of values
Date   Wed, 8 Feb 2012 18:20:32 -0500

you can create a variable "x" tagging all price==20 in dataset1 and
variable "x" tagging all price in the range of 19.5 to 20.5.  If you
have more than one value with price=20 your going to have to make that
each observation unique or drop one since merging m:m makes little
sense and the merging process requires at least one dataset to be
uniquely identified with regard to the variable your are matching the
datasets with.

hope this might be of help.

Lim

On Wed, Feb 8, 2012 at 4:45 PM, Richard Warr <rswarr@gmail.com> wrote:
> Hi, I want to merge two data sets.  The merge variable is the stock
> price.  However I would like to merge over a range of prices.  For
> example if the price is 20 in dataset1, I would like that to merge
> with any price in the range of 19.5 to 20.5 in dataset2.   Currently
> my data sets each contain only a single stock price series (and other
> variables).
>
> Any ideas?
>
> Thanks
> Richard
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index