Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: nonlinear least square

From   clothilde dufort <>
Subject   st: nonlinear least square
Date   Mon, 22 Aug 2005 17:04:58 +0200 (CEST)


I am trying to estimate the follwing non linear
equation :

spe=alpha + beta*hpe^gamma

so I use the function "nl" in stata and before I write
the following program.


program nlsal, rclass

syntax varlist(min=2 max=2) [aw fw iw] if

local lhs: word 1 of `varlist'

local rhs: word 2 of `varlist'

regress `lhs' `rhs' [`weight'`exp'] `if'

tempname a b

scalar `a' = _b[_cons]

scalar `b' = _b[`rhs']

return local eq "`lhs' =

return local title "`lhs' = alpha+beta*`rhs'^gamma"



and then i write :

nl sal: spe hpe

but stata reply  :

: invalid name
nlsal: refused query, rc=198

I really don't see what's wrong with my program. If
anybody has an idea, please...



Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
TÚlÚchargez cette version sur
*   For searches and help try:

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