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)
How to edit the height of a bar graph ?Hello dear community, I would like to edit the height of a stacked bar graph I construct. Here is th…
Reverse geocoding with geoinpoly gives inaccurate results helpHello, I am trying to use geoinpoly to extract countries from coordinates. I am using the 'PDSI - M…
convert string to date: some observations are missing valuesDear Stata Users I am converting string to date variable running the following code: Code: gen da…
outreg2 drop supress model number (1) (2) etc.Dear all, I am generating tables to go in a paper for publication and I am using outreg2 to group a…
Finding difference in prevalence between yearsI have a dataset of all cases of a specific disease, pemphigus, for 10 years and am using survey wei…
Subscribe to:
Post Comments (Atom)
0 Response to Invalid Syntax r(198)
Post a Comment