[R] MLE for lambda of Poisson distribution using fitdistr

Terry Therneau therneau at mayo.edu
Wed Oct 28 14:52:14 CET 2009

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

More information about the R-help mailing list