Skip to content

CIs are sometimes in the wrong order when printing describe_posterior() #746

@qdread

Description

@qdread

Describe the bug

This is a very minor bug but I'd greatly appreciate you all taking a look. Thanks for the great package! It looks like the print method of describe_posterior() is doing something that is changing the order of the credible intervals. I would expect them to be in increasing order but in some circumstances they print in a mixed-up order. I don't have an exhaustive list of circumstances when this happens, but it definitely happens when calling describe_posterior on an emmGrid object with test = 'pd' and test = 'p_ROPE', but oddly, not with other values of test.

To Reproduce

library(brms)
library(emmeans)
library(bayestestR)

fit <- brm(mpg ~ factor(cyl), data=mtcars)

emm <- emmeans(fit, ~ cyl)

describe_posterior(emm, ci = c(.5, .8, .95), test = 'p_map')  
describe_posterior(emm, ci = c(.5, .8, .95), test = 'pd')  

The first call to describe_posterior produces the correct order of CIs but the second call produces 50%, 95%, 80%.

Image

Specifiations (please complete the following information):

  • R version 4.5.0 on Windows 11
  • Package version 0.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    3 investigators ❔❓Need to look further into this issueConsistency 🍏 🍎Expected output across functions could be more similar

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions