[Tex/LaTex] siunitx: Decimal alignment with ‘less than’ sign

siunitx

How can I align the p-values that contain the 'less than' sign in the last column in this table and also specify spacing between individual columns to improve the layout?

\documentclass{article}

%tables
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{siunitx} %align numbers by decimal point

\begin{document}

\sisetup{table-format = -1.2}
\begin{longtable}[]{S[table-format=2.0]SSSS[table-format = 0.2]}
\caption{} \label{}\\
\toprule
{\textbf{Item}} & {\textbf{\textit{b}}} & {\textbf{\textit{t}}} & {\textbf{\textit{F}}} & {\textbf{\textit{R$^2$}}}\\
\midrule
\endfirsthead
\toprule
{\textbf{Item}} & {\textbf{\textit{b}}} & {\textbf{\textit{t}}} & {\textbf{\textit{F}}} & {\textbf{\textit{R$^2$}}}\\
\midrule
\endhead
\bottomrule
\endfoot
\endlastfoot
1 & -1.45{$^{***}$} & -7.44{$^{***}$} & 55.34 & .18  \\
11 & -.86{$^{*}$} & -2.09{$^{*}$} & 4.36 & .01  \\
12 & -1.79{$^{***}$} & -3.80{$^{***}$} & 14.47 & .05  \\
13 & -.56 & -1.34 & 1.80 & .00  \\
61 & -1.79{$^{***}$} & -5.85{$^{***}$} & 34.20 & .12  \\
62 & -1.00{$^{**}$} & -3.17{$^{**}$} & 10.05 & .04  \\
63 & -.27 & -.65 & .43 & {$<$0.001}  \\
64 & -.37 & -.97 & .94 & .00  \\
65 & -.34 & -.85 & .73 & .00  \\
66 & 1.05{$^{**}$} & 2.70{$^{**}$} & 7.30 & .02  \\
67 & -1.12{$^{**}$} & -2.90{$^{**}$} & 8.40 & .03  \\
72 & -.41 & -1.20 & 1.43 & .00  \\
73 & -.27 & -.82 & .67 & .00  \\
74 & 2.05{$^{***}$} & 4.99{$^{***}$} & 24.88 & .09  \\
75 & 1.61{$^{***}$} & 4.41{$^{***}$} & 19.46 & .07  \\
76 & .29 & .91 & .83 & {$<$0.001}  \\
\bottomrule
\end{longtable}

\end{document}

Best Answer

You need to do a few adjustments: allow for a comparator in your last column, allow for the stars in the other columns and tighten up the space your reserve for numbers. The comparator goes in the table-format for the appropriate column, while the extra space is reserved using table-space-text-post. As your table is a bit complex I've done the format column-by-column, and made sure they are 'correct':

\documentclass{article}

%tables
\usepackage{booktabs}
\usepackage{siunitx} %align numbers by decimal point

\begin{document}

\begin{tabular}{
  S[table-format = 2]
  S[table-format = -1.2, table-space-text-post = $^{***}$]
  S[table-format = -1.2, table-space-text-post = $^{***}$]
  S[table-format = 2.2]
  S[table-format = <1.3]}
\toprule
{Item} & {$b$} & {$t$} & {$F$} & {$R^{2}$}\\
\midrule
1 & -1.45{$^{***}$} & -7.44{$^{***}$} & 55.34 & .18  \\
11 & -.86{$^{*}$} & -2.09{$^{*}$} & 4.36 & .01  \\
12 & -1.79{$^{***}$} & -3.80{$^{***}$} & 14.47 & .05  \\
13 & -.56 & -1.34 & 1.80 & .00  \\
61 & -1.79{$^{***}$} & -5.85{$^{***}$} & 34.20 & .12  \\
62 & -1.00{$^{**}$} & -3.17{$^{**}$} & 10.05 & .04  \\
63 & -.27 & -.65 & .43 & <0.001  \\
64 & -.37 & -.97 & .94 & .00  \\
65 & -.34 & -.85 & .73 & .00  \\
66 & 1.05{$^{**}$} & 2.70{$^{**}$} & 7.30 & .02  \\
67 & -1.12{$^{**}$} & -2.90{$^{**}$} & 8.40 & .03  \\
72 & -.41 & -1.20 & 1.43 & .00  \\
73 & -.27 & -.82 & .67 & .00  \\
74 & 2.05{$^{***}$} & 4.99{$^{***}$} & 24.88 & .09  \\
75 & 1.61{$^{***}$} & 4.41{$^{***}$} & 19.46 & .07  \\
76 & .29 & .91 & .83 & <0.001  \\
\bottomrule
\end{tabular}

\end{document}

Notice I've also adjusted the header to use math mode (these look like mathematical symbols), and as there is not need for a long table in the example I've dropped that.

Related Question