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

Re: st: nonlinear least square


From   austin nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: nonlinear least square
Date   Mon, 22 Aug 2005 13:47:26 -0400

First, type -whelp nl- then...

Try saving the following as nlclot.ado
**********************************
program define nlclot
            if "`1'" == "?" {
                global S_1 "B0 B1 B2"
                global B0=-10
                global B1=.2
                global B2=1
                exit
            }
            replace `1' =($B0+($B1)*`2'^($B2))
        end
**********************************

and try, e.g.

. clear
. set obs 100
. gen hpe=uniform()*100
. gen spe=uniform() + .19*(hpe+uniform())^2
. nl clot spe hpe


On 8/22/05, lapetitemoi93 <lapetitemoi93@yahoo.fr> wrote:
> --- In statalist@yahoogroups.com, "Brian P. Poi" <bpoi@s...> wrote:
> > On Mon, 22 Aug 2005, clothilde dufort wrote:

> > > I am trying to estimate the follwing non linear
> > > equation :
> > >
> > > spe=alpha + beta*hpe^gamma

> yes you're right I am using stata8. if somebody could help...
> I find nothing on statalist or even the net, about this.
> thanks a lot
> 
> clothilde

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index