
다음과 같은 테이블이 있습니다.
\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}
아래에 통계적 유의성 별표를 추가하고 싶지만 세 개의 다중 열이 있는 코드를 추가할 수 없는 것 같습니다. 테이블 끝에 다음을 추가하려고 시도했지만 작동하지 않는 것 같습니다.
\bottomrule
\vspace{-3mm}\\
\multicolumn{3}{l}{\textsuperscript{***}$p<0.01$,
\textsuperscript{**}$p<0.05$,
\textsuperscript{*}$p<0.1$,
텍스트위 첨자를 어떻게 추가할 수 있나요?
답변1
실제로 패키지 에서 \multicolumn
및 를 사용할 수 있습니다 .\addlinespace
booktabs
\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}
아래에는ctable
패키지; 위 첨자 문자의 너비를 늘리기 위해 몇 가지 상자를 사용했습니다.
\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}
booktabs
nor 없이 다음 ctable
과 같은 작업을 수행할 수 있습니다.
\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}
답변2
셀의 첫 번째 요소 tabular
인 경우 맨 아래에 내용을 추가하는 데 문제가 없습니다 .\multicolumn
\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}
\textsuperscript
일관성을 위해 표 아래의 구성요소를 참조하기 위해 를 사용하는 경우 항목에도 를 사용해야 합니다 \textsuperscript
. 또한 tabular
내용을 소수점에 정렬하는 것이 흥미로울 수 있습니다 (위에서 가난한 사람의 D
열을 사용하여 수행한 것처럼).
답변3
데이터 열에 소수점이 포함된 숫자가 포함되어 있는 경우 숫자가 소수점 표시에 정렬되어 있으면 독자에게 매우 도움이 됩니다. 이는 패키지를 사용 dcolumn
하고 적절한 10진수 스타일 열 유형을 정의하여 달성할 수 있습니다. 이 접근 방식을 사용하면 -
음수에 붙은 기호가 짧은 "대시"가 아닌 적절한 수학적 "빼기" 기호로 조판된다는 부수적인 이점이 있습니다 .
이전 답변에서 이미 지적했듯이 (i) 정보를 \multicolumn{4}{l}{...}
명령문으로 묶어 표 하단의 행에 표준 오류 및 유의 수준에 대한 범례를 배치할 수 있으며 (ii) 다음을 사용할 수 있습니다. booktabs
패키지 및 해당 명령 \toprule
, \midrule
, 등을 대신 사용하면 간격이 적절한 수평선을 얻을 수 있습니다.
\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}