# Poisson Hypothesis Testing for Two Parameters

So, for fun, I am taking some of the data of calls from the call center I work at and trying to do some hypothesis testing on them, specifically the number of calls received in a week, and using a Poisson distribution to fit it. Due to the subject matter of my job, there are two types of weeks, let's call one of them on-weeks where I hypothesize there are more calls, and off-weeks where I hypothesize there are fewer.

I have a theory that the $\lambda$ from on-weeks (let's call it $\lambda_1$) is larger than that of the one from off-weeks (let's call it $\lambda_2$)

So the hypothesis I want to test is $H_0: \lambda_1 > \lambda_2, H_1: \lambda_1 \leq \lambda_2$

I know how to test for one parameter (say $H_0: \lambda_1 > 1, H_1: \lambda_1 \leq 1$) but not so sure how to go about doing 2 given a data set. Let's say I take two week's worth of data from each one $X_1 = 2$ and $X_2 = 3$ for the off-week and $Y_1 = 2$ and $Y_2=6$ for the on-week. Can someone help walk me though this simpler version such that I can apply it to a larger data set? Any help is appreciated, thank you.

• Are the calls really poisson distributed? If there's many calls they may best modeled as approximately normal. But that may kill the fun. – RegressForward Apr 9 '15 at 22:39
• Well what determines that is how you frame it right? I am receiving x number of discrete calls in a y unit time frame. I could do it as a normal distribution sure, but he whole point is I'd like to try it with Poisson since it fits. – James Snyder Apr 11 '15 at 13:12
• If you assume that the counts are Poisson then you can just add the counts (correct me if I'm wrong). That is you would get X = 2+3 and Y = 2+6. You can then test for a difference using, for example, the ´poisson.test´ in R. If you want to have a go at a Bayesian analysis I also have a blog post on that here: sumsar.net/blog/2014/09/bayesian-first-aid-poisson-test – Rasmus Bååth Apr 17 '15 at 10:35

Note that normally the equality goes in the null (with good reason).

That issue aside, I'll mention a couple of approaches to a test of this kind of hypothesis

1. A very simple test: condition on the total observed count $n$, which converts it to a binomial test of proportions. Imagine there are $w_\text{on}$ on-weeks and $w_\text{off}$ off-weeks and $w$ weeks combined.

Then under the null, the expected proportions are $\frac{w_\text{on}}{w}$ and $\frac{w_\text{off}}{w}$ respectively. You can do a one-tailed test of the proportion in the on-weeks quite easily.

1. You could construct a one tailed test by adapting a statistic related to a likelihood-ratio test; the z-form of the Wald-test or a score test can be done one tailed for example and should work well for largish $\lambda$.

There are other takes on it.

What about just used the GLM with Poisson error structure and log-link??? But the idea about binomial may be more powerfull.

• At present, this is more of a comment than an answer. Did you intend it as a comment, a question for clarification, or an answer? If the latter, can you expand it into more of answer? We can also convert it into a comment for you. – gung Apr 16 '15 at 12:10

I'd settle it with a Poisson or Quasi-Poisson GLM with a preference for quasi-Poisson or negative binomial.

The problem with using traditional Poisson is that it requires the variance and mean be equal which is very likely not the case. The quasi-Poisson or NB estimates the variance unrestricted by the mean.

You could do any of these in R very easily.

# week on = 1, week off = 0
week.status <- c(1, 1, 0, 0)
calls <- c(2, 6, 2, 3)
model <- glm(calls ~ week.status, family = poisson())
# or change the poisson() after family to quasipoisson()
# or use the neg binomial glm from the MASS package


The GLM approach is beneficial and as you can expand to include additional variables (e.g., month of year) that might impact call volume.

To do it by hand, I'd probably use a normal approximation and a two sample t test.

We start with Maximum Likelihood Estimate for Poisson parameter, which is mean.

So, $\hat\lambda_1=\bar Y~~and~~\hat\lambda_2=\bar X$

Now,you can test simply $\bar Y-\bar X\sim N(\lambda_1-\lambda_2,\frac{\lambda_1}{n_1}+\frac{\lambda_2}{n_2})$

and then compare by getting Z-Value=$\frac{(\bar Y-\bar X)-\lambda_1-\lambda_2}{\sqrt{\frac{\lambda_1}{n_1}+\frac{\lambda_2}{n_2}}}$

Note:-rejection criteria is $Z<Critical~Value$

Starting from page 125 of Casella's Testing Statistical Hypothesis the answer to the type of question you have formulated is outlined. I have attached a link to a pdf I found online of it for your reference. Casella's Testing Statistical Hypothesis, Third Edition.

• Nice pointer, however link-only-answers are discouraged on Cross Validated. Could you sketch the resolution in your answer? Thank you. – Xi'an Apr 21 '15 at 10:35
• Sorry I was not aware of that rule.Thanks for letting me know. :) Will try to give a comprehensive answer as soon as possible. – Nuzhi Meyen Apr 22 '15 at 6:39