Tweeted By @alexpghayes
need to sanity check residuals in a multiple regression? #broom has your back:
— alex hayes (@alexpghayes) August 26, 2018
library(tidyverse)
fit <- lm(hp ~ ., mtcars)
au <- broom::augment(fit)
au %>%
gather(x, val, -contains(".")) %>%
ggplot(aes(val, .resid)) +
geom_point() +
facet_wrap(~x, scales = "free") pic.twitter.com/3MY68ByYNx