# How to tell the “closeness” of two variables

I have completed an experiment measuring the magnetic field of a solenoid. The answer I got was $0.0075 \pm 0.0011$T. The uncertainty by the way was generated from Microsoft Excel's Regression under data analysis and is the standard error of the gradient of some graph. The gradient is the magnetic field, B in Tesla.

I would like to compare this with a theoretical value obtained from an approximation formula of $B = 0.0106623 \pm 0.0000007$T.

How do I determine whether my experimental result is "close" to the theoretical one??

I would imagine it being easy if my theoretical result had no uncertainty. Then I could just say that the theoretical result is about three standard errors away. But now the theoretical value has an uncertainty. How do I get across this?

Thanks.

-
The theoretical uncertainty is so small in this case that it can be ignored (for example it is much less than the precision of your experimental results). –  Henry Jun 2 '11 at 18:44
Right. Or maybe much less than the uncertainty of the experimental results. –  rolando2 Jun 3 '11 at 0:29

### Solution

When you assume the residuals (vertical deviations in a graph of $n$ data) are independently and identically distributed with some normal distribution of zero mean, the estimate of the slope will have a Student t distribution with $n-2$ degrees of freedom, scaled by the standard error. Because the theoretical value has essentially zero error, we can ignore this complication and treat the theoretical value as a constant. Therefore we refer the ratio

$$t = (0.0106623 - 0.0075) / 0.0011 = 2.88$$

to Student's t distribution (as a two sided test, because in principle the slope could have been greater or less than the theoretical value and you just want to see whether the difference could be attributed to chance).

Whether this deviation is "significant" depends on your criterion for significance and on the degrees of freedom. For example, if you want 95% or greater significance, then this difference will be significant if and only if you have six or more data values. This conclusion follows from noting that the 95% two-sided critical value with $5-2 = 3$ degrees of freedom is $3.182$, greater than $2.88$, and the critical value with $6-2 = 4$ d.f. is $2.776$, less than $2.88$.

### Discussion

If the uncertainty in the theoretical value were appreciable compared to the standard error of the slope ($0.0011$) and you had relatively few data points (perhaps 10 or fewer), the problem would become more difficult:

• First, you don't know the distribution of the theoretical error.

• Second, you probably don't know for sure that it is a standard error (people often report confidence limits or two or three standard errors or even standard deviations without clearly specifying what they have computed).

• Third, the sum of a t-distributed value (your error) and another distribution (the theoretical error) can have a mathematically less tractable distribution.

Mitigating these complications, though, is a simple consideration: if the theoretical uncertainty were largish, then it would add to the overall uncertainty in the difference between the theoretical and estimated values, thereby lowering the t-statistic. In some cases such a semi-quantitative result might be good enough. (The addition is in terms of variances: you sum the squares of the two standard errors, obtaining the square of the standard error of the difference, and (therefore) take its square root.)

For instance, if the theoretical uncertainty were equal to the uncertainty of the estimate, the t-statistic would be reduced to $2.03$. The distribution of the difference would be approximately Normal, but with slightly longer tails, so referring the value of $2.03$ to a standard Normal distribution would slightly overestimate the significance. Well, we can compute that $4.2\%$ of the standard Normal distribution is more extreme than $\pm 2.03$. Thus--still in this hypothetical situation with a largish standard error for the theoretical result--you would not conclude the difference is significant if your criterion for significance exceeds $100 - 4.2 = 95.8\%$. Otherwise, the picture is murky and the determination depends on the resolution of the difficulties enumerated above.

-