Report ART contrasts (art.con) as a LaTeX table. Customizable with sensible defaults. Companion to reportDunnTestTable().
Source: R/reporting.R, R/zzz-aliases.R
reportArtConTable.RdThe table lists the significant contrasts with their test statistic – a
column headed t, or z when emmeans reports z ratios – its
degrees of freedom (fractional Kenward-Roger or Satterthwaite dfs are shown
to two decimals, not rounded to integers; the column is omitted for z
ratios), the p-value and the rank-biserial correlation. The p-value column
is headed "p-adjusted" and the caption names the correction read from the
contrast summary; with adjust = "none" the header is "p" and the caption
says the p-values are not adjusted. A positive statistic means the
first-named level is higher on the aligned-rank scale.
Usage
reportArtConTable(
ac,
data,
iv = "testiv",
dv = "testdv",
paired = FALSE,
id = NULL,
orderByP = FALSE,
numberDigitsForPValue = 4,
latexSize = "small",
orderText = TRUE,
style = c("hline", "booktabs"),
sink_to = NULL
)
report_art_con_table(
ac,
data,
iv = "testiv",
dv = "testdv",
paired = FALSE,
id = NULL,
orderByP = FALSE,
numberDigitsForPValue = 4,
latexSize = "small",
orderText = TRUE,
style = c("hline", "booktabs"),
sink_to = NULL
)Arguments
- ac
the contrast object returned by
ARTool::art.con()(or itssummary())- data
the raw data frame used to fit the model
- iv
independent variable (the contrasted factor)
- dv
dependent variable
- paired
whether to compute the rank-biserial effect size for paired (within-subjects) data. Defaults to
FALSE. WhenTRUE,idis required.- id
the subject/pairing column, used only when
paired = TRUE. Replicate trials per subject and condition are averaged before pairing.- orderByP
whether to order by the p value
- numberDigitsForPValue
the number of digits to show
- latexSize
which size for the text
- orderText
whether to order the comparisons alphabetically; ignored when
orderByP = TRUE- style
table rule style:
"hline"(default) or"booktabs"(\toprule/\midrule/\bottomrule; needs\usepackage{booktabs}).- sink_to
optional path of a
.texfile to write the table to, so a manuscript can\input{}it
Value
Invisibly returns the rendered LaTeX table as a string (or
NULL when xtable is unavailable); the table is also printed.
Naming
report_art_con_table() is the spelling used throughout the documentation and
the one to prefer in new code: the report_* / plot_* / check_* prefixes
make the API discoverable through autocomplete.
reportArtConTable() is the original
name. Both names refer to the same function object, so they are entirely
interchangeable; the original remains fully supported and is not scheduled
for removal, and existing scripts keep working unchanged.
Examples
# \donttest{
if (requireNamespace("ARTool", quietly = TRUE) &&
requireNamespace("emmeans", quietly = TRUE)) {
set.seed(123)
n <- 20
df <- data.frame(
UserID = factor(rep(seq_len(n), times = 3)),
mode = factor(rep(c("Hand", "Eye", "Both"), each = n)),
prime = factor(rep(rep(c("A", "B"), each = n / 2), times = 3))
)
df$score <- as.numeric(df$mode) * 2 + stats::rnorm(nrow(df))
m <- ARTool::art(score ~ mode * prime + Error(UserID / mode), data = df)
ac <- ARTool::art.con(m, ~ mode, adjust = "holm")
reportArtConTable(ac, data = df, iv = "mode", dv = "score", paired = TRUE, id = "UserID")
}
#> NOTE: Results may be misleading due to involvement in interactions
#> % latex table generated in R 4.6.2 by xtable 1.8-8 package
#> % Tue Nov 10 23:47:12 2026
#> \begin{table}[ht]
#> \centering
#> \caption{Post-hoc ART-C contrasts for independent variable \mode{} and dependent variable \score{}. Positive t-values mean that the first-named level is higher than the second-named on the aligned-rank scale; for negative t-values, the second-named level is. p-values are Holm-adjusted. Effect size reported as rank-biserial correlation (r).}
#> \label{tab:artcon-mode-score}
#> \begingroup\small
#> \begin{tabular}{lrlll}
#> \hline
#> Comparison & t & df & p-adjusted & r \\
#> \hline
#> Both - Eye & -6.64 & 36 & $<$0.001 & 0.97 \\
#> Both - Hand & -13.95 & 36 & $<$0.001 & 1.00 \\
#> Eye - Hand & -7.31 & 36 & $<$0.001 & 1.00 \\
#> \hline
#> \end{tabular}
#> \endgroup
#> \end{table}
# }