\documentclass[11pt]{article} \usepackage{stata} \begin{document} \section{Displaying Matrices} \subsection{Example 2: Regression and Variance-Covariance Matrix} To display the regression result in \LaTeX format, we can use Stata command {\tt outtex}. The code for generating variance-covariance matrix after regression can be produced by {\tt outtable} command. \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 ------------------------------------------------------------------------------ . outtex %------- Begin LaTeX code -------% { \begin{table}[htbp]\centering \caption{Estimation results : regress \label{tabresult regress}} \begin{tabular}{l c c }\hline\hline \multicolumn{1}{c} {\textbf{Variable}} & {\textbf{Coefficient}} & \textbf{(Std. Err.)} \\ \hline math & 0.397 & (0.066)\\ female & 5.443 & (0.935)\\ read & 0.325 & (0.061)\\ Intercept & 11.896 & (2.863)\\ \hline \end{tabular} \end{table} } %------- End LaTeX code -------% . matrix v=e(V) . outtable using table2, mat(v) nobox caption("Variance-Covariance Matrix") format(%6.4f) \end{verbatim} \end{small} Here is the real output in \LaTeX format. \begin{table}[htbp]\centering \caption{Estimation results : regress \label{tabresult regress}} \begin{tabular}{l c c }\hline\hline \multicolumn{1}{c} {\textbf{Variable}} & {\textbf{Coefficient}} & \textbf{(Std. Err.)} \\ \hline math & 0.397 & (0.066)\\ female & 5.443 & (0.935)\\ read & 0.325 & (0.061)\\ Intercept & 11.896 & (2.863)\\ \hline \end{tabular} \end{table} \input{table2} \end{document}