The ratio between positive/negative numbers

5.1k Views Asked by At

I am creating a model that compares multiple data points of two attributes and compares them vs one another as a percentage of 100.

So for instance, comparing the values A=1.24 v B=0.44 would be:

100/(A+B)*A = 73.81% 100/(A+B)*B = 26.19%

However, one of the data points sometimes has negative numbers and I am looking for a formula to compare them in the same way; is this possible? I can compare +/+ and -/- using the above method, but it doesn't work using +/-.

Would I have to use the difference between the two numbers as a regulator? If so, I am not sure how.

So an example of the formula I would like to work out would be:

A=1.04 v B=-0.32 as a percentage of 100.

Thanks for any help - I have no formal mathematics tuition so please forgive any naivety!

2

There are 2 best solutions below

1
On

This depends entirely on how you're comparing the two numbers.

If you want, you can compare them using $$\frac{|A|}{|A|+|B|}\times100\%$$ where the vertical bars indicates absolute value.

I just want to point out that 'comparing' numbers in this way is really, really sketchy and I can't imagine many circumstances under which it would be useful. A more natural thing to do would be e.g $$X=\frac{\left||A|-|B|\right|}{|A|}\times100\%$$

whence you can say that $B$ is $X%$ more/less than $A$.

0
On

You can use your formula. It will give a percentage greater than $100$ for the positive one and less than $0$ for the negative one. There is sense to this. If you think of two divisions of a company and ask what fraction of the company profit is contributed by each, if one makes more than the whole company while the other makes a loss this is what you will get. If both make losses, the percentages will show which division contributed most to the loss.

In your example $A=1.04, B=-0.32$ the total profit is $0.72$ and $A$ contributed about $144\%$ of that while $B$ contributed about $-44\%$