Line of best fit

Discuss the spreadsheet application

Line of best fit

Postby jdn103 » Thu Sep 24, 2009 2:29 am

hi!
does anyone know how to calculate the line of best fit? I really need help with this.
thanks!
OpenOffice 3.0.1 on Ubuntu 9.04
jdn103
 
Posts: 1
Joined: Thu Sep 24, 2009 2:22 am

Re: line of best fit

Postby FJCC » Thu Sep 24, 2009 3:44 am

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   Expand viewCollapse view
=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.
AOO 3.4 or 4.0 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 3680
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: line of best fit

Postby Cambirder » Thu Sep 24, 2009 12:56 pm

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.
OOo 3.3 on Windows 7 & 3.2.1 on Mint 10
User avatar
Cambirder
Volunteer
 
Posts: 647
Joined: Thu Nov 22, 2007 1:01 am

Re: Line of best fit

Postby merikilpikonna » Sun Dec 13, 2009 7:28 pm

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.
OpenOffice 3.1 on Ubuntu 9.10
User avatar
merikilpikonna
 
Posts: 3
Joined: Sun Dec 13, 2009 12:37 am

Re: Line of best fit

Postby FJCC » Tue Dec 15, 2009 5:40 am

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.
AOO 3.4 or 4.0 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 3680
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA


Return to Calc

Who is online

Users browsing this forum: Google [Bot] and 38 guests