Skip to content

Instantly share code, notes, and snippets.

@ggada
Last active February 13, 2017 10:29
Show Gist options
  • Save ggada/a93978898232dd20f29184ffe350d72c to your computer and use it in GitHub Desktop.
Save ggada/a93978898232dd20f29184ffe350d72c to your computer and use it in GitHub Desktop.
Plotting residual densities - ggplot2
ggplot(mod, aes(x=mod$residuals)) +
geom_density(fill="blue", colour=NA, alpha=.2) +
geom_line(stat = "density") +
expand_limits(y = 0) +
ggtitle("Density plot of residuals") +
theme(plot.title = element_text(hjust = 0.5)) +
xlab("Residual") +
ylab("Density")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment