[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: re: betacoef for new variable?
Fabian asked how to get the results from -regress- followed by my -
betacoef- into new variables. One way:
prog drop _all
prog fabian, eclass byable(recall)
version 10
syntax varlist(min=2) [if] [in]
marksample touse
reg `varlist' if `touse'
mat V = e(V)
betacoef
mat bcoef = r(beta)
ereturn post bcoef V
end
use http://fmwww.bc.edu/ec-p/data/hayashi/sheston91.dta,clear
statsby, by(country): fabian rgdppc savrat pop
The new dataset created by -statsby- will contain the beta coefficients.
Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html
*
* 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/