Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: constant in nonlinear squares


From   "Brian P. Poi" <[email protected]>
To   [email protected]
Subject   Re: st: constant in nonlinear squares
Date   Wed, 4 Apr 2007 08:10:17 -0500 (CDT)

On Tue, 3 Apr 2007, Maritza Sotomayor wrote:

Thank you Brian,
It worked fine with the option hasconstant(xb_constante). But when I
compared the results with my other alternative (just include
"constante" as variable without hasconstant option) I got the same
result.
I'd like to be sure if I am using the substitutable expression option
correctly. What I have to specify is a logistic function like this:
y = 1/1+exp(-bX)
where b is a parameter vector with X vector of independent
variables(eight). So I am not sure if using linear combination xb
-{eqname:varlist}- was correct.
This is what I used:
nl (iitt = 1/(1+exp(-1*{xb: lavrgdp ldpcgdp ltc lroyalsale latarif
lagi lavgest ldcap})))  nolog
What do you think my mistake was?
Maritza Sotomayor

Maritza,

When you do not specify the hasconstant() option, -nl- will try to determine whether your function has a constant term automatically. Since your constante variable is equal to one for all observations, -nl- correctly identified its parameter as being a constant term. You typically don't need to use the hasconstant() option; -nl- will find the constant for you. The only time -nl- has trouble finding a constant term is when the data is badly scaled and a variable has a very small (but nonzero) variance.

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




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index