Skip to content

Instantly share code, notes, and snippets.

@smithdanielle
Created November 19, 2015 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smithdanielle/d7d782596e91d2f3e8d6 to your computer and use it in GitHub Desktop.
Save smithdanielle/d7d782596e91d2f3e8d6 to your computer and use it in GitHub Desktop.
Plotting in ggplot2 using lsmeans
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