# Data analysis of ratios

I am analyzing some observational data which includes the ratio of masses (two masses for the same object, but measured using different methods). In principle, it is largely arbitrary whether one chooses to consider the ratio of Mass A to Mass B or vice versa.

I want to perform some basic statistical analysis, such as excluding outliers and calculating mean/median/stdev. The nature of this dataset is such that ratios of A:B will typically range from 0.01-1, and as such ratios of B:A will range from 1-100. This makes me think that, actually, whether I choose to use A:B or B:A will matter, because in each case, the mean and median are different (and opposite types of outliers are excluded when using z-score).

My intuition is that B:A is the preferred quantity to use, because surely most statistical techniques are designed with a range greater than 0-1 in mind. But I'm not totally sure. It might be worth mentioning that I have already presented some results in A:B, so if it truly doesn't matter I'd probably go with that.

I would appreciate any advice. Thank you!

• How can “ratio of masses (of the same object, but measured using different methods) go from 0.01 to 1? Commented Mar 28, 2022 at 16:47
• @trula Sorry if I kept the question too vague! It's an astronomical object like a star, and the mass is measured indirectly. The numbers you get when using 'different methods' (which are actually different wavelengths) can be quite wildly different, but a higher wavelength (B) usually produces a higher mass. Unless you were asking if I had a dataset of measurements all for one object -- no, it's two measurements for each object and I've updated the question to clarify that since it was a bit ambigious before) Commented Mar 28, 2022 at 16:49
• My response is for a set of measurements on each object. From the above, I see you only have two measurements (using different methods) for each object. So exactly what error you interested in over the set of objects? Commented Mar 28, 2022 at 17:56

Let $$A$$ and $$B$$ be random variables representing the two different measurements for one object. Here, I assume $$A$$ and $$B$$ are independent. Let the function $$f(A, B) = A/B$$ and the function $$g(A, B)$$ be the function $$B/A$$. These are two different functions, that have different means and different errors (standard deviations).

Let set $$A$$ be a set of measurements for $$A$$ and set $$B$$ be a set of measurements for $$B$$. From this sample data estimate the means for $$A$$ and $$B$$, the standard deviations for $$A$$ and $$B$$, and the standard deviations for the means for $$A$$ and $$B$$. See my answer to Uncertainty in repetitive measurements on this site for the details. The result for $$A$$ is $$\bar A \pm S_{A,\,\mathrm{mean}}$$ and the result for $$B$$ is $$\bar B \pm S_{B,\,\mathrm{mean}}$$, using the estimated means $$\bar A$$ and $$\bar B$$ and standard deviations of the means $$S_{A,\,\mathrm{mean}}$$ and $$S_{B,\,\mathrm{mean}}$$ from the data.

The estimated mean of A/B is $${\bar A \over \bar B}$$ and the estimated mean for B/A is $${\bar B \over \bar A}$$.

In general for $$Z = X/Y$$, with $$X$$ and $$Y$$ independent, the standard deviation for $$Z$$ is

$${S_Z^2 \over \bar Z^2} = {S_X^2 \over \bar X^2} + {S_Y^2 \over \bar Y^2}. \tag{I}$$

The estimate for $$Z$$ is $$Z = \bar Z \pm S_{Z,\,\mathrm{mean}}$$ where $$S_{Z,\,\mathrm{mean}}$$ is estimated using relationship $$\rm (I)$$ (using the standard deviations of the means for $$X$$ and $$Y$$ in this relationship). See Meyer's Data Analysis for Scientists and Engineers, or a similar statistics textbook.

You can apply relationship $$\rm (I)$$ separately for each of the functions $$A/B$$ and $$B/A$$to estimate the standard deviation of the mean for both $$A/B$$ and for $$B/A$$, using the estimate means for $$A$$ and $$B$$ and the estimated standard deviations of the means for $$A$$ and $$B$$ from the data. You can report the result for either $$A/B$$ or $$B/A$$ as you prefer; either is equally valid.

For all the $$i$$ objects, you have a set of $$Z_i = \bar Z_i \pm S_{Z_i ,\,\mathrm{mean}}$$ results and you report this set.