How to Obtain Asymptotic
Covariance Matrices
quantpsy.org
© 2010-2024,
Kristopher J. Preacher

How to obtain asymptotic covariance matrices
Kristopher J. Preacher (Vanderbilt University)
Patrick J. Curran (University of North Carolina at Chapel Hill)
Daniel J. Bauer (University of North Carolina at Chapel Hill)

Many times throughout these pages we have mentioned the asymptotic covariance matrix, or ACOV matrix. The ACOV matrix is the covariance matrix of parameter estimates. The ACOV matrix is also known variously as the ACM, the VCE (variance-covariance matrix of the estimators), or simply the inverse of the Fisher information matrix (denoted I(q)-1). Elements along the diagonal represent the variance expected of each parameter estimate over repeated sampling, and can be interpreted as indices of precision of estimation. Off-diagonal elements represent covariances of parameter estimates. The standard errors used to conduct significance tests of parameter estimates are simply the square roots of the diagonal elements of the ACOV matrix.

Some (but not all) of the elements of an ACOV matrix are necessary for the computation of standard errors associated with simple intercepts, simple slopes, and simple trajectories. Most statistical software packages provide ACOV matrices, but only if requested to do so. Below are instructions for how to obtain the ACOV matrix in several packages. This list is not exhaustive, but does cover most of the commonly used packages.

Multiple Linear Regression (MLR)

SAS PROC REG

PROC REG can include both /ACOV and /COVB options in the model statement, the latter of which requests the ordinary covariance matrix of estimates. ACOV contains robust asymptotic covariances that account for heterogeneity.

R

If the lm command is used for linear regression, use vcov(object) to obtain the coefficient covariance matrix. The hccm function (type="hc0") of the {car} package can be used to obtain a heteroscedasticity-corrected asymptotic covariance matrix.

Splus

See instructions for R above.

SPSS

In the "Linear Regression" window, click on the "Statistics" button. In the "Regression Coefficients" section, check the box for "Covariance matrix." The ACOV matrix will be included in the output once the regression analysis is run. In order to get variances and covariances associated with the intercept, the user must "trick" SPSS into thinking the intercept is a coefficient associated with a predictor variable. To do this, click on the "Options" button make sure the box marked "Include constant in equation" is not checked. Then create a new variable c, all of whose values are equal to 1.0. Include c as a predictor and run the regression analysis again. The variance and covariances associated with c in the ACOV matrix are those associated with the intercept term.

Stata

The post-estimation command estat vce can be used to obtain the variance-covariance matrix of the estimators after an estimation command such as regress.

Hierarchical Linear / Mixed Effects / Multilevel Modeling (HLM/MLM)

MLwiN

In MLwiN, the asymptotic (co)variances of the fixed parameters are stored in column 1099 of the data spreadsheet, and are updated after every iteration. Those for the random parameters are stored in column 1097. The elements correspond to elements of the lower triangle of the ACOV matrix.

SAS PROC MIXED

Insert "COVB" on the model statement in PROC MIXED.

HLM

Before running the analysis, on the main menu choose Other Settings -> Output Settings and check the appropriate box.

R

If the lmer command is used for multilevel regression, use vcov(object) to obtain the coefficient covariance matrix.

Splus

See instructions for R above.

LISREL

Use the "OPTIONS ACM=YES;" command in the syntax. Two ascii files will be created in the default directory: filename_fixed.acm and filename_random.acm.

SPSS

In SPSS's "Mixed models" analysis dialog, click on the "Statistics" button. Check the box marked "Covariances of parameter estimates." If syntax is used, add the line "/PRINT = COVB ." to the end. Parameter covariances will be reported in the Output window.

Stata

The post-estimation command estat vce can be used to obtain the variance-covariance matrix of the estimators after an estimation command such as mixed.

Latent Growth Curve Modeling / Latent Curve Analysis (LGM/LCA)

AMOS

Using the AMOS Graphics interface, specify the model as you normally would. From the "Analysis properties" menu, click on the "Output" tab. Check the box marked "Covariances of estimates." When the model is run, the ACOV matrix is reported in the output file after the parameter estimates but before model summaries.

lavaan

The command vcov(fit) will obtain the regular ACOV matrix. If you prefer no parameter labels, use vcov(fit, labels=FALSE). If you prefer the regular acov matrix with precise estimates (recommended), use unclass(vcov(fit)). If you call the cfa/sem/growth/lavaan functions with estimator="MLM" or "MLR", you will get the 'robust' ACOV. Or you can set the type manually by using the "se" argument. You can also switch the information matrix (from "expected" to "observed").

LISREL

Using standard LISREL syntax, insert the option "EC" on the output (OU) line. The lower triangular elements of the ACOV matrix will be output to a separate file in free format in scientific notation.

Mx

...

Mplus

Request TECH3 output on the OUTPUT: line. The lower triangular elements of the ACOV matrix will be output to a separate file in free format in scientific notation.

EQS

...

Acknowledgments

Thanks to Dominic Comtois for help with obtaining asymptotic (co)variances in R and Splus, and thanks to 'Alim J. Beveridge for similar help with Stata.

Original version posted September, 2003.