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).
Here I am trying to solve a hypothetical issue of relation between hours spent on Internet and its impact on School grades.
- Open a new spreadsheet and enter the above table as shown below.
- Select the above table cells including the header -> Go to Menu -> Data -> Statistics -> Regression…
- Select a nearby empty cell to generate output. You should see the results as shown below.
- 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.
- 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.
- 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.