표 형식(다중 열)을 지정하는 데 도움이 필요합니다.

표 형식(다중 열)을 지정하는 데 도움이 필요합니다.

저는 정치학 전공 학부생이지만 LaTeX 조판은 초보자입니다. 제가 어리석게 들렸다면 용서해주세요.

나는 내가 수행한 회귀 분석에서 얻은 결과를 보고하기 위해 테이블을 구성하고 있었습니다. 설명 셀을 보고된 결과와 정렬하는 데 도움이 필요합니다.

예를 들어, 지금 가지고 있는 테이블 출력은 다음과 같습니다.

여기에 이미지 설명을 입력하세요

보시다시피, 예를 들어 열 2, 3, 4의 셀은 열 1의 설명과 올바르게 정렬되지 않습니다. 위쪽 및 아래쪽으로 기울어진 부분이 많이 있는데 이를 바로잡고 싶습니다.

다음은 제가 현재 사용하고 있는 코드입니다. 누군가 코드 자체에 대해 안내해 주시면 정말 감사하겠습니다.

\begin{tabular}{@{}llll@{}}
\multicolumn{4}{c}{\textbf{\begin{tabular}[c]{@{}c@{}}Table 3. OLS (Ordinary Least Square) Regression Analysis Between \\ Development Indicators\\ And Infant Mortality Rate In India\end{tabular}}} \\ \midrule
\multicolumn{1}{c}{\multirow{2}{*}{Independent Variables}} & \multicolumn{3}{c}{Infant Mortality Rate} \\ \cmidrule(l){2-4} 
\multicolumn{1}{c}{} & \multicolumn{1}{c}{Model 1} & \multicolumn{1}{c}{Model 2} & \multicolumn{1}{c}{Model 3} \\ \midrule
\textit{1. Health Inputs, Access, and Participation} &  &  &  \\
Percent Mothers Receiving Antenatal Care & \begin{tabular}[c]{@{}l@{}}-0.2568*\\ (0.1146)\end{tabular} & \begin{tabular}[c]{@{}l@{}}-0.2474*\\ (0.0896)\end{tabular} & \begin{tabular}[c]{@{}l@{}}-0.2969**\\ (0.0851)\end{tabular} \\
Percent Mothers Receiving JSY & \begin{tabular}[c]{@{}l@{}}0.3005**\\ (0.0860)\end{tabular} & \begin{tabular}[c]{@{}l@{}}0.2952***\\ (0.0735)\end{tabular} & \begin{tabular}[c]{@{}l@{}}0.3004***\\ (0.0751)\end{tabular} \\
Avg. Delivery Expenditure (Rs.) & \begin{tabular}[c]{@{}l@{}}-0.0018*\\ (0.0008)\end{tabular} & \begin{tabular}[c]{@{}l@{}}-0.0018*\\ (0.0008)\end{tabular} & \begin{tabular}[c]{@{}l@{}}-0.0024**\\ (0.0007)\end{tabular} \\
\textit{2. Social Indicators} &  &  &  \\
Percent Adult Females Literate & \begin{tabular}[c]{@{}l@{}}-0.0154\\ (0.2128)\end{tabular} & \multicolumn{1}{c}{—} & \multicolumn{1}{c}{—} \\
Percent Children Underweight & \begin{tabular}[c]{@{}l@{}}0.2440\\ (0.2318)\end{tabular} & \begin{tabular}[c]{@{}l@{}}0.2468\\ (0.1655)\end{tabular} & \multicolumn{1}{c}{—} \\
\textit{3. Modernization Indicators} &  &  &  \\
NSDP Per Capita (Rs.) & \begin{tabular}[c]{@{}l@{}}0.73e-05\\ (0.3e-04)\end{tabular} & \multicolumn{1}{c}{—} & \multicolumn{1}{c}{—} \\
Percent Households using Water Source & \begin{tabular}[c]{@{}l@{}}0.0114\\ (0.1912)\end{tabular} & \multicolumn{1}{c}{—} & \multicolumn{1}{c}{—} \\ \midrule
F-statistic & 10.91*** & 21.60*** & 26.80*** \\
R-squared & 0.7763 & 0.7756 & 0.7557 \\
Intercept Estimate & 28.80 & 29.37 & 39.56 \\
N & 30 & 30 & 30 \\ \midrule
\multicolumn{4}{l}{\begin{tabular}[c]{@{}l@{}}Note: Coefficients are unstandardized and include standard error in parentheses\\ \\ * p \textless 0.05\\ ** p \textless 0.01\\ *** p \textless 0.001\end{tabular}} \\ \bottomrule
\end{tabular}

