Hi everyone,
I was wondering if I could get help to figure out the problem with one of my commands. I have been over it several times, and it would be great to get another opinion!
I have to calculate bid-ask spread of stocks of 194 companies (company name = ticker), using the first order serial covariance between the returns of the stocks. The returns are calculated using transaction prices, which is the variable close.
The command I am having problem with is:
forvalues i = 1/`N'{
quietly correlate return lreturn if ticker_new==`i', covariance
replace cov_returns = r(cov_12) if ticker_new==`i'
}
You can find the rest of the do-file below
Thank you for your time and help!
Sarika
Array
Related Posts with Invalid Syntax r(198)
Random Effect help needed... Dears, Kindly find my output of the random effect model after determining it by Hausman test. Iam …
Assign string variable to all in groupI would like to assign a string variable to all in a group. I want to be able to assign "IA" if any …
Graphing more than 1 variable in cibar (is this possible?)Greetings, I'm running Stata 15.1 on OSX. I've recently installed the cibar package as other method…
Normalized cross-correlation with time-shiftDear all, I would like to perform normalized cross-correlation with time-shift to explore relations…
Assign variables labels based on values of other variablesDear Statalist, I am working on a dataset as below: Code: * Example generated by -dataex-. To ins…
Subscribe to:
Post Comments (Atom)
0 Response to Invalid Syntax r(198)
Post a Comment