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
Generate new variable by groupsHello I have one problem, I need to create a new variable: I have a dataset with the id of groups o…
RoundsHi, I have conducted propensity score matching using working hours as my treatment variable and the…
Subinstr() returns "invalid syntax" within foreach loopHi, I've tried to run this code multiple times with many adjustments, I also tried the solutions to…
sample size for specificty/sensitivityHi all, I would like to conduct a study to investigate the potential use of a protein (continuous) i…
Error with tab2xlHi, I am using tab2xl command in Stata 15 and would want to save the excel file using today's date.…
Subscribe to:
Post Comments (Atom)
0 Response to Compute covariance and store in column
Post a Comment