다시 한 번 정말 감사드립니다!!

답변1

여기에 이미지 설명을 입력하세요

\documentclass{article}
\usepackage{booktabs}
\usepackage{multirow}
\begin{document}

\begin{table}
\caption{OLS (Ordinary Least Square) Regression Analysis Between Development Indicators And Infant Mortality Rate In India}
\label{key}
\setlength{\tabcolsep}{0pt}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}llll}
\toprule
\multicolumn{1}{c}{\multirow{2}{*}{Independent Variables}} & \multicolumn{3}{c}{Infant Mortality Rate} \\ 
\cmidrule(l){2-4} 
 & \multicolumn{1}{c}{Model 1} & \multicolumn{1}{c}{Model 2} & \multicolumn{1}{c}{Model 3} \\ 
\midrule
\textit{1. Health Inputs, Access, and Participation}                                                \\
Percent Mothers Receiving Antenatal Care & -0.2568* & -0.2474*              & -0.2969**             \\
                                         & (0.1146) &  (0.0896)             & (0.0851)              \\
Percent Mothers Receiving JSY            & 0.3005** & 0.2952***             & 0.3004***             \\
                                         & (0.0860) & (0.0735)              & (0.0751)              \\
Avg. Delivery Expenditure (Rs.)          & -0.0018* & -0.0018*              & -0.0024**             \\
                                         & (0.0008) & (0.0008)              & (0.0007)              \\
\textit{2. Social Indicators}  \\
Percent Adult Females Literate           & -0.0154  & \multicolumn{1}{c}{—} & \multicolumn{1}{c}{—} \\
                                         & (0.2128) &                                               \\
Percent Children Underweight             & 0.2440   & 0.2468                & \multicolumn{1}{c}{—} \\
                                         & (0.2318) & (0.1655)                                      \\
\textit{3. Modernization Indicators} \\
NSDP Per Capita (Rs.)                    & 0.73e-05 & \multicolumn{1}{c}{—} & \multicolumn{1}{c}{—} \\
                                         & (0.3e-04)                                                \\
Percent Households using Water Source    & 0.0114   & \multicolumn{1}{c}{—} & \multicolumn{1}{c}{—} \\ 
                                         & (0.1912) \\ 
\midrule
F-statistic                              & 10.91*** & 21.60***              & 26.80***              \\
R-squared                                & 0.7763   & 0.7756                & 0.7557                \\
Intercept Estimate                       & 28.80    & 29.37                 & 39.56                 \\
N                                        & 30       & 30                    & 30                    \\ 
\midrule
\end{tabular*}
Note: Coefficients are unstandardized and include standard error in parentheses

 * p \textless 0.05 ** p \textless 0.01 *** p \textless 0.001

\end{table}

\end{document}

답변2

저는 이 dcolumn패키지를 사용하여 소수점 표시에 있는 세 데이터 열의 숫자를 정렬하는 데 도움을 주었습니다. 또한 \caption명령을 사용하여 캡션을 조판하고 threeparttable환경을 사용하여 캡션의 너비를 자료의 너비로 설정했습니다 tabular.

여기에 이미지 설명을 입력하세요

