How to obtain R square value
Show older comments
Hi all,
coefficientsold = polyfit(AAT,QErot1,1)
Ygg=polyval(coefficientsold,AAT)
figure
axis([-10 80 0 15])
plot(AAT,QErot1,'s',AAT,Ygg,'--','MarkerFaceColor',[0 0 0])
By using this code what I obtain is a linear equation that fits my data, but I am not able to obtain the R-square value.
I would be glad if you could tell be how to obtain the r-square value, if it is possible by the use of the regress function, because I am not able to understand the use of this function properly.
Thank you very much
Andoni
Accepted Answer
More Answers (1)
Kalpesh Patil
on 1 Sep 2014
0 votes
correlation_coeff = corr2(Ygg,AAT);
r_sqr = power(correlation_coeff,2);
4 Comments
Andoni Mendialdua
on 1 Sep 2014
Andoni Mendialdua
on 1 Sep 2014
Iain
on 1 Sep 2014
Why do you think that an R-squared value of 1 is wrong?
Are you actually asking for an RMS?
Andoni Mendialdua
on 1 Sep 2014
Categories
Find more on t Location-Scale Distribution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!