Last chance! 50% off unlimited learning
Sale ends in
resid.squares(x, y, y.hat, resid.plot = "square", ...)
regr1.plot
hardness <- read.table(hh("datasets/hardness.dat"), header=TRUE)
hardness.lin.lm <- lm(hardness ~ density, data=hardness)
plot(hardness ~ density, data=hardness, xlim=c(22,73), ylim=c(0,3400))
abline(hardness.lin.lm)
resid.squares(hardness$density, hardness$hardness,
predict(hardness.lin.lm))
plot(hardness ~ density, data=hardness, xlim=c(22,73), ylim=c(0,3400))
abline(hardness.lin.lm)
resid.squares(hardness$density, hardness$hardness,
predict(hardness.lin.lm), resid.plot = "line")
Run the code above in your browser using DataLab