1

I'm tiring to plot the output of a model using the sjPlot package. I want the standard errors on the plot to reflect the clustered standard errors I'm using in my model. I was wondering what the appropriate call for the plot_model function is if I want to cluster my standard errors on c in the plot of the predicted values?

set.seed(1999)

c <- sample(c("A","B", "C", "D"), size = 100, replace = T)
w <- sample(1:100, size = 100, replace = T)
x <- sample(1:100, size = 100, replace = T)
y <- sample(1:100, size = 100, replace = T)

df <- data.frame(x,y,w,c)

Results <- lm(y ~ x*w, data = df)

library(sjPlot)
library(ggplot2)

plot_model(Results, type = "pred", terms = c("x","w"))
Sharif Amlani
  • 1,138
  • 1
  • 11
  • 25

1 Answers1

0

I used "se=TRUE" to see the standard error as error bars. Unfortunately, this only works for "plot_model", not for "plot_models" (several models in one graph).

Hope, this helps!

Best wishes