R Programming/Count Data Models

Fake data simulations
We assume that y follows a poisson distribution with mean exp(1 + 1 * x). We store the data in the "df" dataframe.

Maximum likelihood
We estimate this simple model using the glm function with family = poisson as option.

Bayesian estimation
The model can also be estimated using bayesian methods with the  function which is provided in the MCMCpack.

Overdispersion test

 * dispersiontest (AER package) provides a test for equidispersion.

Zero inflated model
See the zic package

Bivariate poisson regression

 * bivpois package for bivariate poisson regression.