I would like to plot the output from more than one regression.
MWE:
df <- data.frame(
y1 = runif(100),
y2 = runif(100),
x = c(rep("A",times=50), rep("B",times=50))
)
If I want to plot the intercept and coefficients, I can use dwplot():
m0 <- lm(y1 ~ factor(x), data = df)
m1 <- lm(y2 ~ factor(x), data = df)
dwplot(list(m0, m1), show_intercept=T) + theme_bw()
However, I am interested in the ls means (computed with the package library(lsmeans)
). For this case, dwplot()
gives me an error.
lsm0 <- lsmeans(m0,~ factor(x), data = df)
lsm1 <- lsmeans(m1,~ factor(x), data = df)
dwplot(list(lsm0, lsm1), show_intercept=T) + theme_bw()
What are possible solutions?