\documentclass[12pt]{article} \newcommand{\bs}{$\backslash$} \thispagestyle{empty} \begin{document} \section{Tabstat in \LaTeX using {\tt latabstat} Command} \noindent Example 1: Group means of variables \begin{small} \begin{verbatim} . tabstat math write read, by(female) Summary statistics: mean by categories of: female (Gender) female | math write read -------+------------------------------ male | 52.94505 50.12088 52.82418 female | 52.3945 54.99083 51.73394 -------+------------------------------ Total | 52.645 52.775 52.23 -------------------------------------- . latabstat math write read, by(female) \begin{table}[htbp]\centering \caption{\label{} \textbf{} }\begin{tabular} {@{} l r r r @{}} \\ \hline \textbf{female } & \textbf{ math} & \textbf{ write} & \textbf{ read} \\ \hline male & 52.94505 & 50.12088 & 52.82418 \\ female & 52.3945 & 54.99083 & 51.73394 \\ Total & 52.645 & 52.775 & 52.23 \\ \hline \multicolumn{4}{@{}l}{ \footnotesize{\emph{Source:} http://www.ats.ucla.edu/stat/stata/notes/hsb2.dta}} \end{tabular} \end{table} \end{verbatim} \end{small} \begin{table}[htbp]\centering \caption{\label{} \textbf{} }\begin{tabular} {@{} l r r r @{}} \\ \hline \textbf{female } & \textbf{ math} & \textbf{ write} & \textbf{ read} \\ \hline male & 52.94505 & 50.12088 & 52.82418 \\ female & 52.3945 & 54.99083 & 51.73394 \\ Total & 52.645 & 52.775 & 52.23 \\ \hline \multicolumn{4}{@{}l}{ \footnotesize{\emph{Source:} http://www.ats.ucla.edu/stat/stata/notes/hsb2.dta}} \end{tabular} \end{table} \end{document}