Skip to content

Instantly share code, notes, and snippets.

@conormm
Created September 2, 2017 10:54
Show Gist options
  • Save conormm/8f5f3133f7232d4f88f4027aa9061fe3 to your computer and use it in GitHub Desktop.
Save conormm/8f5f3133f7232d4f88f4027aa9061fe3 to your computer and use it in GitHub Desktop.
fit %>%
filter(term != "(Intercept)") %>%
group_by(term) %>%
summarise(estimate = mean(estimate),
conf.low = mean(conf.low),
conf.high = mean(conf.high),
sig_0005 = ifelse(sum(sig_0005) > 6, "significant (< 0.005)", "not significant")) %>%
ggplot(aes(y = reorder(term, estimate), x = estimate, colour = sig_0005)) +
geom_point() +
geom_errorbarh(aes(xmax = conf.high, xmin = conf.low)) +
theme_minimal() +
geom_vline(aes(xintercept = 0), linetype = "dashed", colour = "blue") +
labs(title = "Linear regression estimates",
subtitle = "Dependent variable: IMDB score",
x = "Independent variable",
y = "estimate")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment