2

I am trying to round numbers in the following table.

\begin{table}[H]
\centering
\begin{tabular} {c| cccc}
T(sample size) & $\theta_0$ & $\theta_1$ & $\theta_2$ & $\theta_3$ \\     \hline
200&-0.081295&-0.090014&-0.089029&0.010305\\\hline
500&-0.05266&-0.037185&-0.03383&-0.001537\\\hline
\end{tabular}
\caption{I.I.D. contexts: bias in estimating the optimal policy parameter. Bias=$\mathbb{E}(\hat{\theta}_t)-\theta^*$. }
\label{iid_b}
\end{table}

However, if I do the following revision by replacing c with S[round-precision=2], latex compiler reports error and subscripts of theta will be lost.

\begin{table}[H]
\centering
\begin{tabular} {c| S[round-precision=2]S[round-precision=2]S[round-precision=2]S[round-precision=2]}
T(sample size) & $\theta_0$ & $\theta_1$ & $\theta_2$ & $\theta_3$ \\ \hline
200&-0.081295&-0.090014&-0.089029&0.010305\\\hline
500&-0.05266&-0.037185&-0.03383&-0.001537\\\hline
\end{tabular}
\caption{I.I.D. contexts: bias in estimating the optimal policy parameter. Bias=$\mathbb{E}(\hat{\theta}_t)-\theta^*$. }
\label{iid_b}
\end{table}

I also want to avoid changing the decimal places for each number. any suggestions?

0

Try the following:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{siunitx}

    \begin{document}
\begin{table}[h]
\centering
\begin{tabular}{c|
           *{4}{S[table-auto-round,
                 table-format=-1.2]}
                }
T(sample size) & {$\theta_0$} &{$\theta_1$} & {$\theta_2$} & {$\theta_3$}\\\hline
200 &   -0.081295   &   -0.090014   &   -0.089029   &   0.010305    \\\hline
500 &   -0.05266    &   -0.037185   &   -0.03383    &  -0.001537    \\\hline
\end{tabular}
    \caption{I.I.D. contexts: bias in estimating the optimal policy parameter. Bias=$\mathbb{E}(\hat{\theta}_t)-\theta^*$. }
    \label{iid_b}
\end{table}
    \end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.