[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: re: how to access e(b) and e(V)

From   Kit Baum <>
Subject   st: re: how to access e(b) and e(V)
Date   Tue, 20 Oct 2009 07:00:17 -0400

Philomela said

I would like to export the coefficient matrix and the variance covariance matrix into excel to do some calculations-i need very exact values, so i can't use the output. Where does Stata store these matrices and how can I access them?

If you want exact computations, stay away from Excel. Just save the matrices as Martin said in matrix b and V and use Stata's matrix language to do the computations you need. Better yet, do it in Mata:

sysuse auto,clear
qui reg price mpg weight turn length
b = st_matrix("e(b)")
V = st_matrix("e(V)")
// these results are held to full internal precision
printf("The first element of b is %20.12f\n",b[1])
printf("The 1,1 element of V is %20.12f\n",V[1,1])
// now do whatever you want to do with b and V in Mata
// the results can be returned to Stata with the st_ functions

Kit Baum   |   Boston College Economics & DIW Berlin   |
An Introduction to Stata Programming |
   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