Would anyone know how to add color in selected columns for a table with subcolumns?
In other words, for the image below, I would like to color in the 2nd and 3rd columns (clustered and cured OR & P-value) as well as the 6th and 7th column (Non-clustered and Cured OR & P-value). I tried using
rowcolor{black}\multicolumn{9}{}
but the attempts I tried from other help pages did not seem to help. Any help or hints would be greatly appreciated again. Thanks!
\documentclass[table]{beamer}
\usepackage{tikz, dcolumn, booktabs,multirow, esvect, xcolor}
\usepackage[utf8]{inputenc}
\usepackage{algorithm,algpseudocode}
\usepackage{cite}
\usetikzlibrary{arrows,shapes}
\newcolumntype{d}[1]{D{.}{.}{#1}} % "decimal" column type
\renewcommand{\ast}{{}^{\textstyle *}} % for raised "asterisks"
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\newcommand\mcn[2]{\multicolumn{#1}{c}{#2}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}}
\begin{document}
\begin{frame}
\begin{table}
\setlength\tabcolsep{0pt}
\small{\caption{Model risk comparisons }}
\tiny
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}
>{$}r<{$}
d{2.8} d{2.3}
d{2.3} d{1.0}
d{1.3} d{1.0}
d{3.0} d{1.0}
}
\toprule
& \mcn{4}{Clustered} & \mcn{4}{Non-clustered} \\
\cmidrule(lr){2-5}\cmidrule(lr){6-9}
Logistic & \mcn{2}{Cured} & \mcn{2}{Non-cured}
& \mcn{2}{Cured} & \mcn{2}{Non-cured} \\
& \mc{OR (95\% CI)} & \mc{P-val}
& \mc{OR (95\% CI)} & \mc{P-val} & \mc{OR (95\% CI)}
& \mc{P-val} & \mc{OR (95\% CI)} & \mc{P-val} \\
\midrule
\multicolumn{8}{l}{HCV Groupings \textsuperscript{a}} \\
D-/R+ & 0.86 & 0.36 & - & - & 0.37 & 0.99 & - & - \\
& (0.62, 1.19) & & & & (0.0,\infty) & & &\\
D+/R- & 0.01 & <0.0001 \ast& - & - & 0.03 & 0.98 & - & - \\
& (0.01, 0.02) & & & & (0.0, \infty) & & &\\
D+/R+ & 0.71 & 0.03 & - & - & 0.31 & 0.99 & - & - \\
& (0.52, 0.97) & & & & (0.0, \infty) & & &\\
\text{Intercept} & 0.22 & <0.0001 \ast& - & - & 1.96\cdot10^{-7} & 0.63 & - & - \\
& (0.19, 0.26) & & & & (2.01 \cdot10^{-34}, 1.90\cdot10^{20}) & & &\\
\midrule
Survival & \mc{HR (95\% CI)} & \mc{P-val}
& \mc{HR (95\% CI)} & \mc{P-val} & \mc{HR (95\% CI)}
& \mc{P-val} & \mc{HR (95\% CI)} & \mc{P-val} \\
\midrule
\multicolumn{8}{l}{HCV Groupings \textsuperscript{a}} \\
D-/R+ & 1.56 & <0.0001\ast & 1.59 & <0.0001 \ast& 1.57 & <0.0001 \ast& 1.57 & <0.0001\ast \\
& (1.52, 1.61) & & (1.55, 1.64) & & (1.52, 1.61) & & (1.53, 1.61) & \\
D+/R- & 1.63 & <0.0001\ast & 1.74 & <0.0001\ast& 1.71 & <0.0001\ast & 1.71 & <0.0001 \ast \\
& (1.60, 1.66) & & (1.72, 1.77)& & (1.69, 1.73) & & (1.69, 1.73) & \\
D+/R+ & 1.31 & <0.0001 \ast& 1.34 & <0.0001\ast& 1.34 & <0.0001\ast & 1.35 & <0.0001\ast \\
& (1.28, 1.35) & & (1.30, 1.37) & & (1.32, 1.38) & & (1.32, 1.38) & \\
%\text{Constant} & 8.79 & <0.0001 \ast& 8.80 & <0.0001\ast & 8.71 & <0.0001\ast & 8.71 & <0.0001\ast \\
% & (0.03) & & (0.03) & & (0.004) & & (0.004) &\\
\midrule
& \mc{$\hat{\beta}$ (SD)} & \mc{P-val}
& \mc{$\hat{\beta}$ (SD)} & \mc{P-val} & \mc{$\hat{\beta}$ (SD)}
& \mc{P-val} & \mc{$\hat{\beta}$ (SD)} & \mc{P-val} \\
\midrule
\text{Center} & -3.11 & <0.0001 \ast& - & - & - & - & - & - \\
& (-3.27, -2.96) & & & & & & &\\
\text{theta}& 0.44 & <0.0001\ast & 0.24 & <0.0001\ast& - & - & - & - \\
& (0.42, 0.45) & & (0.22, 0.25) & & & & & \\
\bottomrule
\end{tabular*}
\end{table}
\tiny{\textsuperscript{a} D-/R- as base group}
\end{frame}
\end{document}