I have the population denominators for high (n = 28137) and low (n = 35167) deprivation areas in a city. I want to be able to compare the # of convenience stores per capita in high and low deprivation areas to see if there are more stores in one area versus another. There are n = 43 stores in high and n = 27 in low deprivation areas.

Am I correct in assuming these variables are Poisson and that an exact Poisson test in, say R could get me what I am looking for?

I am hesitant because stores aren't really a characteristic of residents themselves. I am thinking a t-test but these data are not normally distributed and it wouldn't get around the fact the stores are not a characteristic of people in the population...although perhaps, it could be argued, it is a feature of the population itself...


Because your conclusions might depend on how you model the relationship between people and stores, let's be explicit about that.

One reasonable approach that seems in the spirit of the question is to suppose that stores emerge randomly as a function of the population: each new person creates a chance $\lambda$ of a new store appearing. More explicitly (and slightly more generally) let us posit that the distribution of the number of stores in an area with $n$ people is indeed Poisson with a parameter equal to $\lambda n$.

Under the null hypothesis of no difference between the two areas we would estimate $\lambda$ as the mean number of stores per person:

$$\hat{\lambda} = \frac{43 + 27}{28137 + 35167}.$$

How consistent are the data with this hypothesis? One way to tell, without any further analysis, would be to simulate data for the numbers of stores given these two populations. In such a simulation the numbers of stores in the first area would have a Poisson$(28137\hat{\lambda})$ distribution and the numbers in the second area would have a Poisson$(35167\hat{\lambda})$ distribution. The simulation results would therefore look like the histograms in the figure below. That figure marks the actual observations with vertical red lines: the numbers of stores appear to be high for the high deprivation area and low for the low deprivation area.

We can formalize and quantify this appearance by constructing a statistic that appropriately measures the differences in stores per capita. A good one would be a Student T-like statistic that divides the difference in stores per capita (compared to the expected difference) by its standard deviation. Denote the two areas by indexes $1$ and $2$, their populations by $n_1$ and $n_2,$ the (true but unknown) underlying rates $\lambda_1$ and $\lambda_2,$ and the total numbers of stores in the two areas by $X_1$ and $X_2.$ Assuming these numbers are statistically independent (which is a useful starting hypothesis), it follows that

$$\mathbb{E}(X_2 - X_1) = \lambda_2 n_2 - \lambda_1 n_1$$


$$\text{Var}(X_2 - X_1) = \text{Var}(X_1) + \text{Var}(X_2) = n_1 \lambda_1 + n_2 \lambda_2.$$

Under the null hypothesis that $\lambda_1 = \lambda_2,$ the mean $\mathbb{E}(X_2-X_1)$ is estimated as

$$\hat{\lambda} (n_2 - n_1) \approx 7.7736$$

and the variance will be estimated just as simply by

$$\widehat{\text{Var}}(X_2 - X_1) = X_1 + X_2 = 70$$

whence the T statistic is

$$T = \frac{27-43 - 7.7736}{\sqrt{70}} \approx -2.8415.$$

A normal approximation to its distribution is accurate because both store counts are fairly large. Because the alternative hypothesis is only that the two rates might differ, this two-sided test gives a p-value of $2\Phi(-|-2.8415|) \approx 0.00449,$ which is small: the difference looks significant. The simulation provides a check: in $10,000$ iterations, I found only $40$ of them, or $0.004$ of the total, exhibited a T statistic larger in absolute value than the one actually observed. (The values of $\pm 2.8415$ are shown in the histogram of these statistics.) This is close agreement with the Normal approximation.

In summary, these data are not consistent with the model and the additional hypotheses made in the foregoing analysis. Therefore at least one of the following is not true:

  • The store counts do not even approximately have Poisson distributions with rates proportional to the populations; and/or

  • The store counts are not independent.

In either case it would be fair to say there is a "significant difference" in the per-capita numbers of stores in these two regions.


R code to produce the calculations and figures follows.

# Data
people <- c(High=28137, Low=35167)
stores <- c(High=43, Low=27)
# Estimates and tests.
lambda <- sum(stores)/sum(people)
n <- 10^4
sim <- matrix(rpois(n*length(stores), lambda*people), ncol=length(stores), byrow=TRUE)
colnames(sim) <- c("High", "Low")

t.stat <- function(stores, people) {
  m = diff(sum(stores)/sum(people) * people)
  (diff(stores) - m) / sqrt(sum(stores))

t.sim <- apply(sim, 1, t.stat, people=people)
sum(abs(t.sim) > abs(t.stat(stores, people))) / n # The simulation p-value
2 * pnorm(-abs(t.stat(stores, people)))           # The normal approximation
# Figures
plot.sim <- function(s) {
  hist(sim[, s], freq=FALSE, main=paste(s, "deprivation simulation"), xlab="Stores")
  #abline(v=(lambda * people)[s], col="Blue")
  abline(v=stores[s], col="Red", lwd=2)
plot.sim("High"); plot.sim("Low")
hist(t.sim, main="T statistic in simulation", xlab="T", freq=FALSE)
abline(v = t.stat(stores, people)*c(-1,1), col="Red", lwd=2)
  • 1
    $\begingroup$ Yes, we could just apply a Poisson GLM, but I offer this more elaborate answer to show how the problem can be resolved using elementary statistical reasoning and methods. $\endgroup$ – whuber Feb 24 '14 at 18:53
  • 1
    $\begingroup$ Thanks! Running an exact Poisson gives me a significant p-value for the rate ratio difference (similar to that for your t-test). I wasn't sure how to code the t-test, so thanks for the code, all the code actually $\endgroup$ – MegPophealth Feb 24 '14 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.