3
$\begingroup$

An instrument used for measurements has a known measurement imprecision of $CV = 10 \%$. Thus, if the variable to be measured has a true value $x_{true}$, the range of possible measured values will be given by:

$x_{measured} \sim \mathcal{N}(x_{true},\,(0.1\cdot x_{true})^2)$

Say we have two measurements, $x_{1_{measured}} = 100$ and $x_{2_{measured}} = 50$. We can easily calculate the 95% CI for $x_{1_{true}}$ and $x_{2_{true}}$ in R:

cv <- .1
x1_measured <- 100; x2_measured <- 50    
x1_true_ci <- x1_measured / qnorm(c(.975, .025), 1, cv)
x2_true_ci <- x2_measured / qnorm(c(.975, .025), 1, cv)

However, I would like to determine a 95% CI for the ratio $\frac{x_{2_{true}}}{x_{1_{true}}}$. My current approach is to simulate ratios and then use quantile() to find the 2.5% and 97.5% quantiles as follows:

ratio_sim <- (x2_measured / rnorm(1e6, 1, cv)) / (x1_measured / rnorm(1e6, 1, cv))
ratio_ci <- quantile(ratio_sim, c(.025, .975))

log(ratio_sim)appears to be close to normally distributed, although I would assume that it is actually a kind of ratio distribution? Anyway, calculating the 95% CI from log(ratio_sim) yields values very similar to the quantiles calculated previously:

ratio_ci2 <- qlnorm(c(.025, .975), mean(log(ratio_sim)), sd(log(ratio_sim)))

My question: is there a more direct, less computationally intensive way to estimate the 95 % CI for the ratio, without using simulation?

$\endgroup$

1 Answer 1

4
$\begingroup$

As you evaluate the measurement imprecision with a coefficient of variation (CV), then you could approach this by working with the logarithms of the observations.* If you assume a constant CV, then in the log scale you are assuming constant SD/variance independent of measurement value, as underlies much linear modeling.

The log of the x2/x1 ratio is simply the difference in the logs, log(x2) - log(x1), so you can use the basic properties of variance to estimate the variance of that difference in the log scale. If log(x1) and log(x2) are uncorrelated, then the variance of their difference is the sum of their individual variances. You use that to get confidence intervals (CI) in the log scale, then transform them back if desired into the original scale by exponentiation.

There are more complicated and exact ways to calculate CI for ratios of normally distributed variables. The simplification here comes from working with the mean of the log of the ratio rather than the mean ratio itself. Under your assumption of constant CV, however, this is a simple way to proceed.


*What you seem to be assuming is a log-normal distribution for your measurements. If you want to pursue simulations, you might consider working directly with that distribution rather than trying to force your analysis into the normal distribution.

$\endgroup$
3
  • $\begingroup$ Thank you! This is very helpful, but how do I obtain the variances of log(x1) and log(x2) if all the information I have is cv <- .1; x1_measured <- 100; x2_measured <- 50? I can simulate values of x1_true by dividing x1_measured by rnorm(1e6, 1, cv) and then simply use var(x1_true) to find the variance, but how do I find it without simulation? Won't the distribution of x1_true be a kind of reciprocal normal distribution? $\endgroup$ Mar 9, 2022 at 17:50
  • $\begingroup$ @PederHolman with an assumed 0.1 CV in the original scale, you have an assumed SD in the log scale of 0.1 and thus an assumed variance of $0.1^2 = 0.01$ in the log scale. The variance of the difference between 2 uncorrelated observations each with a variance of 0.01 is 0.02. $\endgroup$
    – EdM
    Mar 9, 2022 at 17:57
  • $\begingroup$ Aha, of course! Thank you for clearing that up. You have answered my question perfectly, much appreciated! $\endgroup$ Mar 10, 2022 at 5:06

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.