Stata: Data Analysis and Statistical Software
   >> Home >> Resources & support >> FAQs >> Obtaining the variance–covariance matrix or coefficient vector

How can I get the variance–covariance matrix or coefficient vector?

Title   Obtaining the variance–covariance matrix or coefficient vector
Author Paul Lin, StataCorp
Date January 1999; minor revisions June 2007

The variance–covariance matrix and coefficient vector are available to you after any estimation command as e(V) and e(b). You can use them directly, or you can place them in a matrix of your choosing.

. matrix list e(V)
. matrix list e(b)
. matrix x = e(V)
. matrix y = e(b)
. matrix z = 0.1 * I(4) + 0.9 * e(V)

The matrix function get (see [P] matrix get) is also available for retrieving these matrices.

You may also access the coefficients and standard errors in expressions by using

. display "The coefficient of mpg = " _b[mpg]
. display "and its standard error = " _se[mpg]
Bookmark and Share 
FAQs
What's new?
Statistics
Data management
Graphics
Programming Stata
Mata
Resources
Internet capabilities
Stata for Windows
Stata for Unix
Stata for Mac
Technical support
Like us on Facebook Follow us on Twitter Follow us on LinkedIn Google+ Watch us on YouTube
Follow us
© Copyright 1996–2013 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index   |   View mobile site