[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: Stata command for parameter calculation with least square method?
In addition to the -nl- suggestion, you could also take logs of x and y and
use -regress- , adding the -noconstant- option for your first example. It
depends on how you think the error term is best represented since taking
logs makes the error multiplicative (which often makes sense for equations
of the sort you show).
----- Original Message -----
From: "Tobias Pfaff" <email@example.com>
Sent: Thursday, March 01, 2007 6:02 AM
Subject: st: Stata command for parameter calculation with least square
for given data points I want to find out a parameter for a function such
that the function fits best to the data points.
The function would be: f(x)=x^alpha.
The data points are:
I know how I could do that with the least square method and the Excel
Which Stata command would deliver the same result? Is _reg3_ the
command? How would the command line look like?
Furthermore, I want to do the same with 2 unknown parameters, e.g. for the
function f(x)=-k*(-x)^alpha. Which command would be appropriate for 2
unknown parameters (here: k and alpha)?
* For searches and help try: