1
$\begingroup$

I'm looking for a dataset which I can use in R modelled by the glm function with family=poisson. I need there to be at least four predictor variables and the count has to be the explanatory variable.

$\endgroup$
  • 1
    $\begingroup$ Hi, welcome to the site. Your question is rather narrowly focused on R and glm(..., family = poisson). This is typically regarded to be off-topic on this site. Also, the underlying question for recommendations about data sets is somewhat broader than recommended. See <stats.stackexchange.com/help/on-topic> for more details. $\endgroup$ – Achim Zeileis Mar 7 at 2:14
1
$\begingroup$

You can find a substantial list of datasets in the R package datasets here. There may be some datasets there that meet your needs. For example, the dataset UKDriverDeaths has a count variable for driver deaths, with some other variables that could be used as covariates.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Hi Ben, when I load that data, the resulting dataset only includes the count. Could you assist me? $\endgroup$ – Ng123 Mar 5 at 17:38
  • 1
    $\begingroup$ The UKDriverDeaths data is just the univariate time series. The Seatbelt data additionally offers various regressors. However, while the response is count data, the counts are so large that a Poisson model will fit rather poorly. $\endgroup$ – Achim Zeileis Mar 7 at 1:54
1
$\begingroup$

There are a couple of packages which provide quite a few count regression examples. See for example package countreg on R-Forge (https://R-Forge.R-project.org/R/?group_id=522), or AER (https://CRAN.R-project.org/package=AER) or COUNT (https://CRAN.R-project.org/package=COUNT) on CRAN. The AER package is more general but count data sets include Affairs, CreditCard, DoctorVisits, EquationCitations, GSS7402, Medicaid1986, NMES1988, PhDPublications, RecreationDemand, ShipAccidents.

For most of these datasets/models there are overdispersion and/or excess zeros present so that a more general model fits better, e.g., negative binomial, zero inflation or hurdle model.

If you need a well-fitting Poisson model, then ShipAccidents in AER would be worth a look. If it is ok to discuss the limitations of the Poisson model and show some generalizations, then I like the CrabSatellites data in the countreg package. See the examples on the corresponding manual pages for concrete models and illustrations.

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

Based on your requirements, the British Doctor's Smoking and Lung Cancer dataset is ideal.

Regarding GLM with a Poisson family function, most Poisson regression packages can also handle GLM's log and linear link functions. There are also geometric mixture models which can be handled by some packages. The Explorer (free) package will identify what power-link function is best for a geometric mixture model between additive and multiplicative. In summary, you commonly don't need GLM for many flavors of Poisson regression.

| cite | improve this answer | |
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.