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 on April 23, and its replacement, statalist.org is already up and running.


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

st: Reshape, Transpose... a (little) puzzling data manipulation


From   John Litfiba <cariboupad@gmx.fr>
To   statalist@hsphsun2.harvard.edu
Subject   st: Reshape, Transpose... a (little) puzzling data manipulation
Date   Thu, 29 Sep 2011 17:28:56 +0200

Dear Statalist,

I have a little problem and I hope you will be able to help me:

I have a dataset containing stock price data organized as follow :

I know the unique identifier for each stock (ISIN) I have 4 types of
prices (high, low, closing price, average) and then more than 7000
dates...


    ISIN       PRICE_type Date1 Date2 Date3 Date4 Date5 Date6 Date7
... date 7000
1 US00001  Type1            10      12  etc
2 US00001  Type2            15     11  etc
3 US00002  Type 1          120
4 US00002  Type 2          110
5

So one big problem here is that the dates are column labels...
Therefore each row gives me the whole history for a particular ISIN
and Price combination.
Instead, would like to obtain something like this

Date        ISIN            PRICE_Type1 PRICE_Type2 PRICE_Type3 PRICE_Type4
1.Date1    US00001      10          15               10               20
2.Date2    US00001      12          11               10               20
3.Date1    US00002      120       110               10 .5            2
4.etc
5.

Here each row gives the all relevant prices for a particular ISIN and
a particular date

Do you have any idea on how to proceed ? Dont ask me why my data is
formatted like that please... ;-)

Many, Many thanks in advance,
Best Regards
*
*   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