Hi,
I am using function evaluator program for an nl command, and would like to call in an external dataset that's not called in by nl command in the function evaulator program by merge command. However, whenever I put in merge command inside the function evaluator program, I get the error message
If I do not include the boldface part in the function evaluator program, the nl command would work and give me estimates, but once I include those commands, the error message appears. I would appreciate any ideas and suggestions. Thank you.
Sincerely,
Soo
I am using function evaluator program for an nl command, and would like to call in an external dataset that's not called in by nl command in the function evaulator program by merge command. However, whenever I put in merge command inside the function evaluator program, I get the error message
nlauto_extdta2 returned 110Here's the code I used:
starting values invalid or some RHS variables have missing values
r(480);
program nlauto_extdta2where I execute this program with the following commands:
syntax varlist(min=4 max=4) [aw fw iw] if, at(name)
local price: word 1 of `varlist'
local cons: word 2 of `varlist'
local x: word 3 of `varlist'
local id: word 4 of `varlist'
*parameters
forvalues i = 1(1)2{
tempname b`i'
scalar `b`i'' = `at'[1,`i']
}
merge 1:1 id using autodata.dta
assert _merge==3
replace `x' = x `if'
replace `price' = `b1'*`cons' + `b2'*`x' `if'
end
sysuse auto, clear
gen id=_n
gen x=uniform()
keep id x
save autodata.dta, replace
sysuse auto, clear
gen cons = 1
gen id=_n
gen x=uniform()
matrix ivals = J(1,2,1)
do nlauto_extdta2.do
nl auto_extdta2 @ price cons x id, nparameters(2) initial(ivals)
If I do not include the boldface part in the function evaluator program, the nl command would work and give me estimates, but once I include those commands, the error message appears. I would appreciate any ideas and suggestions. Thank you.
Sincerely,
Soo
Comment