# Uncertainty when substracting average from the same data set

I have a data set with its own measurement uncertainties. Then I do averaging of the population and use standard error of the mean as the uncertainty for the average.

My question is, I need to substract this average value from the data. But I'm confused whether to use the previous uncertainty value for the final result (because the average doesn't contribute to measurement error). Or to use quadrature to calculate new uncertainty for the data.

Any help is appreciated!

Edit: I think context is important here. I have velocity data for several object. But all of these objects have a motion relative to a reference point and I just need internal relative motion between them. So what I need to do is to find average motion relative to the reference point and then subtract them from the data. Hence my question, when calculating uncertainty of internal motion, how I incorporate the uncertainty in mean calculation...

• If you subtract a given number from all the data, then you subtract the same amount from their mean, but will not affect their dispersion. Oct 24, 2021 at 23:38
• Here what I want to do is to substract the mean of the data from the data itself. Then, for uncertainty of the result should I left it as it is (mean is from same data either way) or incorporate the uncertainty of mean calculation to the final uncertainty... Oct 25, 2021 at 2:47

Normal data. If data are from the population distribution $$\mathsf{Norm}(\mu, \sigma),$$ then the the sample mean has $$\bar X \sim \mathsf{Norm}(\mu, \sigma/\sqrt{n}),$$ the sample variance has $$\frac{(n-1)S^2}{\sigma^2} \sim \mathsf{Chisq}(n-1),$$ and $$\frac{\bar X - \mu}{S/\sqrt{n}} \sim \mathsf{T}(n-1),$$ where the denominator of the latter quantity is called the (estimated) standard error of $$\bar X.$$

It follows that a 95% confidence interval for $$\mu$$ is of the form $$\bar X - t^*\frac{S}{\sqrt{n}},\bar X + t^*\frac{S}{\sqrt{n}},$$ where $$t^*$$ cuts probability $$0.025$$ from the upper tail of the symmetrical distribution $$\mathsf{T}(n-1).$$

If the population is has a large variance (or SD), then (for a given sample size and significance level) the confidence level will be wider than if the population has a small variance (or SD). [In R, one can get a confidence interval for $$\mu$$ from normal data, by using the procedure t.test, which also makes such an CI.]

set.seed(2021)
x1 = rnorm(70, 50, 10)
summary(x1)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
27.44   40.44   49.39   49.09   55.41   71.20
[1] 10.7337                # larger sample SD

x2 = rnorm(70, 50, 3)
summary(x2);  sd(x2)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
41.90   47.56   49.60   49.42   51.45   57.36
[1] 3.162587               # smaller sample SD

t.test(x1)$conf.int [1] 46.53291 51.65163 # larger width 5.118722 attr(,"conf.level") [1] 0.95 t.test(x2)$conf.int
[1] 48.66280 50.17099      # smaller width 1.508184
attr(,"conf.level")
[1] 0.95


So, for normal data the width of the confidence interval for $$\mu$$ mirrors the size of the sample SD. You cannot say just from looking at the sample mean whether the confidence interval for $$\mu$$ will be 'narrow" or 'wide'; that depends on the size of the sample standard deviation.

However, if a sample has unusually large variability because it is not taken from a normal population, then the formula for finding the CI for the population mean as shown above will not be valid.

Consider the following sample of size $$n= 70$$ from an exponential population with mean $$\mu = 50.$$

set.seed(412)
x3 = rexp(70, 1/50)
summary(x3);  sd(x3)
summary(x3);  sd(x3)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
2.175  19.566  35.092  51.940  63.599 250.853
[1] 49.57416     # SD of EXPONENTIAL sample


Exponential data. In this case--with nonnormal data--it is wrong to use a t interval as a confidence interval for $$\mu.$$ So even though t.test uses the sample mean and sample variance to make a "confidence interval," the results are not useful. The interval was obtained using an inappropriate formula.

t.test(x3)\$conf.int
[1] 40.11981 63.76090
attr(,"conf.level")
[1] 0.95


A correct confidence interval for the mean $$\mu$$ of of an exponential population uses the sample mean along with boundaries obtained from a gamma distribution to obtain a correct 95% CI $$(51.64, 66.63)$$ for $$\mu,$$, as shown below:

mean(x3)/qgamma(c(.975,.025), 70, 70)
[1] 41.63607 66.62872


Notes: (1) The sample mean $$\bar X$$ from an exponential distribution has $$\frac{\bar X}{\mu} \sim \mathsf{Gamma}(\mathrm{shape}= n, \mathrm{rate}=n).$$ Accordingly, a 95% CI for $$\mu$$ is of the form $$\left(\frac{\bar X}{U},\frac{\bar X}{L}\right).$$ where numbers $$U$$ and $$L$$ cut probability $$.025$$ from the upper and lower tails, respectively, of a (right-skewed) gamma distribution.

(2) Sometimes you may see statements that for sample sizes $$n \ge 30,$$ it is OK to use t intervals even if the population is not nearly normal. Sometimes this works as an approximation because means of large samples tend to be normally distributed, according to the Central Limit Theorem. But IMHO such "approximations" are sometimes more "wrong" than "approximate." And there seems little excuse for using an approximation when an exact procedure is readily available.

• Thank you for your elaboration. If I want to substract the data with the average. Should I propagate the CI to measurement uncertainty from the data or not? Oct 25, 2021 at 6:45
• Don't know your goal. (a) CIs using t for normal means are based on estimated standard errors and give an interval in which the true population is likely to be found. (b) If you just want a measurement of sample variability, use the SD. (c) If you want a measurement of the variability of the sample mean, then sample size is important, so use estimated standard error. // t CI is very commonly used: Centered at sample mean and width gives a useful idea of variability. Oct 25, 2021 at 7:17