macro poisson x lambda; cum. #Macro finds the Poisson or cumulative Poisson probability. #Mathews and Malnar, Statistical Trainers and Consultants #217 Third Street, Fairport Harbor, OH 44077 #440-350-0911 pmathews@apk.net mconstant x lambda Px i cumPx note note Macro is running ... note if cum let cumPx=1 #first x is x=0 do i=1:x #this could be a lot faster call onex i lambda Px let cumPx=cumPx+Px enddo let cumPx=cumPx/exp(lambda) print cumPx else call onex x lambda Px let Px=Px/exp(lambda) print Px endif endmacro macro onex x lambda Px #This macro calculates lambda^x / x! mconstant x lambda Px i let Px=1 if x=0 return else do i=1:x let Px=Px*lambda/i enddo endif endmacro