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)
sivqr now on SSC (for IV quantile regression)The command sivqr (smoothed instrumental variables quantile regression) is now available on SSC, tha…
varsoc with logarithms variablesI've transformed my variables into logarithms to analyze their elasticities, when I run the command …
Labelling group patterns in concatenated variableGood morning. I would like some help regarding how to label concatenated variables. I have almost 40…
Create variables with loopHi, i would like to create some variables with loop. I have 5 variables : switch1 / switch2 /.../ sw…
Solving complex equations with STATADear Statalists, can anybody help me solve equations with STATA? In particular, I have one equation …
Subscribe to:
Post Comments (Atom)
0 Response to Invalid Syntax r(198)
Post a Comment