Bug 54423

Summary: Linear regression line equation incorrect
Product: LibreOffice Reporter: Maarten Brouwers <freedesktop.org>
Component: ChartAssignee: Not Assigned <libreoffice-bugs>
Status: CLOSED NOTABUG QA Contact:
Severity: normal    
Priority: medium CC: rb.henschel
Version: 3.6.1.2 release   
Hardware: x86-64 (AMD64)   
OS: Mac OS X (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: File comparing manually calculated regressionformula and formula as shown in graph

Description Maarten Brouwers 2012-09-03 08:32:42 UTC
Created attachment 66533 [details]
File comparing manually calculated regressionformula and formula as shown in graph

Problem: The equation shown along the linear regression line inside the diagram is incorrect (the actual line drawn seems to be correct).

Formula design: f(x) = a + bx (I'll be referring to a and be later on)

Steps to reproduce

1. Create a data range with x, y values
2. Plot it along the x axis
3. Create a regression line and enable the equation
4. Test the result of the equation

Obtained result:

Although the regression line that is drawn seems to be correct, the equation contains is not: the equation's value for b is correct, but a is incorrect.

Expected result:

The error should be relatively small (i.e. the f(x) values resulting from the regression line should be somewhere near the actual observed value y).

The attached file demonstrates it. I've included a manually calculated regression line that seems to correspond to the actual line drawn.
Comment 1 Regina Henschel 2012-09-05 21:16:29 UTC
Quote from Help, topic "Trend Lines"
"If you insert a trend line to a chart type that uses categories, like Line or Column, then the numbers 1, 2, 3, … are used as x-values to calculate the trend line."

You have to use an XY-chart.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.