Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I've done a NonLinearRegression with this data

{{0.245, 0.0917011}, {0.25, 0.0894304}, {0.25, 0.108895}, 
 {0.25, 0.111991}, {0.251, 0.0898849}, {0.251, 0.107753},
 {0.254, 0.114524}, {0.254, 0.121882}, {0.255, 0.130478},
 {0.255, 0.186865}, {0.256, 0.108817}, {0.256, 0.128742},
 {0.256, 0.131999}, {0.257, 0.150797}}

The model is a simply parabola:

y=a x^2+b x +c

The coefficiets are:

 a= 317.459
 b=-154.723
 c= 18.9415

Then I've done the same with Excel and the coefficients are the same, but R^2 is not the same. In Mathematica I've got R^2=0.97 and Excel tells me R^2=0.45. Why there is this incoherence?

share|improve this question
2  
Maybe this will be useful. –  b.gatessucks Aug 14 '13 at 8:54
    
Plus, correct me if I am wrong, but you will get different values of R depending on the data - whether it is a sample or the whole population. –  Sektor Aug 14 '13 at 8:58
1  
We had an earlier question on this, but I can't find it anymore. I believe the answer was that in a non linear model fit rsquared has a different meaning and that LinearModelFit should be used in this case. –  Sjoerd C. de Vries Aug 14 '13 at 14:34
    
@b.gatessucks Your link does not work for me. Perhaps it depends on being logged in into google groups? –  Sjoerd C. de Vries Aug 14 '13 at 14:36
    
@b.gatessucks Your link is very useful. Thanks a lot –  Mary Aug 14 '13 at 15:38
show 5 more comments

1 Answer

lm=LinearModelFit[data,{1,x,x^2},x] yields the same coefficient estimates and the R^2 for this model coincides with Excel, i.e. Excel uses linear regression model

lm["RSquared"]

yields:

0.454452
share|improve this answer
    
thanks I agree with your comment. In fact I've done a linear regression no a non Linear model. –  Mary Aug 14 '13 at 15:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.