Created
September 1, 2017 20:27
-
-
Save conormm/eac16287e42e0fcda4827f578f4cbe6c to your computer and use it in GitHub Desktop.
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
fit <- num_df %>% | |
map(scale) %>% | |
as.data.frame() %>% | |
bootstrap(10) %>% | |
do(tidy(lm(imdb_score ~., data = .), conf.int = TRUE)) %>% | |
mutate(sig_0005 = p.value < 0.005) | |
fit %>% | |
filter(term != "(Intercept)") %>% | |
group_by(term) %>% | |
ggplot(aes(reorder(term, estimate), estimate, colour = sig_0005)) + | |
geom_point(alpha = 0.4) + | |
coord_flip() + | |
theme_minimal() + | |
geom_hline(aes(yintercept = 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