Linear Regression solving through LibreOffice Calc Spreadsheet application in Linux/Windows

I am learning Linear Regression in recent days. To understand this better I was looking for a tool to arrive with Slope, Intercept, R-squared (R² = coefficient of determination) and also a scatter chart. After a few minutes of search I realized it is already in my Linux desktop asibreoffice Calc spreadsheet application. This open source office suite makes it easy. If you run MS-Office Excel, almost similar steps you can do get it done in Windows too or LibreOffice on Windows (If you wonder what is LibreOffice, it is nothing but OpenOffice re-branded for community).

LibreOffice Suite

Here I am trying to solve a hypothetical issue of relation between hours spent on Internet and its impact on School grades.

Internet Hours Marks
0 85
1 80
2 84
3 80
4 82
5 70
6 44
7 30
8 22
9 10
10 15
  1. Open a new spreadsheet and enter the above table as shown below.
  2. Select the above table cells including the header -> Go to Menu -> Data -> Statistics -> Regression…
  3. Select a nearby empty cell to generate output. You should see the results as shown below.
  4. Now to plot a Scatter diagram, again select the data table as in Step-1. Then go to Menu -> Insert -> Chart… Select “XY (Scatter)” as Chart type. Now will see a nice scatter Chart. Just drag and drop at a convenient location.
  5. Now you should be eager to see the regression line. Click any of the plotted dot in chart, right click menu -> “Insert Trendline…”. Just click OK for the dialog.
  6. Now it is final step to see your equation. Select trendline -> right click menu -> Select “Insert R² and Trendline equation”. You are done.

Please let me know if you find this post useful.

Share this post

Leave a Reply