rsquare

calculate rsquare from data y and estimate yhat
7.1K Downloads
Updated 6 Feb 2007

No License

Simple function to calculate the r square of a dataset y (vector or matrix form) and the corresponding estimates yhat calculated using a regression.
Uses r2 = 1 - SSe/SSt
Input can contain NaNs.

Cite As

Felix Hebeler (2026). rsquare (https://www.mathworks.com/matlabcentral/fileexchange/13872-rsquare), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0.0

Better deletion of NaNs