Bug 54423 - Linear regression line equation incorrect
Summary: Linear regression line equation incorrect
Status: CLOSED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
3.6.1.2 release
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-03 08:32 UTC by Maarten Brouwers
Modified: 2012-09-05 21:16 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
File comparing manually calculated regressionformula and formula as shown in graph (15.45 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-09-03 08:32 UTC, Maarten Brouwers
Details

Note You need to log in before you can comment on or make changes to this bug.
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.