Statalist


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

st: Correlation matrix on a subset of panel data


From   John Hund <[email protected]>
To   [email protected]
Subject   st: Correlation matrix on a subset of panel data
Date   Fri, 15 Feb 2008 02:18:22 -0600

I have what is probably a very simple question. I have a panel data set that contains company identifiers and monthly returns (among other things) and I need to generate a correlation matrix of the returns over a specific time period. The data is already tsset with panelid and a datevar. I'm pretty sure that my problem is just that I don't know how to correctly specify the "variables" that get passed to something like corr or pwcorr, since these are each the intersection of the return and a particular firm identifier. I've been thinking of using by or foreach, but in some cases there could be 200-300 firms in each subset. Help?

Thanks,
John

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index