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]

st: Rolling window correlations for all possible pairs of variables


From   <A.C.Tuncer@lse.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index