0

I am using sjPlot::plot_model to plot a lmer model. What are the default error bars?

Here is my model:

 p <- lmer(dv~iv1+ factor(iv2)+ (1+iv1+factor(iv2)|subject))
  1. Here is the plot model with no specification to the error intervals:

    p <- plot_model(p3, type="pred", terms=c("iv1", "iv2"), title="Predicted Values")
    
  2. Here is the plot model specifying 95% CI:

    p <- plot_model(p3, type="pred", terms=c("iv1", "iv2"), ci.lvl=0.95, title="Predicted Values")
    

In the end, the graphs look very similar. I just want to confirm what the default (1) error intervals are representing because I forgot to initially specify and if they are 95% CI then I won't have to remake all of the graphs I created for several analyses that I've already conducted. Thank you for your help!

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • 4
    What package is `plot_model` from? What does the help file say about the default for `ci.lvl`? – Richard Telford Apr 11 '21 at 18:36
  • This is what the help file says for the ci.lvl: " Numeric, the level of the confidence intervals (error bars). Use ci.lvl = NA to remove error bars. For stanreg-models, ci.lvl defines the (outer) probability for the credible interval that is plotted (see ci). By default, stanreg-models are printed with two intervals: the "inner" interval, which defaults to the 50%-CI; and the "outer" interval, which defaults to the 89%-CI. ci.lvl affects only the outer interval in such cases. See prob.inner and prob.outer under the ...-argument for more details." – john connor Apr 11 '21 at 20:15
  • I have not read the CI described in this way, so it's a bit confusing to me. Is this basically saying that it's a 89% CI? @RichardTelford – john connor Apr 11 '21 at 20:16
  • packages loaded include: tidyverse, lm4, lmerTest, ggplot2, ggeffects, sjPlot @RichardTelford – john connor Apr 11 '21 at 20:17

1 Answers1

2

It is always good to check the help file. As you write in the comments @saraconnor, "By default, stanreg-models are printed with two intervals: the "inner" interval, which defaults to the 50%-CI; and the "outer" interval, which defaults to the 89%-CI. ci.lvl affects only the outer interval in such cases"

Yes, the default confidence interval for this function is 89%. Many plots can include inner and outer CI bands, the help file is saying that the outer-most band defaults to ci.lvl=0.89, which you will have to manually specify as ci.lvl=0.95 or prob.outer=0.95, like you have. The inner band is specified with prob.inner (which defaults to 0.50 as the helpfile text you've supplied suggests). Either of these numbers can be set between 0 and 1.

See McElreath, R. (2020). Statistical rethinking: A Bayesian course with examples in R and Stan. CRC press. for one explanation as to why 89% CI - spoiler, because it is prime! (just a note on the arbitrariness of 95, or any other value).

Dylan_Gomes
  • 2,066
  • 14
  • 29