Created
November 19, 2015 12:59
-
-
Save smithdanielle/d7d782596e91d2f3e8d6 to your computer and use it in GitHub Desktop.
Plotting in ggplot2 using lsmeans
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ggplot(NULL, aes(x = x, y = NULL))+ | |
geom_point(data = data, | |
aes(y = y, fill = z, color = z), | |
position = position_jitterdodge(jitter.width = .2, jitter.height = .2, dodge.width = .9), | |
alpha = .15, size = 3)+ | |
geom_crossbar(data = data.frame(summary(lsmeans(mixed.model$full.model, ~ z|x)), | |
aes(y = lsmean, ymax = upper.CL, ymin = lower.CL, color = view), | |
size = 1, position = "dodge", fatten = 2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment