多元统计中可以利用broom
包检验残差分布。@alexpghayes
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")
多元统计中可以利用broom
包检验残差分布。@alexpghayes
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")