Skip to content

apa_print() capitalizes term names #603

@mariusbarth

Description

@mariusbarth

The apa_print() method for emmeans objects capitalizes the names of contrasts, which is inconsistent with other output from apa_print() (e.g., ANOVA).

The following example illustrates the problem.
I calculate two contrasts, age focus and valence focus.

These are capitalized in the table. Fine.

However, reporting string (estimate, statistic, full_result) names ($Age_focus, $Valence_focus ) should not be capitalized.

> ec_effects <- marginal_means |>
+   contrast(
+     list(
+       "age focus"       = c(1, -1, 0, 0)
+       , "valence focus" = c(0, 0, 1, -1)
+     )
+     , side = ">"
+   ) |>
+   apa_print()
> ec_effects
$estimate
$estimate$Age_focus
[1] "$\\Delta M = -0.03$, 95\\% CI $[-0.22, \\infty]$"

$estimate$Valence_focus
[1] "$\\Delta M = 0.67$, 95\\% CI $[0.47, \\infty]$"


$statistic
$statistic$Age_focus
[1] "$t(103) = -0.24$, $p = .595$"

$statistic$Valence_focus
[1] "$t(103) = 5.66$, $p < .001$"


$full_result
$full_result$Age_focus
[1] "$\\Delta M = -0.03$, 95\\% CI $[-0.22, \\infty]$, $t(103) = -0.24$, $p = .595$"

$full_result$Valence_focus
[1] "$\\Delta M = 0.67$, 95\\% CI $[0.47, \\infty]$, $t(103) = 5.66$, $p < .001$"


$table
A data.frame with 6 labelled columns:

       contrast estimate           conf.int statistic  df p.value
1     Age focus    -0.03 [-0.22, $\\infty$]     -0.24 103    .595
2 Valence focus     0.67  [0.47, $\\infty$]      5.66 103  < .001
``

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions