0
votes

While creating this variable in stata14 I've got an error (198) this is the variable that I want to generate:

g ncskew =(-(([_n])*([_n-1])^(1.5)*(sum(returns^3))))///
/(([_n-1])*([_n-2])*(sum(returns^2)^(1.5))

It is quite a puzzle but I think that the brackets are well placed. Any help or advice would be appreciated.

1
If you want to use observation numbers _n to mean number of observations so far (and I can't make sense of your calculation otherwise) then the square brackets are redundant.Nick Cox

1 Answers

1
votes

The problem that jumps out at my eye is that the /// at the end of the first line is not preceded by any whitespace. That is a syntax error.
The other problem is that you have 13 opening parentheses ( and just 12 closing parentheses ). Is this your actual code or a mis-typed copy?

Whether that are the only problems with your code, I cannot say. If that is your actual code, fix that first and see what happens.