Re: Mathematica calculates RSquared wrongly?
- To: mathgroup at smc.vnet.net
- Subject: [mg112714] Re: Mathematica calculates RSquared wrongly?
- From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
- Date: Tue, 28 Sep 2010 06:03:37 -0400 (EDT)
- References: <i7pp6r$l92$1@smc.vnet.net>
I get the same numbers as you, using three definitions of Rsquared. The difference might be caused by the standard definition of R squared being applicable for linear least squares fits, whereas here we don't have a linear model. You may consider asking support at wolfram.com whether this is a bug or not. Cheers -- Sjoerd On Sep 27, 11:47 am, Lawrence Teo <lawrence... at yahoo.com> wrote: > sbbBN = {{-0.582258428`, 0.49531889`}, {-2.475512593`, > 0.751434565`}, {-1.508540016`, 0.571212292`}, {2.004747546`, > 0.187621117`}, {1.139972167`, 0.297735572`}, {-0.724053077`, > 0.457858443`}, {-0.830992757`, 0.313642502`}, {-3.830561204`, > 0.81639874`}, {-2.357296433`, 0.804397821`}, {0.986610836`, > 0.221932888`}, {-0.513640368`, 0.704999208`}, {-1.508540016`, > 0.798426867`}}; > > nlm = NonlinearModelFit[sbbBN, a*x^2 + b*x + c, {a, b, c}, x] > nlm["RSquared"] > > The RSquared by Mathematica is 0.963173 > Meanwhile, Excel and manual hand calculation show that R^2 should be > equal to 0.7622. > > Is Mathematica wrong? Thanks!