I am trying to use nlsur (Non-Linear SUR) for a system of five equations to find out price flexibility. I followed the examples in the stata manual and Stata publication by Poi 2008 to code my program. However, in the examples, they all used only price, quantity variables. I am trying to include some seasonal variables to control for any effect of season on the quantity harvested and included as factor variables. When I ran the program, it proceeds the process fine, but when I call the program for evaluating the coefficients, I got an error saying that: factor variables and time-series operators are not allowed. I browsed for any help online and I found a FAQ from Stata for dealing such errors. The FAQ explains that from version 11 or higher sometimes Stata wont recognize time and factor variables and therefore suggested to use fv in syntax statement, but the effort was in vain. Can anybody help me figure out what is the real problem that I am facing?
capture program drop nlsuriaidsq
program nlsuriaidsq
version 11
syntax varlist(min=34 max=34 ts fv) if, at(name)
tokenize `varlist'
args dep_var1 dep_var2 dep_var3 dep_var4 q_1 q_2 q_3 q_4 q_5 inc lagq_1 lagq_2 lagq_3 lagq_4 lagq_5 feb mar apr may jun jul aug sep oct nov dec tksgvng xmas
tempname a1 a2 a3 a4 a5
scalar `a1' = `at'[1,1]
scalar `a2' = `at'[1,2]
scalar `a3' = `at'[1,3]
scalar `a4' = `at'[1,4]
scalar `a5' = 1-`a1'-`a2'-`a3'-`a4'
.....................
Thanks
Pratheesh
capture program drop nlsuriaidsq
program nlsuriaidsq
version 11
syntax varlist(min=34 max=34 ts fv) if, at(name)
tokenize `varlist'
args dep_var1 dep_var2 dep_var3 dep_var4 q_1 q_2 q_3 q_4 q_5 inc lagq_1 lagq_2 lagq_3 lagq_4 lagq_5 feb mar apr may jun jul aug sep oct nov dec tksgvng xmas
tempname a1 a2 a3 a4 a5
scalar `a1' = `at'[1,1]
scalar `a2' = `at'[1,2]
scalar `a3' = `at'[1,3]
scalar `a4' = `at'[1,4]
scalar `a5' = 1-`a1'-`a2'-`a3'-`a4'
.....................
Thanks
Pratheesh
Comment