Friday, 13 November 2015

LibreOffice Calc: 15 Steps for Best Line Fits (Regression Line)




Have you been troubled with messy graph sheets and age old equipment from the stone age i.e. a ruler and pencil? Why muck around with that when you're in the Computer Age buddy! Use LibreOffice Calc to simplify your plotting requirements, and far more precisely than the arbitrary line of a ruler.

Steps to Get it Straight (No We're Not Homophobic)

 

Search for LibreOffice Calc (please do install first on Windows or Mac!)
  1. Get your version of LibreOffice booted up!
  2. Once you're booted up, go ahead and enter your values you want to plot in the cells as shown below.

    Data Entry complete
  3. In most cases your X values will be straight-forward as shown, but if you want to use other values as required, feel free to change those respective positions.
  4. Now that you're done with the value entry, the hard donkey work part's over. Sit back, relax and begin watching the freedom computing brings. From the menu bar, go to Insert > Chart.. and click on it.
  5. You should now have gotten the window entry. Select the XY (Scatter) option from Chart Type with the Points and Lines option as shown below and hit Next >> .

    Select Points and Lines before proceeding
  6. Go ahead, hit Next >>, nothing to view on this next entry (unless you haven't followed steps and entered data as a row).
  7.  You are now on the Data Series tab as displayed on the window left. Click Add if your series table is blank, or edit the entry already present as shown in the next step.

    Just added a new value set!
  8. Now in the right box, you have 3 options, Name, X Values & Y Values. To enter the X axis values, select the X Values option and in the text field immediately below click on the button on the right side as shown in the bottom right of the image.

    See that little button in this corner ---->
  9. You now have a popup window asking you for values. Go right over to your table and select all the values you want to enter on the X axis. I've highlighted them in the image below.

    See the X values highlighted in blue?
  10. Do the same with the Y Values. Select the option Y Values from the box, click the text field button on the bottom right and select the column with your Y value entries. In this case if your values are hidden by the table, copy whatever X contains and paste it in the box changing the Column Letter accordingly, in my case from A to B as shown.

    I've copy pasted the text. Easy peasy.
  11. Now you're completed your graph. Careful about your index values, recheck to confirm you've used all the values and aren't missing any.
  12. Now, if you want a simple line connecting the dots, you're done. If you want a straight line with the best fit a.k.a. regression line, proceed.
  13. Double-click on the line your graph presently shows and change the line type from Continuous to (none).


  14. Now your line should disappear. Head over to the top on the menu bar and select Insert -> Trend Lines... option.


  15. Select the continuous line option, and under the tab Type play around with the options to suit your need. I prefer to have the Show Equation checked to display the line slope and intercept, as well as name my line.
That's all folks! You're done. 15 easy steps to solve your two dimensional first world problems. Move the function display around, exit table editing mode and shift that around to display your original values, whatever you choose. No more relying on graphing calculators that nearly never have print options, or pencil ruled images to upload to your report.

9 comments: