Model Assessment
model(X, y)
| X |
|
|---|---|
| y | Numeric vector of length |
Returns a vector with the following elements
Residual sum of squares.
Mean squared error.
Root mean squared error.
R-squared \(\left( R^2 \right)\).
Adjusted R-squared \(\left( \bar{R}^2 \right)\) .
Wikipedia: Residual Sum of Squares
Wikipedia: Explained Sum of Squares
Wikipedia: Total Sum of Squares
Wikipedia: Coefficient of Determination
Other assessment of model quality functions:
.MSE(),
.R2fromESS(),
.R2fromRSS(),
.RMSE(),
.Rbar2(),
.model(),
MSE(),
R2(),
RMSE(),
Rbar2()
Ivan Jacob Agaloos Pesigan
# Simple regression------------------------------------------------ X <- jeksterslabRdatarepo::wages.matrix[["X"]] X <- X[, c(1, ncol(X))] y <- jeksterslabRdatarepo::wages.matrix[["y"]] model(X = X, y = y)#> RSS MSE RMSE R2 Rbar2 #> 7.367313e+04 5.715526e+01 7.560110e+00 8.263864e-02 8.192585e-02# Multiple regression---------------------------------------------- X <- jeksterslabRdatarepo::wages.matrix[["X"]] # age is removed X <- X[, -ncol(X)] model(X = X, y = y)#> RSS MSE RMSE R2 Rbar2 #> 5.434254e+04 4.215868e+01 6.492972e+00 3.233388e-01 3.207018e-01