
Eu tenho uma tabela como a seguinte:
\begin{table}[htbp]\centering
\caption{Dependent Variable: Enrollment}
\begin{tabular}{c c c c}
\hline\hline
\textbf{Variable} & \textbf{Model 1} & \textbf{Model 2} & \textbf{Model 3}\\ \hline
frl & -0.012 & -0.052 & -0.156** \\
& (0.04) & (0.06) & (0.06) \\
minority & & 0.034 & 0.097* \\
& & (0.05) & (0.04) \\
disting & & & 0.439***\\
& & & (0.06) \\
cons & 0.529***& 0.530***& 0.518***\\
& (0.03) & (0.03) & (0.02) \\
\hline N & 196 & 196 & 196 \\
R$^{2}$ & 0.001 & 0.003 & 0.235 \\
\hline
\end{tabular}
\end{table}
Gostaria de adicionar as estrelas de significância estatística abaixo, mas não consigo adicionar código com três colunas múltiplas. Tentei adicionar o seguinte no final da tabela, mas não parece funcionar:
\bottomrule
\vspace{-3mm}\\
\multicolumn{3}{l}{\textsuperscript{***}$p<0.01$,
\textsuperscript{**}$p<0.05$,
\textsuperscript{*}$p<0.1$,
Como eu poderia adicionar os sobrescritos do texto?
Responder1
Você pode, de fato, usar um \multicolumn
e \addlinespace
do booktabs
pacote:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}[htbp]\centering
\caption{Dependent Variable: Enrollment}
\begin{tabular}{c c c c}
\toprule
\textbf{Variable} & \textbf{Model 1} & \textbf{Model 2} & \textbf{Model 3}\\
\midrule
frl & -0.012 & -0.052 & -0.156** \\
& (0.04) & (0.06) & (0.06) \\
minority & & 0.034 & 0.097* \\
& & (0.05) & (0.04) \\
disting & & & 0.439***\\
& & & (0.06) \\
cons & 0.529***& 0.530***& 0.518***\\
& (0.03) & (0.03) & (0.02) \\
\midrule
N & 196 & 196 & 196 \\
R$^{2}$ & 0.001 & 0.003 & 0.235 \\
\bottomrule
\addlinespace[1ex]
\multicolumn{3}{l}{\textsuperscript{***}$p<0.01$,
\textsuperscript{**}$p<0.05$,
\textsuperscript{*}$p<0.1$}
\end{tabular}
\end{table}
\end{document}
Abaixo há outra possibilidade usando octable
pacote; Usei algumas caixas para especificar a largura dos caracteres sobrescritos:
\documentclass{article}
\usepackage{ctable}
\usepackage{booktabs}
\begin{document}
\ctable[
notespar,
caption={Dependent Variable: Enrollment}
]{c c c c}
{\tnote[*]{$p<0.1$}\tnote[**]{$p<0.5$}\tnote[***]{$p<0.01$}}{
\toprule
\textbf{Variable} & \textbf{Model 1} & \textbf{Model 2} & \textbf{Model 3}\\
\midrule
frl & -0.012 & -0.052 & -0.156\tmark[{\makebox[0pt][l]{**}}] \\
& (0.04) & (0.06) & (0.06) \\
minority & & 0.034 & 0.097\tmark[{\makebox[0pt][l]{*}}] \\
& & (0.05) & (0.04) \\
disting & & & 0.439\tmark[{\makebox[0pt][l]{***}}]\\
& & & (0.06) \\
cons & 0.529\tmark[{\makebox[0pt][l]{***}}]& 0.530\tmark[{\makebox[0pt][l]{***}}]& 0.518\tmark[{\makebox[0pt][l]{***}}]\\
& (0.03) & (0.03) & (0.02) \\
\midrule
N & 196 & 196 & 196 \\
R$^{2}$ & 0.001 & 0.003 & 0.235 \\
\bottomrule}
\end{document}
Sem booktabs
nem ctable
, você pode fazer algo como:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}[htbp]\centering
\caption{Dependent Variable: Enrollment}
\begin{tabular}{c c c c}
\hline\hline
\textbf{Variable} & \textbf{Model 1} & \textbf{Model 2} & \textbf{Model 3}\\
\hline
frl & -0.012 & -0.052 & -0.156** \\
& (0.04) & (0.06) & (0.06) \\
minority & & 0.034 & 0.097* \\
& & (0.05) & (0.04) \\
disting & & & 0.439***\\
& & & (0.06) \\
cons & 0.529***& 0.530***& 0.518***\\
& (0.03) & (0.03) & (0.02) \\
\hline
N & 196 & 196 & 196 \\
R$^{2}$ & 0.001 & 0.003 & 0.235 \\
\hline
\\[-1.75ex]
\multicolumn{3}{l}{\textsuperscript{***}$p<0.01$,
\textsuperscript{**}$p<0.05$,
\textsuperscript{*}$p<0.1$}
\end{tabular}
\end{table}
\end{document}
Responder2
Não há problema em adicionar o conteúdo na parte inferior da célula tabular
, desde que \multicolumn
seja o primeiro elemento de uma célula:
\documentclass{article}
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\begin{document}
\begin{table}[htbp]
\centering
\caption{Dependent Variable: Enrollment}
\begin{tabular}{c r@{}l r@{}l r@{}l}
\toprule
\textbf{Variable} &
\multicolumn{2}{c}{\textbf{Model 1}} &
\multicolumn{2}{c}{\textbf{Model 2}} &
\multicolumn{2}{c}{\textbf{Model 3}} \\
\midrule
frl & $-$0&.012 & $-$0&.052 & $-$0&.156\textsuperscript{**} \\
& (0&.04) & (0&.06) & (0&.06) \\
minority & & & 0&.034 & 0&.097\textsuperscript{*} \\
& & & (0&.05) & (0&.04) \\
disting & & & & & 0&.439\textsuperscript{***} \\
& & & & & (0&.06) \\
cons & 0&.529\textsuperscript{***}& 0&.530\textsuperscript{***}& 0&.518\textsuperscript{***} \\
& (0&.03) & (0&.03) & (0&.02) \\
\midrule
N & 196& & 196& & 196& \\
R$^{2}$ & 0&.001 & 0&.003 & 0&.235 \\
\bottomrule
\multicolumn{3}{l}{\rule{0pt}{1.2\normalbaselineskip}% strut
\textsuperscript{***}$p < 0.01$,
\textsuperscript{**}$p < 0.05$,
\textsuperscript{*}$p < 0.1$}
\end{tabular}
\end{table}
\end{document}
Para manter a consistência, se você estiver usando \textsuperscript
para fazer referência aos componentes abaixo da tabela, os itens também deverão usar \textsuperscript
. Além disso, pode ser interessante alinhar o tabular
conteúdo na vírgula decimal (como fiz acima, usando uma D
coluna de pobre).
Responder3
Dado que as colunas de dados contêm números com decimais, é muito útil para o leitor se os números estiverem alinhados nos marcadores decimais. Isto pode ser conseguido usando o dcolumn
pacote e definindo um tipo de coluna de estilo decimal adequado. Um benefício colateral de usar essa abordagem é que os -
símbolos afixados em números negativos serão compostos como símbolos matemáticos "menos" adequados, em vez de "traços" curtos.
Como já foi apontado nas respostas anteriores, você (i) pode colocar a legenda sobre os erros padrão e níveis de significância em linhas na parte inferior da tabela, colocando as informações em \multicolumn{4}{l}{...}
declarações, e (ii) pode querer usar o booktabs
package e seus comandos \toprule
, \midrule
, etc para obter linhas horizontais bem espaçadas.
\documentclass{article}
\usepackage{booktabs,dcolumn}
\newcolumntype{d}{D{.}{.}{2.5}} % alignment on decimal marker
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % shorthand macro
\begin{document}
\begin{table}
\centering
\caption{Dependent Variable: Enrollment}
\begin{tabular}{l ddd}
\toprule
\textbf{Regressor} & \mc{\textbf{Model 1}}
& \mc{\textbf{Model 2}} & \mc{\textbf{Model 3}} \\
\midrule
frl & -0.012 & -0.052 & -0.156^{**} \\
& (0.04) & (0.06) & (0.06) \\
minority & & 0.034 & 0.097^{*} \\
& & (0.05) & (0.04) \\
disting & & & 0.439^{***}\\
& & & (0.06) \\
cons & 0.529^{***}& 0.530^{***}& 0.518^{***}\\
& (0.03) &(0.03) & (0.02) \\
\midrule
$N$ & \mc{196} & \mc{196} & \mc{196} \\
$R^{2}$ & 0.001 & 0.003 & 0.235 \\
\midrule[\heavyrulewidth]
\multicolumn{4}{l}{(Standard errors in parentheses)}\\
\multicolumn{4}{l}{$^{***}\ p<0.01$; $^{**}\ p<0.05$; $^{*}\ p<0.1$}\\
\end{tabular}
\end{table}
\end{document}