# Error analysis, help needed!

1. Feb 25, 2008

### garyman

I am trying to work out the error in the gradient for a linear graph. I have worked out the the RMS error for the y-values, but since I am using excel to determine the graident of the graph I am a little unsure about how to work out the percentage error in my gradient from the RMS error. Am i right in thinking that I should work out the gradient by hand using points within my data range and the relative error will be the RMS error (for Y-values)/Change in Y? IS there a simpler way?

I know the graph in theory should pass through (0,0) since the x values are the magnetic field strength, should I force the intercept through (0,0) or just include that point when drawing the line of best fit?

Last edited: Feb 25, 2008
2. Feb 25, 2008

### Mindscrape

Sorry, you will have to be more descriptive. What are your experimental values, and how do they relate to the theory of your experiment? John Taylor has the best error analysis book, and you should try and find it.

3. Feb 27, 2008

### garyman

Its a plot of energy level spittings for transisitions for a cadmium dischrage lamp(J) against varying margnetic field(mT). The Graident of which is the Bohr Magnetron.

4. Feb 27, 2008

### Mindscrape

Alright, but what equation are you using? Are you supposed to interpolate data points for best fit? What is it that you found experimentally (energy?) and what are you calculating with E*B^2/pq (made up)?

5. Feb 28, 2008

### garyman

$$\Delta$$E=2$$\mu$$*B ,where E is doublet energy spacing, mu is the Bohr Magnetron and B is the magnetic field strength. I used excel to plot a linear-least squares regression line.

6. Mar 2, 2008

### Mindscrape

This is all taken from Taylor, imagine you have a line of y=A+Bx, and if you want to fit to a line then a chi squared minimization would tell you that the constants will be

$$A=\frac{\sum x^2 \sum y - \sum x \sum xy}{\Delta}$$

$$B = \frac{B \sum xy - \sum x \sum y}{\Delta}$$

$$\Delta = N \sum x^2 - (\sum x)^2$$

The measurements of each yi, in your case the energy, have their own uncertainty that does not necessarily follow the standard deviation, so we do a sort of least squares standard deviation

$$\sigma_y = \sqrt{\frac{1}{N-2}\sum_{i=1}^N (y_i - A -Bx_i)^2}$$

and now the uncertainties on each of the constants would follow as

$$\sigma_A = \sigma_y \sqrt{\frac{\sum x^2}{\Delta}}$$

and

$$\sigma_B = \sigma_y \sqrt{\frac{N}{\Delta}}$$

You should have seen the constant A pass through zero, but if you didn't then you cannot force it. Experimental data must be represented in its entirety unless Chauvenet's Criterion tells you that you can reject a certain point, if you have a measurement way outside the spread of the distribution, say a couple sigma for a normalized distribution.

Is this helpful? Sorry I couldn't get back to you before now.