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

st: b-coeff, p-values from foreach regression


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: b-coeff, p-values from foreach regression
Date   Tue, 23 Nov 2004 21:11:29 -0500

sysuse auto
mat res = J(5,2,0)
local i 0
foreach v of varlist headroom-turn {
        qui reg price `v'
        local ++i
        mat res[`i',1] = _b[`v']
        mat res[`i',2] = 2*ttail(e(df_r),_b[`v']/_se[`v'])
        local rl "`rl' `v'"
        }
mat rownames res = `rl'
mat colnames res = Coeff  p-value
mat list res, f(%9.3f)


Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.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/



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