Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Error in function evaluator programs with nl


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Error in function evaluator programs with nl
Date   Wed, 28 Mar 2012 18:15:12 +0100

You refer to `rhoconti' which is not defined. Evidently it should be
`rho_conti'. Similarly for `rhoconta'.

Nick

On Wed, Mar 28, 2012 at 5:32 PM, Guillaume Daudin <[email protected]> wrote:

> 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/

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index