我真的很难在 LaTeX 中创建下表,其中只有数据来自 csv 文件(文件中的数字与此表中的数字格式完全相同)。挑战在于在左侧合并单元格。我的 LaTeX 文档以以下内容开头:\documentclass[11pt,times,letter]{article} \usepackage[margin=1in]{geometry}
这是我当前拥有的表格代码,但其中所有数字都是硬编码的。
\begin{center}
\begin{table}[h!]
\caption{Annualized Sharpe ratios and standard deviations (in brackets) of four monthly rebalanced portfolios spanning the period January 6, 2006 through October 19, 2018. We condition on the event that the market index has monthly returns smaller than $-6.7\%$ ($R_m<-6.7\%$). The maximum values of the Sharpe ratios are highlighted in bold.} \label{TableSharpeRatiosMonthly2}
\begin{subtable}{\linewidth}
\centering
\caption{US stocks}
\begin{tabular}{|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{} & $q_m=0.5$ & $q_m=0.3$ \\
\hline
\multirow{4}{*}{$q_p=0.2$} & $CoER^{\leq}$ & $\mathbf{-1.5538} \ (0.2766)$ & $\mathbf{0.0659} \ (0.3538)$ \\ \cline{2-4}
& $CoER^{=}$ & $-4.0990 \ (0.2104)$ & $-3.2071 \ (0.2255)$ \\ \cline{2-4}
& Min.Var. & $-2.7377 \ (0.2406)$ & $-2.7377 \ (0.2406)$\\ \cline{2-4}
& $1/n$ & $-6.1798 \ (0.2255)$ & $-6.1798 \ (0.2255)$ \\
\hline
\multirow{4}{*}{$q_p=0.1$} & $CoER^{\leq}$ & $\mathbf{-1.9243} \ (0.2638)$ & $\mathbf{-1.0906} \ (0.2946)$ \\ \cline{2-4}
& $CoER^{=}$ & $-4.1003 \ (0.2104)$ & $-3.3969 \ (0.2219)$ \\ \cline{2-4}
& Min.Var. & $-2.7377 \ (0.2406)$ & $-2.7377 \ (0.2406)$ \\ \cline{2-4}
& $1/n$ & $-6.1798 \ (0.2255)$ & $-6.1798 \ (0.2255)$ \\
\hline
\end{tabular}
\end{subtable}%
\vspace*{10pt}
\begin{subtable}{\linewidth}
\centering
\caption{Canadian stocks}
\begin{tabular}{|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{} & $q_m=0.5$ & $q_m=0.3$ \\
\hline
\multirow{4}{*}{$q_p=0.2$} & $CoER^{\leq}$ & $-3.8621 \ (0.2801)$ & $-3.8650 \ (0.2890)$ \\ \cline{2-4}
& $CoER^{=}$ & $-3.8872 \ (0.2465)$ & $-3.8912 \ (0.2604)$ \\ \cline{2-4}
& Min.Var. & $\mathbf{-3.8466} \ (0.2692)$ & $\mathbf{-3.8466} \ (0.2692)$ \\ \cline{2-4}
& $1/n$ & $-7.0936 \ (0.1028)$ & $-7.0936 \ (0.1028)$ \\
\hline
\multirow{4}{*}{$q_p=0.1$} & $CoER^{\leq}$ & $-3.8596 \ (0.2759)$ & $-3.8630 \ (0.2819)$ \\ \cline{2-4}
& $CoER^{=}$ & $-3.8862 \ (0.2465)$ & $-3.8895 \ (0.2576)$ \\ \cline{2-4}
& Min.Var. & $\mathbf{-3.8466} \ (0.2692)$ & $\mathbf{-3.8466} \ (0.2692)$ \\ \cline{2-4}
& $1/n$ & $-7.0936 \ (0.1028)$ & $-7.0936 \ (0.1028)$ \\
\hline
\end{tabular}
\end{subtable}
\end{table}
\end{center}