# Format spacing for correlation table (any statistical table)

I'm attempting to format a correlation table for publication but can't get the spacing right when I include significance stars. I'd like to have minimal space between columns. The space between significance stars columns and significant correlations should be nil.

The final goal is to fit the table on a 8.5 x 11 page in portrait page orientation with significance stars directly touching the right side of the correlations. I also tried wrapping the first column to go onto the next line with:

\begin{tabular}{p{3cm}llrp{.3cm}rp{.3cm}rp{.3cm}r}

I then had to use \noindent to get each row to not indent. Even after that when the row did wrap to the next line it was not indented after the numbers I have for each variable.

I'm sure the fix is easy but I'm not terrifically familiar with LaTeX yet.

I have googled this for a while and am frustrated. Thank you in advance for you assistance.

\documentclass[leavefloats]{apa6e}
\usepackage[american]{babel}
\usepackage{csquotes}
\abstract{This is an example of of an abstract in APA.  }
\begin{document}
\title{A Template for APA Papers}
\shorttitle{APA: A Template}
\author{John}
\authornote{\dots}
\date{\today} % or \date{24Jan11} for example
\maketitle
\section{CORRELATION}

\begin{table}[ht]
\small
\caption{Correlations, means and standard deviations Of model variables}
\label{tb:cor:cha}
\begin{center}
\begin{tabular}{lllrp{2.9cm}rp{2.9cm}rp{2.9cm}r}
\hline
\multicolumn{7}{l}{Charter Schools}  \\
\hline
measure & mean & \makebox [.8cm][c]{sd} & \makebox [.8cm][c]{1} && \makebox [.8cm][c]{2} && \makebox [.8cm][c]{3} && \makebox [.8cm][c]{4} \\
\hline
1. Percent Passing Reading &   0.469 &   0.199 &  &  &  & &&& \\
2. Percent Minority &   0.888 &   0.214 & -0.385 &   &  & &&&   \\
3. Percent Free \& Reduced Lunch &   0.722 &   0.203 & -0.181  &  &  0.326  &  &  &&  \\
4. Enrollment & 679.880 & 192.984 & -0.063    && -0.168    & & 0.183    &&  \\
5. Percent Teachers $<$ 3yrs Experience &   0.274 &   0.150 & -0.223   & &  0.252    & & -0.316    & & -0.283    \\
\hline
\multicolumn{7}{l}{Districts}  \\
\hline
1. Percent Passing Reading  &     0.634 &     0.1393 &  &  &  & &&& \\
2. Percent Minority &     0.163 &     0.2374 & -0.470&*** &  &  &&&  \\
3. Percent Free \& Reduced Lunch &     0.337 &     0.2106 & -0.732&*** &  0.512&*** &&  & \\
4. Enrollment & 11866.793 & 18847.8328 & -0.388&*** &  0.715&*** &  0.498&*** &  \\
5. Percent Teachers $<$ 3yrs Experience &     0.056 &     0.0347 & -0.374&*** &  0.064 &   &  0.310&*** &  0.114    \\
\hline\\[-2.5ex]
\multicolumn{7}{l}{*Note *p$<$.05, **p$<$.01, ***p$<$.001}  \\
\end{tabular}
\end{center}
\end{table}

\end{document}

This table is better but now the negative decimals aren't aligned for negative correlations. Any suggestions would be helpful.

\begin{table}[ht]
\small
\caption{Correlations, means and standard deviations Of model variables}
\label{tb:cor:cha}
\begin{center}
\begin{tabular}{lrrllll}
\hline
\multicolumn{7}{l}{Charter Schools}  \\
\hline
measure & mean & \makebox [.2cm][c]{sd} & \makebox [.2cm][c]{1} & \makebox [.2cm][c]{2} & \makebox [.2cm][c]{3} & \makebox [.2cm][c]{4} \\
\hline
\noindent 1. Percent Passing Reading &   .47 &   .20 &  &  &  &  \\
\noindent 2. Percent Minority &   .89 &   .21 & -.38    &  &  &  \\
\noindent 3. Percent Free \& Reduced Lunch &   .72 &   .20 & -.18    &  .33    &  &  \\
\noindent 4. Enrollment  & 679.88 & 192.98 & -.06    & -.17    &  .18    &  \\
\noindent 5. Percent Teachers $<$ 3yrs Experience &   .27 &   .15 & -.22    &  .25    & -.32    & -.28    \\
\hline
\multicolumn{6}{l}{Districts}  \\
\hline
\noindent 1. Percent Passing Reading &     .63 &     .14 &  &  &  &  \\
\noindent 2. Percent Minority &     .16 &     .24 & -.47*** &  &  &  \\
\noindent 3. Percent Free \& Reduced Lunch &     .34 &     .21 & -.73*** &  .51*** &  &  \\
\noindent 4. Enrollment  & 11866.79 & 18847.83 & -.39*** &  .71*** &  .50*** &  \\
\noindent 5. Percent Teachers $<$ 3yrs Experience  &     .056 &     .035 & -.37*** &  .06    &  .31*** &  .11    \\
\hline\\[-2.5ex]
\multicolumn{7}{l}{*Note *p$<$.05, **p$<$.01, ***p$<$.001}  \\
\end{tabular}
\end{center}
\end{table}
-

