Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

R2

Multiple R-Squared


Description

Coefficient of determination R2

Usage

R2(Y, Ypred)

Arguments

Y

a real vector with the values of the output

Ypred

a real vector with the predicted values at the same inputs

Value

R2=1-SSE/SST

where SST= (Y(x1) - Ypred(x1) )^2+...+(Y(xn) - Ypred(xn) )^2 is the residual sum of squares

and SST= (Y(x_{1}) - mean(Y) )^2+...+(Y(x_{n}) - mean(Y) )^2 is the total sum of squares.

Note that the order of the input argument is important.

Author(s)

D. Dupuy

Examples

X	<- seq(-1,1,0.1)
Y	<- 3*X + rnorm(length(X),0,0.5)
Ypred	<- 3*X
print(R2(Y,Ypred))

DiceEval

Construction and Evaluation of Metamodels

v1.5
GPL-3
Authors
D. Dupuy and C. Helbert
Initial release
2020-05-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.