| |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: constant in nonlinear squares
On Tue, 3 Apr 2007, Maritza Sotomayor wrote:
Dear statalist members:
I'm trying to include a constant in a nonlinear function. I used the
substitutable expression with Model 2 option -hasconstant- which
needs a parameter. I generated a constant variable (column of ones,
called constante) but I get an error r(498) "constante not found
among parameters".
-nl (iitt = 1/(1+exp(-1*{xb: constante lavrgdp ldpcgdp ltc
lroyalsale latarif lagi lavgest ldcap}))), nolog
hasconstant(constante)-
constante not found among parameters
check hasconstant() option or try using nl without it
r(498);
Maritza,
The hasconstant() option expects the name of a parameter, not the name of
a variable. Since you are using the notation {eqname:varlist} to specify
a linear combination, in your case the parameter on the variable named
constante will be xb_constante. Thus, you would type
. nl ... , hasconstant(xb_constante)
Hope this helps
-- Brian Poi
-- [email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/