»  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

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 access the coefficients and standard errors in expressions by using

. display "The coefficient of mpg = " _b[mpg]
. display "and its standard error = " _se[mpg]

You may also display the covariance or correlation matrix of the parameter estimates of the previous model by using

. estat vce
. estat vce, correlation





The Stata Blog: Not Elsewhere Classified Find us on Facebook Follow us on Twitter LinkedIn YouTube Instagram
© Copyright 1996–2023 StataCorp LLC   •   Terms of use   •   Privacy   •   Contact us