I have tried reading the documentation in sjPlot but couldn't figure it out. In a multilevel / hierarchical / mixed-effect model, ran with lme4 in R, the summary() output give an estimated variance and standard deviation for each random effect. I wanted to plot this variance by level of one of my random intercepts (stimuli), to see differences across stimuli: for the model:

m.EDA = lmer(EDA_cs ~ Cond * Time_sd + (1|Participant) + (1|Stim),
                data= phys)

I used the following code from sjPlot to visualize the variance of each level of my random intercept Stim:

plot_model(m.EDA, type = "re")

The question... how come the x-axis (which I thought represents the variance) has negative values?

enter image description here

Variance can't be negative, which makes me think that the x-axis in this plot is plotting something else other than the random effects (which is what the documentation suggests: https://strengejacke.github.io/sjPlot/reference/plot_model.html)


1 Answer 1


It is plotting the random effects, not the variances of anything. This is what the manual says:

plot_model() creates plots from regression models, either estimates (as so-called forest or dot whisker plots) or marginal effects.


type = "re"

For mixed effects models, plots the random effects.

also, you write:

summary() output give an estimated variance and standard deviation for each random effect.

which is correct. If you want to plot those variances against something else, you will have to capture them. You can, I believe, find the right term from using str() with the name of your model in the parens, and then use that to create a plot.

  • $\begingroup$ Thanks for the response. What does random effect mean here? the equivalent to the beta coefficient in a fixed effect? $\endgroup$
    – Luminosa
    Sep 28 at 8:09
  • 1
    $\begingroup$ Pretty much, yes. But you often aren't interested in it. The random effect is often the variable that accounts for the clustering. $\endgroup$
    – Peter Flom
    Sep 28 at 9:54
  • $\begingroup$ In this case I am interested because one of my Stim (Artik) showed the opposite effect than the predicted (while all the other Stims followed the hypothesis), so I was wondering if the random effect could tell me something about it, and as you can see in the graph, it is the one with the most negative random effect... but not sure how to interpret it, so I might just leave the discussion on random effects out of the paper. $\endgroup$
    – Luminosa
    Sep 28 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.