# Retrospective power analysis of samples from Poisson distributions

I understand how the simulation at Power calculation for likelihood ratio test can compute the alpha, using prop.test, and the power from a direct count of simulation values, for two Poisson distributed variables. I am interested in doing power analysis to determine the necessary number of samples, similar to using pwr.t.test(d = d, sig.level = 0.05, power = 0.8), except doing this between two samples from (suspected) Poisson distributions, and so thus not using t-tests.

With given distributions I could calculate alpha and the Power here, how would I determine a suitable n? I suppose one way is to write a loop that calculates power for increasing n until the power falls within the desired threshold, but that seems computationally intense.

What is the best way to approach this problem?

• What is the null hypothesis of your test ? – Stéphane Laurent Oct 17 '12 at 11:26
• Why do you call this "retrospective" ? – Peter Flom Oct 17 '12 at 11:46
• I am referring to retrospective, as in, I have taken 20 samples from each distribution and want to use that information to determine how many more samples I might need to take to determine if there was an effect. If the samples were normal, or Poisson with high lambda, I would calculate the d using the existing information, and then using a desired sig.level and power determine what n would be ideally. In this case, I want to create an equivalent test but for poisson distributions of low lambda. – Matt Oct 17 '12 at 15:38
• The null hypothesis of my test here would be that lamda_1 = lambda_2, but what I am really interested in showing, in cases where I can't disprove the null hypothesis, is what number of samples I might need to take further in order to disprove the null hypothesis to my desired sig.level and power. (as in pwr.t.test) – Matt Oct 17 '12 at 15:41