Skip to content

Instantly share code, notes, and snippets.

@darioappsilon
Created December 22, 2020 09:26
Show Gist options
  • Save darioappsilon/3e81eb29b36a970081ee0a28658ec1f6 to your computer and use it in GitHub Desktop.
Save darioappsilon/3e81eb29b36a970081ee0a28658ec1f6 to your computer and use it in GitHub Desktop.
005_linear_regression
# Get residuals
lm_residuals <- as.data.frame(residuals(model))
# Visualize residuals
ggplot(lm_residuals, aes(residuals(model))) +
geom_histogram(fill = "#0099f9", color = "black") +
theme_classic() +
labs(title = "Residuals plot")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment