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]
st: Rolling window correlations for all possible pairs of variables
From
<[email protected]>
To
<[email protected]>
Subject
st: Rolling window correlations for all possible pairs of variables
Date
Mon, 13 Aug 2012 11:08:46 +0100
Dear Stata List,
I have a time series dataset consisting of more than several hundreds of variables, and roughly 1500 time points.
I want to calculate rolling window correlations for each possible pairs of the variables, and store the results either in a new data set or generate new variables for each possible combination (for instance for var 1 and var2, it is rho1_2, for var1 and var3 it is rho1_3 and so on). Doing this manually is quite inefficient and time consuming.
I tried to combine "mvcorr" with "by" command however I receive the error message that "mvcorr may not be combined with by".
I also tried to use "rolling" command with the following syntax, however it did not work either.
rolling, window(36) saving("C:file location") : correlate var*
I would appreciate any suggestions.
Regards,
Coskun Tuncer
Please access the attached hyperlink for an important electronic communications disclaimer: http://lse.ac.uk/emailDisclaimer
*
* 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/