Created attachment 91622 [details] Article with detail of calculation in case of forced intercept Problem description: Steps to reproduce: 1. Enter data: X=1, 2, 3 and Y=11, 12, 13 2. Select data and create XY chart 3. Insert a linear trend line with forced intercept and show R^2 Current behavior: R^2=0 because it is calculated with the same formula as with free intercept and gives a negative value, like Excel 2003 does. Expected behavior: R^2 should not be calculated with the same formula in case of forced intercept. Attached article give the correct formula in case of forced intercept: (4') instead of (4) Operating System: All Version: 4.2.0.1 rc
Created attachment 91623 [details] Test file showing R^2 value with forced intercept with LINEST and trendline Moreover, LINEST function gives the correct value of R^2. I attach an example.
Start point http://opengrok.libreoffice.org/xref/core/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx#180
Take. Propose commit https://gerrit.libreoffice.org/#/c/7326/
It's clear that both LINEST() function and trendline must give the same R^2 value. So set status to NEW. Best regards. JBF
Laurent Balland-Poirier committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=9e67015be6e9e53e19466117d692de17c18463da fdo#73374 Trendline: correct R^2 for forced intercept The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Hi Laurent, I finally had the time to review you patch. Can you also prepare a patch for LO 4.2? Regards, Tomaž
Laurent Balland-Poirier committed a patch related to this issue. It has been pushed to "libreoffice-4-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=bac928cf6405c869ab83bc136dac52b037386108&h=libreoffice-4-2 fdo#73374 Trendline: correct R^2 for forced intercept It will be available in LibreOffice 4.2.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Fixed, right?
(In reply to comment #8) > Fixed, right? +1 Laurent BP