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! My commands are written to find the first order serial covariance of the returns (Which are found using transaction prices of stocks, variable = close). The covariance is used to calculate the bid-ask spread using the Roll model in Finance.
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)
How to declare "string" condition in If conditionHello, I am newbie in Stata and I have a problem with stata when I try to declare If condition. In…
Creating a forvalue with several i (or; Generating a new variable with forvalue)Dear all, I'm trying to create several variables, called Pv1, PV2, PV3, PV4, PV5. I could explain a…
Panel data analysisHi everyone, Need help with analysing this data. A description of the data: Individuals are biannua…
rank problemhello teacher I have a question need help, I want to simulate the SAS code to separate "size" to two…
egen, group, label - "r(132), too few quotes"Hello, I have a string variable, to which I would like to assign numerical values. It has too many …
Subscribe to:
Post Comments (Atom)
0 Response to Invalid Syntax r(198)
Post a Comment