Here's a version of your table using the siunitx package for aligning decimal columns, and the array package to simplify making column types. I've also used booktabs which is the standard for publication quality tables. The basic idea is to remove the intercolumn space for most of the columns to make the table more readable.

\documentclass[leavefloats]{apa6e}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage{array} % loaded by booktabs, but included here for explicitness
\usepackage{booktabs}
\usepackage{siunitx}
\newcolumntype{L}{@{}l@{}} % a left column with no intercolumn space on either side
\newcommand{\mc}[1]{\multicolumn{1}{c}{#1}} % shorthand macro for column headings
\abstract{This is an example of of an abstract in APA.}
\begin{document}

\title{A Template for APA Papers}
\shorttitle{APA: A Template}
\author{John}
\authornote{\dots}
\date{\today} % or \date{24Jan11} for example
\maketitle
\section{CORRELATION}

\begin{table}[ht]
\small
\caption{Correlations, means and standard deviations of model variables}
\label{tb:cor:cha}
\centering
\begin{tabular}{LS@{}S@{}SLSLSLS}
\toprule
\multicolumn{7}{l}{Charter Schools}  \\
\midrule
\multicolumn{1}{@{\hspace{1em}}l}{Measure} & \mc{mean} & \mc{sd} & \mc{1} && \mc{2} && \mc{3} && \mc{4} \\
\midrule
1. Percent Passing Reading &   0.469 &   0.199 &  &  &  & &&& \\
2. Percent Minority &   0.888 &   0.214 & -0.385 &   &  & &&&   \\
3. Percent Free \& Reduced Lunch &   0.722 &   0.203 & -0.181  &  &  0.326  &  &  &&  \\
4. Enrollment & 679.880 & 192.984 & -0.063    && -0.168    & & 0.183    &&  \\
5. Percent Teachers $<$ 3yrs Experience &   0.274 &   0.150 & -0.223   & &  0.252    & & -0.316    & & -0.283    \\
\midrule
\multicolumn{7}{@{\hspace{1em}}l}{Districts}  \\
\midrule
1. Percent Passing Reading  &     0.634 &     0.1393 &  &  &  & &&& \\
2. Percent Minority &     0.163 &     0.2374 & -0.470&*** &  &  &&&  \\
3. Percent Free \& Reduced Lunch &     0.337 &     0.2106 & -0.732&*** &  0.512&*** &&  & \\
4. Enrollment & 11866.793 & 18847.8328 & -0.388&*** &  0.715&*** &  0.498&*** &  \\
5. Percent Teachers $<$ 3yrs Experience &     0.056 &     0.0347 & -0.374&*** &  0.064 &   &  0.310&*** &  0.114    \\
\midrule\\[-2.5ex]
\multicolumn{7}{l}{*Note *p$<$.05, **p$<$.01, ***p$<$.001}  \\
\end{tabular}
\end{table}

\end{document}

-
You could even just put the stars in the S column right along with the numbers, since siunitx properly detects them as surrounding material. But apparently removing your L columns makes the table take up much more horizontal space. –  rdhs Dec 11 '11 at 5:46
@Alan -- I don't know about statisticians, but Engineers would be consistent in the number of decimals used. These decimals should also reflect the underlying accuracy of the model, i.e., standard deviations under districts are shown in three decimal places, whereas for districts as four decimals. On the enrollment (item 4) is really a 0.793 of any significance-- as the number is in the thousands? Why I mention it, it can make the table a bit smaller and certainly more readable. –  Yiannis Lazarides Dec 11 '11 at 6:24
@YiannisLazarides I agree. I was just showing how to format the table. But you are absolutely right. Most of these numbers should have no more than two decimal places; for numbers > 100, they should be rounded to a whole number. That would definitely add to the readability of the table. –  Alan Munn Dec 11 '11 at 6:44
That's beautiful. Thank you much. –  Tyler Rinker Dec 11 '11 at 7:12
@TylerRinker But you should heed Yiannis' advice on rounding most of the numbers. If you google "reporting numbers APA" you can get various online guides for this. –  Alan Munn Dec 11 '11 at 7:23

Note: I revised the answer below after realizing that the apa6e document class introduces some important mofifications to LaTeX's default behavior and that incorporating these features of the apa6e documentclass are essential to the OP.

The following proposed solution uses the good old dcolumn package to align numbers on their decimal points. I also use the booktabs package for better-looking spacing around horizontal lines ("rules"). Note that I've not imposed the \small font size reduction in the table.

As a final comment, let me echo the sentiment of other commenters that the information content and readability of the table if fewer significant digits were printed. For instance, if all columns showed only 2 rather than 3 decimal digits, nothing of substance would be lost but it might actually become easier to take in the information.

\documentclass[leavefloats]{apa6e}
\usepackage[american]{babel}
\usepackage{csquotes,booktabs,dcolumn}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\setlength\tabcolsep{2pt}

\abstract{This is an example of of an abstract in APA.  }
\begin{document}
\title{A Template for APA Papers}
\shorttitle{APA: A Template}
\author{John}
\authornote{\dots}
\date{\today} % or \date{24Jan11} for example
\maketitle

\section{CORRELATION}

\begin{table}[h]
\caption{Means, standard deviations, and correlations of model variables}
\label{tb:cor:cha}
\noindent
\begin{tabular}{@{}lld{3.3}d{5.3}d{3.5}d{2.5}d{1.5}d{1.3}@{}}
\toprule
& Measure
& \multicolumn{1}{r}{mean}
& \multicolumn{1}{c}{sd}
& \multicolumn{4}{c@{}}{correlations}\\
\cmidrule(l){5-8}
& & & & \multicolumn{1}{c}{1{.}}
& \multicolumn{1}{c}{2{.}}
& \multicolumn{1}{c}{3{.}}
& \multicolumn{1}{c@{}}{4{.}}\\
\midrule
& Charter Schools \\
1{.} & Percent Passing Reading       &   0.469 &   0.199 \\
2{.} & Percent Minority              &   0.888 &   0.214 & -0.385  \\
3{.} & Percent Free \& Reduced Lunch &   0.722 &   0.203 & -0.181  &  0.326  & \\
4{.} & Enrollment                    & 679.880 & 192.984 & -0.063  & -0.168  &  0.183 \\
5{.} & Percent Teachers $<$3yrs Experience & 0.274 & 0.150 & -0.223  &  0.252  & -0.316  & -0.283 \\[1.5ex]
& Districts  \\
1{.} & Percent Passing Reading       &     0.634 &     0.139  \\
2{.} & Percent Minority              &     0.163 &     0.237 & -0.470^{***}  \\
3{.} & Percent Free \& Reduced Lunch &     0.337 &     0.211 & -0.732^{***} &  0.512^{***} \\
4{.} & Enrollment                    & 11866.793 & 18847.833 & -0.388^{***} &  0.715^{***} &  0.498^{***}   \\
5{.} & Percent Teachers $<$3yrs Experience & 0.056 &  0.035 & -0.374^{***} &  0.064    &  0.310^{***}  & 0.114  \\
\bottomrule
& \multicolumn{3}{l}{Notes: ${}^{*} p<.05$,
${}^{**} p<.01$,
${}^{***} p<.001$ } \\
\end{tabular}
\end{table}
\end{document}

-
I just saw the update you had posted. Nice answer (a year late). –  Tyler Rinker Jan 11 '13 at 15:01
@TylerRinker -- Are you sure you posted this comment in the intended place? I haven't edited my answer since posting it thirteen months ago. However, there does seem to be a new answer, by somebody with userid "user24269". The new answer, though, appears to provide an MWE that doesn't pertain directly to the original question; at any rate, I haven't checked it out carefully. –  Mico Jan 11 '13 at 19:11

Alternatively you can also make two columns for every column: One before and one after the dot. You can specifiy which columns are devided by a dot. Here's an example (there are no asterisks, but the logic of the table also works with asterisks). I know this solution is more complicated, however you don't need additional packages.

\begin{table*}[tbp]
\caption{Zusammenhang fremd eingesch\"atzte Charakterst\"arken mit Lebenszufriedenheit}
\label{tab:tab2}
\begin{tabular}{lr@{.}lr@{.}lr@{.}lr@{.}lr@{.}lr@{.}lr@{.}lr@{.}l}  \thickline
&\multicolumn{2}{c}{SLSS}
&\multicolumn{2}{c}{D1}
&\multicolumn{2}{c}{D2}
&\multicolumn{2}{c}{D3}
&\multicolumn{2}{c}{D4}
&\multicolumn{2}{c}{D5}
&\multicolumn{2}{c}{D6}
\\ \cline{2-15}
Kreativit\"at  &  & 10 &  & 01 &  & 10 &  & 05 & - & 01 & - & 01 & - & 01 \\
Neugier  &  & 04 &  & 05 &  & 05 & - & 00 &  & 00 &  & 00 & - & 00 \\
Urteilsverm\"ogen  &  & 24 &  & 12 &  & 17 &  & 05 &  & 07 &  & 07 &  & 08 \\
Liebe zum Lernen  &  & 15 &  & 02 &  & 17 &  & 01 &  & 08 &  & 08 &  & 02 \\
Weisheit  &  & 02 &  & 05 &  & 16 &  & 11 &  & 06 &  & 06 &  & 04 \\
Tapferkeit  & - & 00 &  & 05 &  & 11 &  & 12 &  & 02 &  & 02 &  & 06 \\
Ausdauer  &  & 21 &  & 15 &  & 17 &  & 02 &  & 11 &  & 11 &  & 04 \\
Authentit\"at  &  & 11 &  & 10 &  & 19 &  & 09 &  & 10 &  & 10 &  & 13 \\
Enthusiasmus  &  & 08 &  & 11 &  & 18 &  & 17 &  & 17 &  & 17 &  & 12 \\
Bindungsf\"ahigkeit  &  & 03 &  & 09 &  & 16 &  & 16 &  & 09 &  & 09 &  & 12 \\
Freundlichkeit  &  & 09 &  & 13 &  & 21 &  & 21 &  & 12 &  & 12 &  & 13 \\
Soziale Intelligenz  &  & 15 &  & 07 &  & 17 &  & 11 &  & 14 &  & 14 &  & 07 \\
Teamw  &  & 13 &  & 07 &  & 18 &  & 11 &  & 14 &  & 14 &  & 14 \\
Fairness  &  & 17 &  & 01 &  & 16 &  & 05 &  & 13 &  & 13 &  & 10 \\
F\"uhrung  & - & 10 &  & 13 &  & 15 &  & 17 &  & 08 &  & 08 &  & 08 \\
Vergebungsbereitschaft  &  & 16 &  & 12 &  & 08 &  & 02 &  & 13 &  & 13 &  & 08 \\
Bescheidenheit  &  & 13 & - & 00 &  & 12 &  & 06 &  & 09 &  & 09 &  & 03 \\
Vorsicht  &  & 19 &  & 12 &  & 17 & - & 02 &  & 10 &  & 10 &  & 06 \\
Selbstregulation  &  & 20 &  & 09 &  & 16 & - & 01 &  & 06 &  & 06 &  & 02 \\
Sinn f\"ur das Sch\"one  &  & 18 & - & 04 &  & 01 &  & 04 & - & 09 & - & 09 & - & 00 \\
Dankbarkeit  &  & 18 &  & 16 &  & 16 &  & 08 &  & 13 &  & 13 &  & 05 \\
Hoffnung  &  & 08 &  & 05 &  & 15 &  & 05 &  & 10 &  & 10 &  & 05 \\
Humor  & - & 03 &  & 01 &  & 11 &  & 21 &  & 03 &  & 03 &  & 09 \\
Spiritualit\"at  &  & 17 & - & 00 &  & 10 & - & 01 & - & 02 & - & 02 &  & 04 \\
\hline
\end{tabular}
\end{table*}
-