1
$\begingroup$

I have measured $x$ and $y$ and estimated their uncertainty. They are both distributed normally. I found $x = 5 \pm 0.25$ and $y = 7 \pm 0.5$.

I want to know if these estimates are statistically different. Is it as simple as calculating $\sigma = |5 - 7|/(0.25 + 0.5) = 2.666...$, and hence (using R) $P(z > \sigma) = {\tt 1-pnorm(2.666)}\simeq 0.0038$?

Or should it be: $\sigma = |5 - 7|/\sqrt{0.25^2 + 0.5^2} \simeq 3.57$, and hence $P(z > \sigma) = \simeq 0.000178$?

$\endgroup$

1 Answer 1

1
$\begingroup$

It sounds like you've measured two samples and want to hypothesis test if they are different from each other. In which case, use chi-squared test if population standard deviation is known (unlikely), in R it's chisq.test. Or if population standard deviation is unknown (very common) then use the t test instead. In R it's just t.test(vector1, vector2). If you go with the T test then your null hypothesis is $H_0:\bar{X_1}=\bar{X_2}$ and the aletnaritve is taht they are not equal. Your formula is very close, but it's

$$\frac{\bar{X_1}-\bar{X_2}}{S_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}}$$

where

$$S_p=\sqrt{\frac{S^2_1(n_1-1)+S^2_2(n_2-1)}{n_1+n_2-2}}$$

$S_1$ and $S_2$ are just the sample standard deviations which you have already figured out. And then you got to look it up on a T test table with degrees of freedom$=n_1+n_2-2$ If you know the standard deviation then the chi squared test uses $\sigma$ instead of estimating it with $S_p$ and you look it up on the chi squared table. Again, r has all this, but you wrote a lot of maths so i thought I'd write this here just in case.

If you wanted to know how to add and subtract normal distributions from a pure maths perspective then look here. Note that they have to be independent, otherwise there's a different way to work it out (which i can link further, but leave a comment). Sorry if I've missed your point.

$\endgroup$
5
  • $\begingroup$ Thanks. What are $n_1$ and $n_2$? It sounds like it might be the number of measurements for each, but I only have one measurement of each. (For example, if I have used two different rulers to measure the length of a table.) This leads to $n_1=n_2=1$ and thus $n_1+n_2-2 = 0$ and hence division by zero. $\endgroup$ Commented Dec 2, 2018 at 15:38
  • $\begingroup$ Yeah n is just the number of observations per group. But how did you get variance of+-0.5 and 0.25 if you only had one measurement? $\endgroup$
    – Huy Pham
    Commented Dec 2, 2018 at 16:19
  • $\begingroup$ just one more thought, the example with the rulers doesn't need really stats, they're just two different measurements you know they're different. unless, you have multiple measurements using two rulers which introduces some sort of measurement error and hence variability. If you wanted some sort of error bars around your difference, you can get that using the t test, it's called a confidence interval. $\bar{X_1}-\bar{X_2} \pm t_\frac{\alpha}{2}S_p\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}$ where $t_\frac{\alpha}{2}$ is just the critical T value you got from your test. $\endgroup$
    – Huy Pham
    Commented Dec 2, 2018 at 17:05
  • $\begingroup$ Also, another thing, the T test I've written down is when the groups have equal variance but looking more closely at your question they're not the same, you should really look at the links for when groups have difference variance and other violated assumptions. Probably the Welch T test is what you should use (don't worry, it's the default in R anyway). But I'm not sure how to compare different samples when samples are literally 1--i don't know that it can easily be done. $\endgroup$
    – Huy Pham
    Commented Dec 2, 2018 at 17:10
  • $\begingroup$ The uncertainty from the ruler comes from the fact that the ruler doesn't have infinite precision. For example if I measure the table using a meter stick, the best resolution I can get is (say) 1cm. So from a single measurement I obtain something like 0.5 m +/- 1 cm. This is my situation. $\endgroup$ Commented Dec 2, 2018 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.