No BSD License  

Highlights from
rsquare

4.75

4.8 | 4 ratings Rate this file 60 Downloads (last 30 days) File Size: 1.44 KB File ID: #13872

rsquare

by Felix Hebeler

 

06 Feb 2007 (Updated 06 Feb 2007)

calculate rsquare from data y and estimate yhat

| Watch this File

File Information
Description

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  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
21 Feb 2007 baldo giovane  
17 Jul 2008 Daithi O'hEachach

Does the job.

05 Nov 2009 Petteri T

sum( (y-yhat).^2) could be replaced with (y-what)' * (y-what) for speedup as suggested there: http://www.mathworks.nl/matlabcentral/newsreader/view_thread/168821

28 Jan 2010 MIKICAT Mikawer

Works fine!!! Thanx ;)

15 Jun 2010 fuaada mohd siam

Thanks for sharing!

28 Feb 2011 Ana Brasio

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

Please login to add a comment or rating.
Updates
06 Feb 2007

Better deletion of NaNs

Tag Activity for this File
Tag Applied By Date/Time
approximation Felix Hebeler 22 Oct 2008 08:59:51
interpolation Felix Hebeler 22 Oct 2008 08:59:51
rsquare Felix Hebeler 22 Oct 2008 08:59:51
r2 Felix Hebeler 22 Oct 2008 08:59:51
goodness of fit Felix Hebeler 22 Oct 2008 08:59:51
regression Felix Hebeler 22 Oct 2008 08:59:51
estimate Felix Hebeler 22 Oct 2008 08:59:51
rsquare Yulia Ptitsyna 03 Nov 2009 18:57:40

Contact us at files@mathworks.com