Skip to content

comparing poisson distributions

4 messages · Mark Gosink, Greg Snow, Rolf Turner

2 days later
#
There are a few different options that you can try depending on your
problem and your preferences:

1.  For large lambda the poisson can be approximated by a normal, for
large n (even for small lambda) the mean is approximately normal due to
the central limit theorem.  So if your lambda and n are large enough in
combination then you could just do a standard 2 sample t-test (t.test
function) and use the approximate p-value from there.

2.  Fit 2 models by maximum likelihood, one in which both lambdas are
equal and one in which they can differ (fitdistr from MASS may help, or
look at optim and friends), then do a likelihood ratio test on the
differences (-2 * likelihood diff is approx chisquared(1) under the
null).

3.  Do a permutation test:  find the difference in the
means/medians/(other stat of interest) between the 2 samples, then
permute the samples randomly (create 2 samples of the same sizes from
the original data values, but with random assignment as to which group a
value goes into) and find the same difference, repeate a bunch of times
(like 1998) and combine all the differences found into a vector, plot
the histogram of the values and look at where the original difference
fits into the distribution.  The number of values that are as or more
extreeme than the original value is your p-value.

4.  Create logical bins for values (e.g. 0-1, 2-3, 4-6, 7+) and count
how many from each group fall in each bin, use prop.test or chisq.test
to see if the proportions differ.

5.  Probably some others that don't come to mind right now.

Hope this helps,
#
The other one I should have mentioned:

5.1:  Use the glm function with family = poisson.  The counts are the y
variable and the x variable is either 0/1 or a 2 level factor indicating
which group the values come from.  The p-value for the slope of x tests
for a difference in the 2 groups.

5.2 if this is just to make someone happy who always wants a p-value,
but doesn't understand it and will never actually use it, then use
runif.

5.3 ...
#
On 21/12/2007, at 10:53 AM, Greg Snow wrote:

            
A fortune?

		cheers,

			Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}