Rsq: R-Squared

Description Usage Arguments Value Author(s)


This generic function calculates the squared multiple correlation, or 'proportion variance explained', according to the formula

R^2 = 1 - SS(obj)/SS(tot)

, where SS(obj) = sum (y - pred(y))^2 is the squared error of predictions pred(y), and SS(tot) = sum (y - mean(y))^2 the total sum of squares.


Rsq(object, ...)



An object of a suitable class for the R-Squared to be calculated - an object with a predict method, and if y is missing, a slot y.


Some methods for this generic function accept an argument y, providing the observed data. At present, no other additional arguments are used


Returns a numeric value with the corresponding R-Squared.


Maarten Speekenbrink

Search within the mcplR package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.