Terry Therneau
2009-Oct-28 13:52 UTC
[R] MLE for lambda of Poisson distribution using fitdistr
In general Poisson data consists of a pair of numbers (y,n), where y is the event count for the unit and n is the size of the unit. The Poisson MLE is sum(y)/sum(n). A general example is county level data where y is the number of events (rare cancer) and n is the county size. Two special cases are where n==1 for all cases and the mle=mean(y), or where y==1 for all subjects and n= observation time until the first event, where mle=1/mean(n). My preferred way to fit the distribution is glm( y ~ offset(log(n)) + other covariates, family=poisson) because of the mature printout,standard errors, residuals, etc. The other covariates are optional of course. If n=1 for all observations the offset can be omitted. Terry Therneau