+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 21

Thread: comparing two Poissonians

  1. #1
    Points: 1,589, Level: 22
    Level completed: 89%, Points required for next Level: 11

    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    comparing two Poissonians




    What is the proper statistical test for the following:

    I know A1 and A2 to be Poisson distributed with (unknown) means x1 and x2.
    I have a single measurement of both: n1 and n2. I want to test the zero hypothesis that x1=x2.

    Example: number of problems in an appliance over one year follows a Poisson dist. I have two appliances. One had 10 problems over the year, and the other had none. Can I conclude there is a real difference in the underlying mean numbers of problems per year? what is the p-value?

    I look for a statistic that would have a lambda independent distribution, and a value that would be "small" for identical dist. My first guess was (n1-n2)^2/(n1+n2) which has the right scaling but does not work (besides having a problem at n1=n2=0).

    Ideas anyone?

  2. #2
    TS Contributor
    Points: 4,330, Level: 41
    Level completed: 90%, Points required for next Level: 20

    Location
    MD
    Posts
    388
    Thanks
    0
    Thanked 6 Times in 6 Posts
    You should use the LRT reported by your stats package. Are you using SPSS or SAS. I dont think this LRT is based on the difference, as i recall.

    The intuitive explanation behind this is that having counts both equal to one does not carry the same evidence for the null as does counts both equal to say 50, since the variance is a function of lambda.
    Last edited by fed1; 06-22-2010 at 11:43 AM.

  3. #3
    Points: 2,198, Level: 28
    Level completed: 32%, Points required for next Level: 102

    Posts
    275
    Thanks
    0
    Thanked 1 Time in 1 Post
    My first thought was also to use the LRT, but there might be a problem with the 0 count. You would have to assume that 0^0=1, and I'm not sure what a statistical software package would do when it tried to evaluate that expression.

    If you make the 0^0=1 assumption, I'm getting a p-value of .049.
    Last edited by squareandrare; 06-22-2010 at 01:52 PM.

  4. #4
    TS Contributor
    Points: 4,330, Level: 41
    Level completed: 90%, Points required for next Level: 20

    Location
    MD
    Posts
    388
    Thanks
    0
    Thanked 6 Times in 6 Posts
    if the count is 0 then there is no variance. Nothing to explain = nothing to test.

    There is no test for events that have never been observved.

    Sounds like square has the right formula, care to share?

  5. #5
    Points: 2,198, Level: 28
    Level completed: 32%, Points required for next Level: 102

    Posts
    275
    Thanks
    0
    Thanked 1 Time in 1 Post
    The MLE for u for a count of 0 is straight-forward. It's 0.

    Let u1 be the mean parameter for the first distribution and u2 be the mean for the second distribution.

    Under the null, u1=u2=u.

    The MLE (again, straight-forward) is u=5.
    So, the numerator of the Likelihood ratio will be [ e^(-5)*5^10/10! ] * [ e^(-5)*5^0/0! ].

    Under the alternative hypothesis, the MLE for u1 is 10, and the MLE for u2 is 0.

    Now, let's think about what it means to be Poisson with mean parameter 0. Technically, it's undefined, as the mean parameter is defined as positive. However, it seems to me that it would have to take the value 0 with probability one. So that implies that (e^0*0^0/0!)=1. Since e^0=(0!)=1, that would imply that 0^0 has to equal 1 (technically, 0^0 is indeterminate).

    So, if we assume that (e^0*0^0/0!)=1, the denominator of the Likelihood ratio would be:

    e^(-10)*10^10/10! *1

    Simplifying the numerator and denominator of the Likelihood ratio, we get (5^10)/(10^10) = 2^(-10).

    -2*ln( 2^(-10) ) = 20*ln(2) = 13.8629, which follows Chi-square with one degree of freedom (we estimated one additional parameter under the alternative). This has a p-value of about .0002.
    Last edited by squareandrare; 06-23-2010 at 01:27 AM. Reason: screwed up numerator of LR

  6. #6
    TS Contributor
    Points: 4,330, Level: 41
    Level completed: 90%, Points required for next Level: 20

    Location
    MD
    Posts
    388
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Yeah, only one count 0 is fine,

    the estimate of u under the null should be 10.

  7. #7
    Points: 2,198, Level: 28
    Level completed: 32%, Points required for next Level: 102

    Posts
    275
    Thanks
    0
    Thanked 1 Time in 1 Post
    Quote Originally Posted by fed1 View Post
    the estimate of u under the null should be 10.
    No, it shouldn't.

    L(u) = [ e^(-u)*u^10/10! ] * [ e(-u)*u^0/0! ]
    =e^(-2u)*u^10/10!
    ln(L(u))=-2u+10ln(u)-ln(10!)
    Take derivative wrt u and set to 0:
    0=-2+10/u
    u=5

    That's the derivation, and it should be intuitive that the estimate of the mean is going to be the mean of the observations: (10+0)/2=5

  8. #8
    TS Contributor
    Points: 4,330, Level: 41
    Level completed: 90%, Points required for next Level: 20

    Location
    MD
    Posts
    388
    Thanks
    0
    Thanked 6 Times in 6 Posts
    oops, I experienced brain fart, I was thinking it was the sum of the counts for some reason!

  9. #9
    Points: 2,198, Level: 28
    Level completed: 32%, Points required for next Level: 102

    Posts
    275
    Thanks
    0
    Thanked 1 Time in 1 Post
    Yeah, those brain farts happen. It is essentially the sum of the counts divided by the total time. You can think of it as a count of 10 over 2 years (even though the processes were in parallel over the same year), so the mean per year is obviously 5.

  10. #10
    Points: 2,198, Level: 28
    Level completed: 32%, Points required for next Level: 102

    Posts
    275
    Thanks
    0
    Thanked 1 Time in 1 Post
    ...****, speaking of brain farts, my numerator isn't right. I forgot to multiply by e^(-5)*5^0/0!

    Ok, the test statistic should be 13.86, which follows Chi-square df=1 and p-value=.0002

    Previous post has been edited to correct the error...
    Last edited by squareandrare; 06-22-2010 at 05:27 PM.

  11. #11
    Ninja say what!?!
    Points: 8,297, Level: 61
    Level completed: 49%, Points required for next Level: 153
    Link's Avatar
    Posts
    1,165
    Thanks
    37
    Thanked 84 Times in 76 Posts
    Hey guys. I have a question and hope that you'll chime in.

    I had the same reasoning to Square's solution when I read the question. However, there's one thing I haven't come to accept. If the two observations do indeed come from different distributions, is it really logical to use one obs per parameter?

    Even if we're forced to accept a Poisson distribution, the difference between the log likelihood for the model and the null would be so small that we would have to reject the model.

  12. #12
    Points: 2,198, Level: 28
    Level completed: 32%, Points required for next Level: 102

    Posts
    275
    Thanks
    0
    Thanked 1 Time in 1 Post
    Yeah, samples of size 1 might be a problem because -2*log-likelihood-ratio is asymptotically Chi-square. For small samples, it may deviate significantly from the Chi-square distribution.

  13. #13
    Ninja say what!?!
    Points: 8,297, Level: 61
    Level completed: 49%, Points required for next Level: 153
    Link's Avatar
    Posts
    1,165
    Thanks
    37
    Thanked 84 Times in 76 Posts
    Great! Thanks for verifying my suspicion! Good thread.

  14. #14
    Points: 1,589, Level: 22
    Level completed: 89%, Points required for next Level: 11

    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you all!

    The ratio of liklihoods sounds like a good idea, but it's not chi^2 distributed. Any idea what it *is* distributed like for one measurement for each sample?

    Thanks!

  15. #15
    Points: 1,589, Level: 22
    Level completed: 89%, Points required for next Level: 11

    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PS does it distribute like chi^2 at least when the count number is large (e.g. 500 and 450 instead of 10 and 0 as in my example) ?

+ Reply to Thread
Page 1 of 2 1 2 LastLast

           




Similar Threads

  1. Comparing 2 Anovas
    By ndogg in forum Psychology Statistics
    Replies: 0
    Last Post: 01-20-2011, 09:02 AM
  2. Comparing two distributions
    By SuzanneMonette in forum Statistics
    Replies: 4
    Last Post: 10-29-2010, 07:42 AM
  3. Comparing Fs
    By Philyuko in forum Statistics
    Replies: 23
    Last Post: 02-03-2009, 02:00 PM
  4. Comparing two conditions, n=1
    By MethoxyRoxy in forum Statistics
    Replies: 3
    Last Post: 11-04-2008, 10:25 AM
  5. Comparing mean of 3 samples
    By Andrew! in forum Statistics
    Replies: 5
    Last Post: 09-16-2008, 03:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats