[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: extracting coefficients from a linear regression
On Thu, 09 Jun 2005 17:39:45 +0800, David Fisher <firstname.lastname@example.org>
Is there a command in Stata that will store the coefficients (a and b)
from a linear regression in new, separate variables? I've looked at
"predict" and similar, but I can only find how to extract residuals and
Would the following do the job?
. sysuse auto
(1978 Automobile Data)
. regress mpg we
. local b = _b[_cons]
. local a = _b[weight]
. di `a'
. di `b'
* For searches and help try: