Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Error in function evaluator programs with nl


From   Guillaume Daudin <gdaudin@mac.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Error in function evaluator programs with nl
Date   Wed, 28 Mar 2012 18:32:07 +0200

Dear stata list users,

I do not seem to be able to create a function evaluator program. I suppose I am missing something obvious…

Here is the program :

capture program drop nltc_add
program nltc_add
version 11
	syntax varlist (min=4 max=4) if, at(name)
	local prix_trsp21       : word 1 of `varlist'
	local prix_fob1         : word 2 of `varlist'
	local dist1     		: word 3 of `varlist'
	local contig1 			: word 4 of `varlist'

	tempname rho_ice rho_add rho_conti rho_conta
	scalar `rho_ice'=`at'[1,1]
	scalar `rho_add'=`at'[1,2]
	scalar `rho_conti'=`at'[1,3]
	scalar `rho_conta'=`at'[1,4]
	replace `prix_trsp21'= `dist1'^`rho_ice'*`rhoconti'*`contig1'+`dist1'^`rho_add'*`rhoconta'*`contig1'/`prix_fob1' `if'  
end

But running : 

nl tc_add @ prix_trsp21 prix_fob1 dist1 contig1, parameters(rho_ice rho_add rho_conti rho_conta) initials(rho_ice 0.1 rho_add 0.3 rho_conti 0 rho_conta 0)

gives me a r(198) error:

nltc_add returned 198
verify that nltc_add is a function evaluator program

Thanks in advance for any help ! 

Best,

Guillaume Daudin



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index