Statalist


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

RE: -merge- (?) problem (was: st: MIME-Version: 1.0)


From   "Lachenbruch, Peter" <Peter.Lachenbruch@oregonstate.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: -merge- (?) problem (was: st: MIME-Version: 1.0)
Date   Mon, 29 Sep 2008 08:10:51 -0700

I'm sorry but I'm going to be a bit grumpy.  

First, the title of the original submission did not specify what the
issue was.  Part of the FAQ strongly suggests that there be descriptive
titles.  

Secondly, the question being asked suggests that a reading of the manual
would have answered most, if not all, of Ashim's questions.

Could posters please try to find the answers in the help files or the
manuals before asking questions

Tony

Peter A. Lachenbruch
Department of Public Health
Oregon State University
Corvallis, OR 97330
Phone: 541-737-3832
FAX: 541-737-4001


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Eva Poen
Sent: Monday, September 29, 2008 4:09 AM
To: statalist@hsphsun2.harvard.edu
Subject: -merge- (?) problem (was: st: MIME-Version: 1.0)

Ashim,

I'm sorry but I don't get it. You have two variables in your first
file, called symbol and ticker. What are they? Numeric, string? In
your second file you have symbol again (what about ticker?), and many
more variables, and you also have more observations (symbol does no
longer uniquely identify observations).

Now you want to do some operation that looks suspciously like a
-merge-, but it's unclear to me. For each symbol from file 1, you want
to -use- file 2 and -keep- all observations with this symbol.
Following what you said earlier, you will now be left with approx. 100
observations and many variables. Now you say you want to save this "as
ticker in the 1st file". What do you mean by that? You want to save
all 100 observations and many variables, in the first file? And what's
that to do with ticker? Ticker already exists in the first file. Do
you want to replace it, and with what information? Or do you want to
add ticker to the second file?

You'll have to be more precise for someone to be able to help.

Eva

2008/9/29 Ashim Kapoor <ashimkapoor@gmail.com>:
> Hello everyone,
>
> I have 2 files.
>
> The 1st file has 2 columns --> symbol and ticker. [ each symbol is
> only in one observation ]
>
> The 2nd file has many more columns --> symbol and many other vars. [
> each symbol is in around 100 observations here ]
>
> I want to say foreach symbol in 1st file  {
>
> use 2nd file
>
> keep if symbol ==above symbol
>
> save as ticker in the 1st file
>
> }
>
>
> Can someone tell me how to do this ?
>
> I guess to start with I would have to save the entire observations in
> symbol var in 1st file in ONE local macro and similarly for the
> ticker. Can someone tell me how to do this ?
>
> Thank you,
>
> Ashim.
*
*   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   |   What's new   |   Site index