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, 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   <>
To   <>
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.
Coskun Tuncer

Please access the attached hyperlink for an important electronic communications disclaimer:

*   For searches and help try:

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