Linear Regression
One process used in experiments is making a measurement and using a physics equation to make another measurement. For example, I could measure height and fall time and calculate the acceleration due to gravity by using which comes fromy = y0 + v0t +
at 2
with 1 |
2 |
v0 = 0
for being dropped and letting the change from y0 to y be the height h.
With one measurement of h and t, I could calculate a, but it would be only be as accurate as my worst measurement. To get a more reliable answer, I could make multiple measurements and use a method called linear regression.
Imagine I were to take all my data and put it into a spreadsheet, like Excel®. I could make a graph out of the data. However, it turns out that I can do a lot more interesting stuff with a linear relationship, so instead I can mess with my data a little bit to make it a linear equation.
Recall the equation for a line: y = mx + b.
We can match this to the equation above by comparing them:
Comparing the equations, if my two variables being measured are h and t, it looks like I have y matching up with h and x matching up with t 2, which leaves 1 |
2 |
b = 0).
So if I were to plot a set of numbers whose x-values are t 2 and y-values are h, the points should (hopefully)
form a straight line, whose slope must be (hopefully) 1 |
2 |
In Excel®, you can do the following:
-
1Put the h and t 2 values into two columns. (You can just put the t values in and have Excel® calculate the squares if you want to save time.)
-
2Highlight the two columns of data and click Charts on the ribbon or Insert Chart from the Insert menu. Choose Scatter (Marked Scatter if you need to specify—nothing that connects the dots).
-
3Right-click (or Cmd+click for Mac) on a point and select Add Trendline. In the Trendline options, choose Linear and click Show Equation on Graph.
-
4You should now get a straight line that roughly corresponds with your data and its equation.
1 |
2 |
To use LINEST:
-
1Highlight four empty cells in a 2 × 2 grid.
-
2In the upper left cell, type "=linest(".
-
3Highlight the y-values (h column), and type a comma.
-
4Highlight the x-values (t 2 column), and type a comma.
-
5Type "1, 1)".
-
6Hold Ctrl+Shift and press Enter on Windows or hold Cmd+Shift and press Enter on a Mac. (Just hitting Enter may mess it up.)
-
7You should see four numbers. The upper left is the slope and the upper right is the y-intercept (which should ideally be zero but likely won't be for real data). The two numbers below them are the uncertainty values of the slope and intercept values, which are statistically calculated.