testm <- stats::lm(mpg ~ hp * factor(cyl), data = mtcars)
resm <- residualDiagnostics(testm)
plot(resm$testDistribution)
resm <- residualDiagnostics(testm, standardized = FALSE)
plot(resm$testDistribution)
## clean up
rm(testm, resm)
if (FALSE) {
testdat <- data.frame(
y = c(1, 2, 2, 3, 3, NA, 9000000, 2, 2, 1),
x = c(1, 2, 3, 4, 5, 6, 5, 4, 3, 2))
residualDiagnostics(
lm(y ~ x, data = testdat, na.action = "na.omit"),
ev.perc = .1)$Residuals
residualDiagnostics(
lm(y ~ x, data = testdat, na.action = "na.exclude"),
ev.perc = .1)$Residuals
residualDiagnostics(
lm(sqrt(mpg) ~ hp, data = mtcars, na.action = "na.omit"),
ev.perc = .1)$Residuals
}
Run the code above in your browser using DataLab