[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: re: betacoef for new variable?

From   Kit Baum <>
Subject   st: re: betacoef for new variable?
Date   Fri, 21 Mar 2008 09:38:34 -0400

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)
mat bcoef = r(beta)
ereturn post bcoef V

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
An Introduction to Modern Econometrics Using Stata:

* For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index