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
Rangestat for leave-out mean----------------------- copy starting from the next line ----------------------- Code: * Example ge…
renaming several variables in loop to reshape by categoryi have several variables that i want to rename according to their category for example S2_Q1P- S2_Q7…
PSA: I need an Econometrics tutor asap $30/hrSomebody please help me study for a test ( undergrad ). I'm an adult, just went back to school durin…
Small question on bar chartsI want to draw a hbar chart with three variables via the following command: graph hbar incomep90 inc…
Convert Long String Order to Time IndexSo this is a separate question following from my last post. It is in regards to the same variable "q…
Subscribe to:
Post Comments (Atom)
0 Response to cross-correlations in long format
Post a Comment