Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Combining observations based on filing date and firm ID number


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Combining observations based on filing date and firm ID number
Date   Mon, 3 Feb 2014 00:13:45 +0000

Look at -collapse-.

Nick
[email protected]

On 2 February 2014 16:38, William Billik <[email protected]> wrote:

> In trying to reformat panel data from long to wide for purposes of
> merging with other data sources, the following error is obtained,
> "date_variable not unique withing firm_ID variable, there are multiple
> observations at the same date_variable within firm_ID variable.
>
> The data is of activist and institutional shareholder transactions and
> is from SEC (regulator) filings.  Consequently, for any given date
> there may be multiple shareholder transactions for the same firm.
> Occasionally, there are even multiple entries for the same shareholder
> on the same date.  Therefore, in long form, the data has multiple
> observations (rows) for the same shareholder ID, the same firm ID and
> and same date, but with differing transaction values.  (Or the
> shareholder ID may differ, but the firm ID and the date are the same.)
>
> I want to generate a format of the data where there is one observation
> of the firm_ID, with the transactions totals by shareholder and date
> in a single firm row.  Alternatively, the combined transaction totals
> of all shareholders on a date, while less preferable, may be
> acceptable.  Ultimately, I would like the data to be in this format of
> one row per firm to allow for merging with other data bases containing
> firm specific data.
>
> This is my first foray into Stata, and I tried the -egen- command to
> generate a total transaction value, but without success. (Only
> generated a new variable equal to the transaction value of the
> shareholder on a given date.)
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index