Hello,
I am a new member of this Forum. So, this is my first post.
I am also new in the use of Stata estimation for non-linear models. After reading several examples, I am trying to estimate one via a function evaluator program. Here, it is the code implemented for my model:
capture program drop nlQRE_S
program nlQRE_S
version 13.1
syntax varlist(min=6 max=6) [aw fw] if, at(name)
local p1avg : word 1 of `varlist'
local f1 : word 2 of `varlist'
local f2 : word 3 of `varlist'
local f3 : word 4 of `varlist'
local s2 : word 5 of `varlist'
local s3 : word 6 of `varlist'
// Retrieve parameters out of at matrix
tempname ls lf
scalar `ls' = `at'[1,1]
scalar `lf ' = `at'[1,2]
// Temporary variable
tempvar prob
generate double `prob' = exp(`ls' * `s3')/(exp(`ls' * `s3')+exp(`ls' * `s2')) `if '
// Now fill in dependent variable
replace `p1avg' = exp(` lf' *(`prob' * `f3'+(1-`prob') * `f2'))/(exp(`lf' *(`prob' * `f3'+(1-`prob') * `f2'))+exp(`lf' * `f1')) `if '
end
However, when I use this program, I alway get the following error message:
nlQRE_S returned 198
verify that nlQRE_S is a substitutable expression program
and that you have specified all options that it requires
I have also tried to estimate the CES production function used in the help menu available in Stata for nl (program nlces), I get the same error.
Could anyone give me some ideas in order to figure out where the problem is?
Thanks in advance for your help
Best regards
Abel Lucena
I am a new member of this Forum. So, this is my first post.
I am also new in the use of Stata estimation for non-linear models. After reading several examples, I am trying to estimate one via a function evaluator program. Here, it is the code implemented for my model:
capture program drop nlQRE_S
program nlQRE_S
version 13.1
syntax varlist(min=6 max=6) [aw fw] if, at(name)
local p1avg : word 1 of `varlist'
local f1 : word 2 of `varlist'
local f2 : word 3 of `varlist'
local f3 : word 4 of `varlist'
local s2 : word 5 of `varlist'
local s3 : word 6 of `varlist'
// Retrieve parameters out of at matrix
tempname ls lf
scalar `ls' = `at'[1,1]
scalar `lf ' = `at'[1,2]
// Temporary variable
tempvar prob
generate double `prob' = exp(`ls' * `s3')/(exp(`ls' * `s3')+exp(`ls' * `s2')) `if '
// Now fill in dependent variable
replace `p1avg' = exp(` lf' *(`prob' * `f3'+(1-`prob') * `f2'))/(exp(`lf' *(`prob' * `f3'+(1-`prob') * `f2'))+exp(`lf' * `f1')) `if '
end
However, when I use this program, I alway get the following error message:
nlQRE_S returned 198
verify that nlQRE_S is a substitutable expression program
and that you have specified all options that it requires
I have also tried to estimate the CES production function used in the help menu available in Stata for nl (program nlces), I get the same error.
Could anyone give me some ideas in order to figure out where the problem is?
Thanks in advance for your help
Best regards
Abel Lucena

Comment