4
$\begingroup$

How can I draw a chart for a ratio, not a proportion, when sometimes the ratio is infinity?

Context: I am looking at prescribing of drug A and drug B. I have been drawing bar charts showing prescribing of drug A, per 1000 prescriptions of drug B, over time.

This works great, except when prescriptions of drug B drop to zero. Then I have a problem with my chart, because the proportion is infinity.

How can I visualise the ratio over time, while handling this problem?

$\endgroup$
1
  • $\begingroup$ Does prescribing of drug A ever drop to 0? $\endgroup$
    – EdM
    Commented Apr 13, 2016 at 16:32

1 Answer 1

4
$\begingroup$

From a charting perspective, the most straightforward option is to add a marginal strip plot for the b=0 cases, with some indication in the proportion plot of breaks, such as faint lines like here or line breaks.

enter image description here

Perhaps a richer option is to apply some kind of data transformation and clipping. Here's a plot of a constrained log(a/b).

enter image description here

Now the a:b proportions are symmetrical if that's important (1/1 is in the middle and 2/5 is the same distance as 5/2). However, now there is an issue with both a=0 and with b=0. Here I've clipped those values at 0.01 which is enough to make those values stand out.

Nothing definitive about this transformation -- just raising the option.

$\endgroup$
2
  • 1
    $\begingroup$ +1. I think this is a good graphical solution. But statistically if small $b$ is a problem then $\log(b/a)$ might be better, particular as there is no mention of $a = 0$. You still have a problem with zeros, which would then be plotted separately below the trace, as lower than any other observed. A more heterodox alternative is to plot $b/a$ on square root or cube root scale. $\endgroup$
    – Nick Cox
    Commented Apr 13, 2016 at 16:42
  • 1
    $\begingroup$ Some people would work with $\log[(b + 0.5)/(a + 0.5)]$ but you would need to explain that scale. $\endgroup$
    – Nick Cox
    Commented Apr 14, 2016 at 12:01

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.