emmeans package - Rounding to 1 decimal point & displaying 95% CI for pairwise_diff

I would like all values to be rounded to 1 decimal place in em_means, and the 95% CI to be dipslayed using pairwise difference in the following code - this is still displaying fully rounded numbers for em_means & no 95% CI (just SE) for pairwise_diff

em_means <- emmeans(ComPAS_MUAC115_LinearGrowth_ForAnalysis_completecases_2.1, specs = ~ control_str2, digits=1)

# Calculate pairwise differences between groups
pairwise_diff <- pairs(em_means, conf.level=0.95, digits=1)

# Display the estimated means and pairwise differences
print(em_means)
print(pairwise_diff)
library(emmeans)
warp.lm <- lm(breaks ~ wool * tension, data = warpbreaks)
out <- emmeans (warp.lm,  ~ wool | tension)
out
#> tension = L:
#>  wool emmean   SE df lower.CL upper.CL
#>  A      44.6 3.65 48     37.2     51.9
#>  B      28.2 3.65 48     20.9     35.6
#> 
#> tension = M:
#>  wool emmean   SE df lower.CL upper.CL
#>  A      24.0 3.65 48     16.7     31.3
#>  B      28.8 3.65 48     21.4     36.1
#> 
#> tension = H:
#>  wool emmean   SE df lower.CL upper.CL
#>  A      24.6 3.65 48     17.2     31.9
#>  B      18.8 3.65 48     11.4     26.1
#> 
#> Confidence level used: 0.95
print(test(out), digits = 1)
#> tension = L:
#>  wool emmean SE df t.ratio p.value
#>  A        45  4 48  12.218  <.0001
#>  B        28  4 48   7.739  <.0001
#> 
#> tension = M:
#>  wool emmean SE df t.ratio p.value
#>  A        24  4 48   6.581  <.0001
#>  B        29  4 48   7.891  <.0001
#> 
#> tension = H:
#>  wool emmean SE df t.ratio p.value
#>  A        25  4 48   6.734  <.0001
#>  B        19  4 48   5.149  <.0001

Created on 2023-10-05 with reprex v2.0.2

To remove the CI, I don't get those. Provide a reprex (see the FAQ) to show how it is appearing for you?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.