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

Re: st: extracting coefficients from a linear regression


From   Antoine Terracol <[email protected]>
To   [email protected]
Subject   Re: st: extracting coefficients from a linear regression
Date   Thu, 09 Jun 2005 12:00:18 +0200

le 09/06/2005 11:39, David Fisher a ecrit :
Hi!
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 fitted values.
Thanks!
David Fisher


Stata stores estimated coefficients in a vector named e(b)
you can then use -svmat- to store its elements as new variables :

. reg pric mpg weight
. mat beta=e(b)
. svmat double beta, names(matcol)

will store estimated coefficients as new (double precision) variables named after the X variables.

best,
Antoine

--
Ce message a �t� v�rifi� par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a �t� trouv�.

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