How to find the uncertainty in the slope

This is an issue that I have not really addressed much. However, it is important enough that I talk about it.

In many labs, you will collect data, make a graph, find the slope of a function that fits that data and use it for something. Well, what if need to find the uncertainty in the slope? How do you do that? There are a couple of ways you can do this, neither are absolutely correct. However, if you write a formal lab report and you find the slope you MUST find the uncertainty in it.

Here is some sample data. Suppose I measure the diameter and the circumference of several roundish objects. Here is my data.
Workbook1

So, I want to plot this and find a functional relationship between these two. With error bars, this is what it should look like:

Untitled

Now, I want to fit a linear function to this data. That should be ok, but what about the uncertainty?

Method 1 - use uncertainty of data points

I could get the ratio of C/d by just looking at each data point. This is not as good as the slope because the slope essentially uses all the data points at once. In this method, I am going to find the slope as normal. In Excel, you could fit a trendline. Or, you could draw a best fit line. Either way, I would get something like this (I did this in Logger Pro):

Untitled-1

This gives a slope of 3.28 (compare to pi = 3.14). I could get a better slope if I required the fitting function to go through the origin (0,0), but I am not going to do that. In essence, the slope is:

LaTeXiT-1-12

But, what if I just use one set of data points? Then I could use propagation of error as usual. This would give

LaTeXiT-1-13

Where the delta - slope represents the uncertainty in the slope. For this method, just pick the data pair with the largest uncertainty (to be safe) - although hopefully, it won’t matter much. For this case, I will pick d= 0.06+/-0.002 m and C = 0.183 +/- 0.004 m. This would give an uncertainty in the slope of 0.2. I would write:

LaTeXiT-1-14 (there are no units - they canceled)

Method 2

The next method is better but a little tricky. Basically, if you draw a best fit line you could “wiggle” the line and still have it fit. This would give a minimum and a maximum slope. If you do the trendline in Excel, I am not sure how you would do this. If you do it by hand on graph paper, it would be easy. Here, I am going to manually fit two lines in Logger Pro. Here is the max slope that ‘looks’ like it fits.

Untitled-2

This gives a min slope of 3.0 and a max of 3.2 for an uncertainty of +/- 0.1.