0

This is probably a trivial question, but how can I best calculate/visualize the absolute difference in a value between two groups? Imagine I have 2 groups (A and B), for which I have several 'traits'. Group A has a larger value than group B for trait a, but group B has a larger value for trait b than group A . I'm now interested in calculating (visualizing) the difference in trait a and b between the groups (in percentage), irrespective of direction. What do I take as 100%?

My idea is to calculate the difference from the mean of the groups, but I'm not sure this makes sense. Imagine that for trait a, group A has a value of 4.5 and group B a value of 5.1.

Thus, the absolute difference (in percent) between the groups from their common mean for this trait would be (syntax for R):

abs(1 - (4.5 / mean(c(4.5, 5.1)))) * 100 = 6.25%

or

abs(1 - (5.1 / mean(c(4.5, 5.1)))) * 100 = 6.25%

So this would yield the same result irrespective of whether group A or B has a larger trait value. Does this make sense? If so, is there a specific name for the absolute difference between groups from their common mean?

8armed
  • 71
  • 3
  • Try again with values of, say, $1$ and $99$ instead of $4.5$ and $5.1.$ (The problem with your example is that the two numbers are too close together to reveal what's going on.) It sounds like you are looking for the *geometric mean* of the groups. – whuber Nov 08 '21 at 20:58
  • Ok, so when I plug in 1 and 99 instead of 4.5 and 5.1, I get a 98% difference between the groups from their common mean.... I agree that this doesn't seem to make a lot of sense in light of a putative 6.25% difference in the previous example.. – 8armed Nov 08 '21 at 21:06
  • Notice that the geometric mean of $1$ and $99$ is very close to $10$ and that $1$ is $10\%$ of $10$ and $10$ is $10\%$ of $99$ (approximately). Is this the relationship you are looking for? – whuber Nov 08 '21 at 21:10
  • Maybe, but this is just not really intuitive to me (I'm working in the field of biology). In fact, I have never seen people working with the geometric mean... Is there an alternative way you see of how to calculate the relative difference between two groups for several measurements when sometimes group A has larger values and sometimes group B..? – 8armed Nov 08 '21 at 21:10
  • There are infinitely many ways: for just a few of them, see https://stats.stackexchange.com/a/201864/919. Start by telling us how you wish to *interpret* your "relative difference" and perhaps that will enable someone to make an informed suggestion. – whuber Nov 08 '21 at 21:13
  • Ok, so let's say the forefinger of group A is, on average, 4 cm and for group B it's 5 cm. Whereas the total hand length is 14 cm for group A and 13 for group B. I now wish to simply visualize, in an intuitive way, the relative/fold difference between the groups for many such measurement (neglecting in which direction the difference occurs). – 8armed Nov 08 '21 at 21:16
  • The RPD is one way to do that: see the link in my previous comment. – whuber Nov 08 '21 at 21:18
  • ok, just checking it out... thanks – 8armed Nov 08 '21 at 21:22

0 Answers0