No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.8 | 5 ratings Rate this file 8 Downloads (last 30 days) File Size: 1.44 KB File ID: #13872 Version: 1.0



Felix Hebeler (view profile)


06 Feb 2007 (Updated )

calculate rsquare from data y and estimate yhat

| Watch this File

File Information

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.

MATLAB release MATLAB 7.3 (R2006b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (7)
24 Feb 2012 Guadalupe Martinez

it works, thanks for sharing !!!

28 Feb 2011 Ana Brasio

Thank you Felix Hebeler and
Petteri T for your work and suggestions.

Comment only
15 Jun 2010 fuaada mohd siam

Thanks for sharing!

28 Jan 2010 MIKICAT Mikawer

Works fine!!! Thanx ;)

05 Nov 2009 Petteri T

sum( (y-yhat).^2) could be replaced with (y-what)' * (y-what) for speedup as suggested there:

Comment only
17 Jul 2008 Daithi O'hEachach

Does the job.

21 Feb 2007 baldo giovane

Contact us