Created
July 15, 2020 18:31
-
-
Save timcdlucas/aaab0e8eb34a26ca061ad6ef9d4ff09b 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
library(MASS) | |
N <- 60 | |
x <- rep(c('a', 'b'), N) | |
x_dummy <- as.numeric(x == 'a') | |
y <- x_dummy + rt(N, 2) | |
data <- data.frame(x = x, y = y) | |
boxplot(y ~ x, data) | |
m1 <- lm(y ~ x, data = data) | |
plot(m1) | |
m2 <- rlm(y ~ x, data = data) | |
plot(m2) # residual vs leverage plot looks ok. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment