Hi,
I have panel data, permno is my panel variable. I want to create covariance between returns and lag_returns for each permno and store the values in a new column. I have data of 1 year for each panel variable. I don't want to get 1 covariance figure for each permno. Instead, for a given permno and date, I want to calculate covariance for the values till that specific date.
For example, if permno=10001 and date=date=19900111, my covariance figure should be cov (returns, lag_returns) for the period date=19900102-19900111
Thank you
Related Posts with How to calculate a running covarance and store the values?
Joint coefficientsDear Statalist users, This is my first post here and sorry in advance if the post does not fully com…
splitting stringDear all, I am wondering how to split data from a long string on the comma (like for example: Colru…
Lagged time dummies, panel regressionHello all, I am trying to estimate a panel regression measuring the effect of different events on d…
Random sample by unique observationsHello Statlists, I'm currently struggling with my dataset. I have a large dataset of around 7 000 0…
Using Outreg2 with multiple regressions nested in a foreach loopI am running a couple of regressions that I have nested in a `foreach' loop but I want the regressio…
Subscribe to:
Post Comments (Atom)
0 Response to How to calculate a running covarance and store the values?
Post a Comment