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)
help with egen commandI am trying to look at labor division by gender in a household. my data set has collected the member…
Lead variable in unbalanced panel dataHi All, I have annual data on the sales revenue of firms. I have the year variable as follows: year …
Getting standard output of shell command into logI'd like to capture the output of shell commands in the Stata log. For example I tried: Code: log u…
Interval Regression with Instrumental VariableHello! I am trying to estimate the causal effect of certain individual characteristics on the outco…
Problems with Outreg2 for my dissertationHello, I am having some problems running my code in stata. The code is as follows: regress dependen…
Subscribe to:
Post Comments (Atom)
0 Response to Invalid Syntax r(198)
Post a Comment