# Testing the difference between two ratios of Poisson variables

I have two ratios of four independent Poisson variables $$R_1=\frac{\large Po(\mu_1)}{\large Po(\gamma_1)}, R_2=\frac{\large Po(\mu_2)}{\large Po(\gamma_2)}$$.

The Poisson variables are tallies, they are the cardinalities of four sets. $$Set_1$$ has $$\mu_1$$ elements, so it's cardinality, $$\mu_1$$, being a count, it's supposed to be the realization of a Poisson variable with mean $$\mu_1$$. $$Set_2$$ has $$\gamma_1$$ elements, $$Set_3$$ has $$\mu_2$$ elements and $$Set_3$$ has $$\gamma_2$$ elements. So we have four numbers that, being counts, are supposed to be the realization of four Poisson independent variables.

It's proven that the ratio of two independent Poisson variables has a Normal distribution (Tralissa F. Griffin, 1992). So we have two independent Normal variables: $$R_1 \sim N(\frac{\mu_1}{\gamma_1},\frac{\mu_1}{\gamma_1^2}+\frac{\mu_1^2}{\gamma_1^3})$$ and $$R_2 \sim N(\frac{\mu_2}{\gamma_2},\frac{\mu_2}{\gamma_2^2}+\frac{\mu_2^2}{\gamma_2^3})$$.

Now I want to test if $$R_1$$ and $$R_2$$ have significantly different means. The statistic difference of means between two Normal variables is Normally distributed with mean the difference of means and variance the sum of variances each divided by the sample size. We standardize the statistic by substracting the mean (zero if the hypotesis is right) and dividing by the standard deviation, so the normalized test statistic is:
$$Z_{n,m}=\frac{\frac{\mu_1}{\gamma_1}-\frac{\mu_2}{\gamma_2}}{\sqrt{\sigma_1^2/n+\sigma_2^2/m}}$$, where $$n$$ and $$m$$ are the samples sizes. Hypothesis is rejected at $$95\%$$ confidence if $$|Z|>1.96$$.

Now the question is: what do I use for $$n$$ and $$m$$? Since I have one value for $$R_1$$ and one value for $$R_2$$ is it correct to say that samples sizes are $$n=m=1$$?

• Claims about the distribution of $$R_1$$ (or $$R_2$$) can tested by generating two vectors v1, v2 from two Poisson distributions with means mu and gamma, calculating the vector $$R$$ = v1/v2 and verifying that the mean and variance are very close to those predicted. The approximation is higher the higher are mu and gamma.
• The goodness of approximation is not depending on sample size, which is never mentioned, but on the means of the Poisson distributions. Zeros and truncated Poissons are already accounted for and goodness of approximation is the better the higher the Poissons means. Regarding this case the means are far greater than 25, so the Normal approximation holds. So we have two Normal variables, R1 and R2 and we want to test if the difference between their means (for which we can use a Normally distributed statistic) is significantly different from zero, that is, if their means are significantly different (ratio or log ratio of means wouldn't be Normally distributed, would it?).
• We have four independent sets and four tallies, each tally is the cardinality of a set. So we have four independent numbers, each one supposed to be the realization of a Poisson variable, being a count. The objective is that stated, that is calculate the ratios and test whether they are significantly different.
• I cannot make sense of your notation or your claims. Because Poisson variables are discrete and non-negative, so is their ratio, whence it cannot possibly have a Normal distribution. In fact, the ratio isn't even defined because there is positive probability that the denominator is zero. Please clarify your question.
– whuber
Commented Sep 18, 2022 at 11:03
• Ratios are not added or subtracted. Consider instead the ratio of two ratios (or the log of that ratio of ratios). Commented Sep 18, 2022 at 11:43
• @whuber What notation don't you understand? Second, they are not mine and they are not "claims" (check article). Third, you can test it by generating two vectors v1, v2 from two Poisson distributions with means mu and gamma, calculate the ratios v1/v2 and verify that mean and variance are close to those predicted. The approximation is higher the higher are mu and gamma.
– Luke
Commented Sep 18, 2022 at 11:49
• Looking at Griffin 1992 the difference in two Poisson ratios is not normally distributed. It has a limiting normal distribution as $n \rightarrow \infty$ as she demonstrated. That does not necessarily help you with practical sample sizes. Griffin also deals with what @whuber noted about zeroes, I think by switching to a truncated Poisson distribution. Commented Sep 18, 2022 at 15:10
• Could you step back and describe the actual scientific problem that you are modelling. then the statistical experts (not me) can give you assistance. eg where do these ratios come from? can all the counts be modelled in a single poisson regression, so that your test ends up being just a standard test on a coefficient? assuming there is not a cleaner modelling approach, one might suggest using a bootstrap approach... Commented Sep 18, 2022 at 17:06

I write this as an answer because I think it's the answer, there is code and I think it can be useful to others seraching for the subject.

Following the comment of seanv507 I bootstrapped the difference of means of $$R_1$$ and $$R_2$$ and it has the theorically predicted mean and variance: $$\overline{R}_1-\overline{R}_2 \sim N(\frac{\mu_1}{\gamma_1}-\frac{\mu_2}{\gamma_2},\sigma_1^2/n+\sigma_2^2/m)$$.

With one value for each Poisson the resulting variance has $$n=m=1$$, with $$10$$ values for each Poisson the resulting variance has $$n=m=10.$$

This is the R code for bootstrapping:

#n=m=1
bootstrap1 = function() {
po1 <- rpois(1, lambda = 8123)
po2 <- rpois(1, lambda = 10562)
po3 <- rpois(1, lambda = 529)
po4 <- rpois(1, lambda = 3899)
r1 = po1/po2
r2 = po3/po4
diff = r1 - r2
return(diff)
}
diff_means = replicate (1000, bootstrap1())
mean = mean(diff_means)
var = var(diff_means)
predicted_mean = 8123/10562 - 529/3899
var_r1 = 8123/10562^2+8123^2/10562^3 #check the variance expression for R1 and R2 in the question
var_r2 = 529/3899^2+529^2/3899^3
predicted_var = var_r1 + var_r2
#var very close to predictd_var
qqnorm(diff_means)
qqline(diff_means)

#n=m=10
bootstrap2 = function() {
po1 <- rpois(10, lambda = 8123)
po2 <- rpois(10, lambda = 10562)
po3 <- rpois(10, lambda = 529)
po4 <- rpois(10, lambda = 3899)
r1 = mean(po1)/mean(po2)
r2 = mean(po3)/mean(po4)
diff = r1 - r2
return(diff)
}
diff_means = replicate (1000, bootstrap2())
mean = mean(diff_means)
var = var(diff_means)
predicted_mean = 8123/10562 - 529/3899
var_r1 = 8123/10562^2+8123^2/10562^3 #check the variance expression for R1 and R2 in the question
var_r2 = 529/3899^2+529^2/3899^3
predicted_var = var_r1/10 + var_r2/10
#var very close to predictd_var
qqnorm(diff_means)
qqline(diff_means)


So, since I have one value for each Poisson, $$n=m=1$$, as confirmed by bootstrapping.