Page 1 of 1

Line of best fit

Posted: Thu Sep 24, 2009 2:29 am
by jdn103
hi!
does anyone know how to calculate the line of best fit? I really need help with this.
thanks!

Re: line of best fit

Posted: Thu Sep 24, 2009 3:44 am
by FJCC
There are three ways, at least, to get the best linear fit to data. You can use the functions SLOPE and INTERCEPT in separate cells. These functions have the form

Code: Select all

=SLOPE(YRange;XRange)
=INTERCEPT(YRange;XRange)
You can also use the RSQ() function to get the R^2 of the fit.

You can use the array function LINEST() to get the linear fit. It returns various statistics in addition to the slope and intercept. I suggest you check out the Help section, as that function is more complicated.

Finally, if the data are used in a scatter chart, you can double click on the chart to put it in edit mode and then go to Insert -> Trend Lines to add the line, equation and R Squared to the chart.

Re: line of best fit

Posted: Thu Sep 24, 2009 12:56 pm
by Cambirder
Alternatively you can plot the data as an X Y scatter chart, and add a a trend line.

In edit mode right click on any of the plot points select add trend line, and from the pop-up window chose Linear regression and tick the show equation box.

Re: Line of best fit

Posted: Sun Dec 13, 2009 7:28 pm
by merikilpikonna
is it also possible for non linear curves?

old posts suggest that there has been a statistics tab in earlier oo versions, but i can not find an equivalent.

Re: Line of best fit

Posted: Tue Dec 15, 2009 5:40 am
by FJCC
If you search the Help Index of OpenOffice Charts for Trend Lines in Charts, you will find formulas for finding the parameters of various kinds of non-linear fits.