My data are the following. I want to compute the covariance of dclose and dclose_lag for each ticker2.
have 194 tickers so I need 194 covariances.
How can I create a column consisting of the covariances?
I have already computed the variance for the first ticker2, but I can not create a loop.
That is the command i used to compute the covariance for the 1st ticker2:
correlate dclose dclose_lag if ticker2==1, covariance
gen float covname = r(cov_12)
[ATTACH=CONFIG]temp_12655_1543336407433_604[/ATTACH]
Related Posts with Compute covariance and store in column
Model fit stattitics for GSEMHello,
I am using Stata 15.1 to run gsem to test a panel data mediational model. I want to know wha…
Does my command fit with my intention in DiD? Multiple treatment periodsDear Statalist Community,
I am a newbie and (not yet ) an expert since this is my first time deali…
Unable to load Excel file. Error: element not found.Hi everyone!
I am trying to import an excel file from a shared folder on Dropbox into Stata and I g…
Publishable tables of regression results beside originals entered by handDear Readers
I want to produce quite a number of tables which compare original regression results i…
help with t tests and summary statisticsI suspect I am asking something quite simple, however after reviewing the ttest help file I am still…
Subscribe to:
Post Comments (Atom)
0 Response to Compute covariance and store in column
Post a Comment