Hi guys, I am currently working on a dataset in long format and I need the average corss-correlation of all variables. I have tried to convert the dataset from long to wide using the reshape code but Stata returns 'values of variable t not unique within firmid'. I also tried it with a loop with the command xcorr, but I cannot find the correct way to do it. Can someone please help me?
The dataset looks like this:
firmid t return
1 -20 0,02
1 -19 -0,1
1 -18 0,014
1 -17 etc.
2 -20
2 -19
2 -18
2 -17
etc...
So I need the average cross-correlation at time -20, the average cross-correlation at time -19 etc stored as a new variable.
Huub
Related Posts with cross-correlations in long format
Calculating annual visit using visit dateHi there! I am a rather novice Stata user doing an MPH. I am using Stata 15 IC on Windows 10; my da…
Running regression based on size each yearDear Experts, I have an unbalanced panel data of all NYSE, AMEX and NASDAQ firms from 1998 to 2018.…
Difference between poisson model with exposure and modelling rates implicitly?Dear Statalists, I trying to understand the difference between using an exposure in a poisson model…
Robust Estimation - VAR modelHello all, How do I perform robust estimation in VAR to correct for presence of any heteroskedastic…
generate varialbe on the conditionHi , I want to generate the variable only up the condition of another variable here, local 38"phon…
Subscribe to:
Post Comments (Atom)
0 Response to cross-correlations in long format
Post a Comment