\documentclass[11pt]{article} \usepackage{stata} \begin{document} \section{Displaying Matrices} \subsection{Example 1: Displaying Variance-Covariance Matrix} To display the variance-covariance matrix after the linear regression command, we can first generate a matrix to be the variance-covariance matrix and then use the {\tt outtable} command to generate the \LaTeX code for it. \begin{small} \begin{verbatim} . regress write math female read Source | SS df MS Number of obs = 200 -------------+------------------------------ F( 3, 196) = 72.52 Model | 9405.34864 3 3135.11621 Prob > F = 0.0000 Residual | 8473.52636 196 43.2322773 R-squared = 0.5261 -------------+------------------------------ Adj R-squared = 0.5188 Total | 17878.875 199 89.843593 Root MSE = 6.5751 ------------------------------------------------------------------------------ write | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- math | .3974826 .0664037 5.99 0.000 .266525 .5284401 female | 5.44337 .9349987 5.82 0.000 3.59942 7.287319 read | .3252389 .0607348 5.36 0.000 .2054613 .4450166 _cons | 11.89566 2.862845 4.16 0.000 6.249728 17.5416 ------------------------------------------------------------------------------ . matrix v=e(V) . outtable using table1, mat(v) \end{verbatim} \end{small} \input{table1} \end{document}