macro TwoSamplePoisson c1 c2 #This macro reports the p value for the two-sample Poisson test of #Ho: mu(1) = mu(2) versus Ha: mu(1) <> mu(2). c1 and c2 are the counts #from the two independent treatment groups and it is assumed that they #are drawn using the same size inspection unit. Results from the large #sample approximation method and the binomial method are reported. The #F method in Kanji is equivalent to the binomial method. #See www.ucs.louisiana.edu/~kxk4695/TwoPoisson.pdf for binomial method. #See http://helios.bto.ed.ac.uk/bto/statistics/tress10.html for LS method. #See Kanji, 100 Statistcal Tests, Sage Publications, 1999 for the F method. #Example calling statement: # mtb > %twosamplepoisson 3 8 #Rev. (3/2/05, PGM) Wrote original code for LS and binomial methods in V14. #Copyright (c) 2005 Mathews Malnar and Bailey, Inc. #Mathews Malnar and Bailey, Inc. #217 Third Street, Fairport Harbor, OH 44077 #Phone: 440-350-0911 #Fax: 440-350-7210f #E-mail: pmathews@apk.net, paul@mmbstatistical.com #Web: www.mmbstatistical.com #This macro may contain errors or report erroneous results. MM&B Inc. take no #responsibility for the use or misuse of this macro. mconstant c1 c2 c csum pLS pbinom z #By large-sample approximation: if c1 < c2 let c = c1 else let c = c2 endif let csum = c1+c2 let z = ((c-csum/2)+0.5) / sqrt(csum/4) #with continuity correction cdf z pLS let pLS = 2*pLS #two-tailed test if pLS > 1 let pLS = 1 endif #By binomial method: cdf c pbinom; binomial csum 0.5. let pbinom = 2*pbinom if pbinom > 1 let pbinom=1 endif print pLS pbinom endmacro