October 2017
Beginner to intermediate
572 pages
26h 1m
English
Perform the following steps to measure the performance of the regression model:
> library(car)
> data(Quartet)
> plot(Quartet$x, Quartet$y3)
> lmfit = lm(Quartet$y3~Quartet$x)
> abline(lmfit, col="red")

> predicted= predict(lmfit, newdata=Quartet[c("x")])
> actual = Quartet$y3
> rmse = (mean((predicted - actual)^2))^0.5
> rmse
Output
[1] 1.118286
Read now
Unlock full access