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?
Adding an interaction term into a model or stratifying data , which method is more preferable to analyse interaction terms?Hi Statlists, Hope this post finds you well. May I know why stratification seems to be less prefera…
Help with using expand>2 while replacing values in duplicates generatedHi, I am trying to use the expand command to create duplicates and replacing one of the variables i…
Longitudinal data - generating variables dependent on observations within each subjectHi everyone, I have longitudinal data (see dataex below). I need to censor each id according to a f…
Residuals in a panel data modelHi I am running a regression (using panel data) looking at the effect of income on food consumption …
Marginal effects Tobit (mfx vs margins)Hello I'm trying to calculate the marginal effects of a Tobit model using the margins command instea…
Subscribe to:
Post Comments (Atom)
0 Response to How to calculate a running covarance and store the values?
Post a Comment