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)
Changing dates from "dd/mm/yyyy 00:00" to "yyyy mm"Dear all, I am working with a large dataset of nearly 3 million observations on house prices in the…
Transforming dataset into a panel datasetDear STATA-Users, I am working on a data set which currently looks like that: (The data is sorted a…
reghdfe makes Mata forget Mata functionsHi, I am a beginner with Mata and also have not written Stata programs (.ado files). Inside a large…
Using strings in a Stata dataset as filenamesI have a dataset with 1 column. This one column contains file names with their proper directory pref…
Interpretation of interaction terms in OLSDear StataList Members, I am trying to estimate the household composition for female children in th…
Subscribe to:
Post Comments (Atom)
0 Response to Invalid Syntax r(198)
Post a Comment