\documentclass{article}
\usepackage[margin=2.5cm]{geometry} % set page parameters appropriately
\usepackage{booktabs,threeparttable}
\usepackage[font=bf,skip=0.5\baselineskip]{caption}
\usepackage{dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro
\begin{document}
\addtocounter{table}{2}
\begin{table}[ht!]
\centering
\begin{threeparttable}
\caption{OLS (Ordinary Least Square) Regression Analysis between Development Indicators and Infant Mortality Rate in India}
\begin{tabular}{@{}l*{3}{d{2.6}}@{}}
\toprule
Independent Variables & 
\multicolumn{3}{c@{}}{Infant Mortality Rate} \\ 
\cmidrule(l){2-4} 
 & \mc{Model 1} & \mc{Model 2} & \mc{Model 3} \\ 
\midrule
\em 1. Health Inputs, Access, and Participation  \\
Percent Mothers Receiving Antenatal Care 
  & -0.2568^{*} & -0.2474^{*} & -0.2969^{**}  \\
  & (0.1146) & (0.0896) & (0.0851)  \\
Percent Mothers Receiving JSY 
  & 0.3005^{**} &  0.2952^{***} & 0.3004^{***} \\
  & (0.0860) & (0.0735)   & (0.0751) \\
Avg. Delivery Expenditure (Rs.) 
  & -0.0018^{*} & -0.0018^{*} & -0.0024^{**} \\
  & (0.0008) & (0.0008) & (0.0007) \\
\addlinespace
\em 2. Social Indicators  \\
Percent Adult Females Literate 
  & -0.0154 & \mc{—} & \mc{—} \\
  & (0.2128) \\
Percent Children Underweight 
& 0.2440   & 0.2468 & \mc{—} \\
& (0.2318) & (0.1655) \\
\addlinespace
\em 3. Modernization Indicators \\
NSDP Per Capita (Rs.) 
  & \mc{0.73e-05} & \mc{—} & \mc{—} \\
  & \mc{(0.3e-04)} \\
Percent Households using Water Source 
  & 0.0114 & \mc{—} & \mc{—} \\ 
  & (0.1912) \\
\midrule
$F$-statistic & 10.91^{***} & 21.60^{***} & 26.80^{***} \\
$R^2$ & 0.7763 & 0.7756 & 0.7557 \\
Intercept Estimate & 28.80 & 29.37 & 39.56 \\
$N$ & 30 & 30 & 30 \\ 
\midrule
\multicolumn{4}{@{}l@{}}{Note: Coefficients are unstandardized; standard errors shown in parentheses.}\\
\multicolumn{4}{@{}l@{}}{$^{*}\ p<0.05$; $^{**}\ p<0.01$; $^{***}\ p<0.001$.} \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}
\end{document}

답변3

모든 기능을 사용하고 threetablex, 열에 siunitx대한 패키지를 만들고 S, LaTeX 구문을 수정하고, 테이블에서 앰퍼샌드를 일관되게 사용합니다.

\documentclass{article}

\usepackage{booktabs}
\usepackage[referable]{threeparttablex}
\usepackage[font={small,bf},
            skip=0.33\baselineskip]{caption}
