plotregression fitlm rsquare difference

2 views (last 30 days)
Hello
Could you help explain why there is a difference between r-squared calculated using plotregression() and fitlm()?
R-squared: 0.968 from fitlm() R = 0.98364 from plotregression()
The code to produce the two r-squared values is below.
%% set up variable from neural network output = net(input); outputTest = output(tr.testInd); targetTest = target(tr.testInd);
%% first method to produce r-squared plotregression(targetTest,outputTest,'Testing')
%% second method to produce r-squared mdl = fitlm(targetTest,outputTest); r2 = mdl.Rsquared.Ordinary;
Regards
William Bell

Accepted Answer

Greg Heath
Greg Heath on 24 Dec 2013
>> 0.98364^2
ans =
0.9675
Thank you for formally accepting my answer
Greg

More Answers (0)

Categories

Find more on Sequence and Numeric Feature Data Workflows 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!