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: Correlation between stocks


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Correlation between stocks
Date   Thu, 6 Sep 2012 09:24:56 +0100

You must -reshape- first to get different stock values as variables.

. reshape wide value , i(date) j(stock) string

Nick

On Thu, Sep 6, 2012 at 9:11 AM, André Gyllenram <a_gyllenram@hotmail.com> wrote:
>
>
> Hello,
>
>
>
> I want to compute the correlation
> between different stocks. My data is in this format:
>
>
>
> STOCK      VALUE     DATE
>
> Stock1       7       20000101
>
> Stock1       9       20000102
>
> Stock2       19      20000101
>
> Stock2       66      20000102
>
> Stock3       44      20000101
>
> Stock3       88      20000102
>
> Stock183     55      20000101
>
> Stock183     51      20000102
>
>
>
>
> I want to compute the correlation between Stock1 and
> Stock2,  Stock1 and Stock3, Stock3 and Stock2 and so on. Anyone knows how
> to do this?
>
>
>
> Kind regards
>
> Andre Gyllenram
>
>
> *
> *   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