\usepackage{siunitx}
\usepackage{xparse}
\NewExpandableDocumentCommand\mcc{O{1}m}
    {\multicolumn{#1}{c}{#2}}

\addtocounter{table}{2}

\begin{document}
    \begin{table}[ht!]
    \sisetup{input-symbols = {( )},
             table-align-text-pre=false,
             table-space-text-post={$^{***}$},
             table-align-text-post=false,
             table-format=-1.4,
             group-digits = false,
             output-exponent-marker={e},
             tight-spacing=true
                        }
    \setlength\tabcolsep{1.5pt}
\begin{threeparttable}
\caption{OLS (Ordinary Least Square) Regression Analysis between Development Indicators and Infant Mortality Rate in India}
\label{tab:regresion}

\begin{tabular}{@{} l SSS @{}}
    \toprule
Independent Variables & \mcc[3]{Infant Mortality Rate}  \\
    \cmidrule(l){2-4}
    & \mcc{Model 1}     & \mcc{Model 2}     & \mcc{Model 3}     \\
    \midrule
\emph{1. Health Inputs, Access, and Participation}  &&&         \\
Percent Mothers Receiving Antenatal Care
    & -0.2568\tnote{*}  & -0.2474\tnote{*}  & -0.2969\tnote{**} \\
    & (0.1146)          & (0.0896)          & (0.0851)          \\
Percent Mothers Receiving JSY
    & 0.3005\tnote{**}  & 0.2952\tnote{***} & 0.3004\tnote{***} \\
    & (0.0860)          & (0.0735)          & (0.0751)          \\
Avg. Delivery Expenditure (Rs.)
    & -0.0018\tnote{*}  & -0.0018\tnote{*}  & -0.0024\tnote{**} \\
    & (0.0008)          & (0.0008)          & (0.0007)          \\
    \addlinespace
\emph{1. Social Indicators}                         &&&         \\
Percent Adult Females Literate
    & -0.0154           & {--}              & {--}              \\
    & (0.2128)          & {--}              & {--}              \\
Percent Children Underweight
    & 0.2440            & 0.2468            & {--}              \\
    & (0.2318)          & (0.1655)          & {--}              \\
    \addlinespace
\emph{3. Modernization Indicators}                  &&&         \\
NSDP Per Capita (Rs.)
    &  {\num{0.73e-5}}  & {--}              & {--}              \\
    & {(\num{0.30e-4})} & {--}              & {--}              \\
Percent Households using Water Source
    & 0.0114            & {--}              & {--}              \\
    & (0.1912)          & {--}              & {--}              \\
    \midrule
$F$-statistic           
    & 10.91\tnote{***}  & 21.60\tnote{***}  & 26.80\tnote{***}  \\
$R^2$ 
    & 0.7763            & 0.7756            & 0.7557            \\
Intercept Estimate 
    & 28.80             & 29.37             & 39.56             \\
$N$ & 30                & 30                & 30                \\
\bottomrule
\end{tabular}\footnotesize
    \begin{tablenotes}[flushleft, para]
\note{Coefficients are unstandardized; standard errors shown in parentheses.

      \item[*]:     $p<0.05$; 
      \item[**]:    $p<0.01$; 
      \item[***]:   $p<0.001$.}
    \end{tablenotes}
\end{threeparttable}
    \end{table}
\end{document}

여기에 이미지 설명을 입력하세요

답변4

siunitx나는 다음 을 사용하여 테이블을 만드는 것을 제안합니다 threeparttable.

\documentclass{article}
\usepackage{multirow}
\usepackage{booktabs, caption}
\usepackage{threeparttable}
\usepackage{siunitx}

\begin{document}

\begin{threeparttable}
\setcounter{table}{2}\captionsetup{font=bf, format=hang, labelsep=period}
\setlength{\tabcolsep}{3pt}
\sisetup{table-format=-1.4, table-space-text-post=***, table-align-text-post=false, input-symbols={()}, group-digits=false}
\caption{OLS (Ordinary Least Square) Regression Analysis Between \\ Development Indicators And Infant Mortality Rate In India}
\centering\small
\begin{tabular}{@{}lSSS@{}}\toprule
\multirow{2}{*}{\centering Independent Variables} & \multicolumn{3}{c}{Infant Mortality Rate} \\ \cmidrule(l){2-4}
& {Model 1} & {Model 2} & {Model 3} \\ \midrule
1. \textit{Health Inputs, Access, and Participation}\\
Percent Mothers Receiving Antenatal Care & 0.2568* & -0.2474 & -0.2969** \\
 & (0.1146) & (0.0896) & (0.0851) \\ \addlinespace
Percent Mothers Receiving JSY & 0.3005** & 0.2952*** & 0.3004***\\
 & (0.0860) & (0.0735) & (0.0751) \\ \addlinespace
Avg. Delivery Expenditure (Rs.) & -0.0018* & -0.0018* & -0.0024** \\
(0.0008) & (0.0008) & (0.0007) \\ \addlinespace
2. \textit{Social Indicators} \\
Percent Adult Females Literate & -0.0154 & {—} & {—} \\
 & (0.2128) \\\addlinespace
Percent Children Underweight & 0.2440 & 0.2468 & {—} \\
 & (0.2318) & (0.1655)\\ \addlinespace
3. \textit{Modernization Indicators} \\
NSDP Per Capita (Rs.) & 0.73{$ \,\mathrm{e}-05 $} & \multicolumn{1}{c}{—} & \multicolumn{1}{c}{—} \\
 & (0.3{$ \,\mathrm{e}-04 $)} \\
Percent Households using Water Source & 0.0114 & {—} & {—} \\
 &(0.1912) \\ \midrule
F-statistic & 10.91*** & 21.60*** & 26.80*** \\
R-squared & 0.7763 & 0.7756 & 0.7557 \\
Intercept Estimate & 28.80 & 29.37 & 39.56 \\
N & 30 & 30 & 30 \\ \bottomrule
\end{tabular}
\begin{tablenotes}[online]
\item[Note:] Coefficients are unstandardized and include standard error in parentheses.

\centering*\enspace$ p < 0.05$,\quad **\enspace$ p < 0.01 $,\quad ***\enspace$ p < 0.001 $.
\end{tablenotes}
\end{threeparttable}

\end{document} 

여기에 이미지 설명을 입력하세요

관련 정보