compareToGLM: Compare renewals fit to glm models fit

View source: R/renewal_tools.R

compareToGLMR Documentation

Compare renewals fit to glm models fit

Description

Compare renewals fit to glm models fit on the same data.

Usage

compareToGLM(poisson_model, breaks, nbinom_model, ...)

Arguments

poisson_model

fitted Poisson glm model

breaks

integer values at which the breaks should happen. The function will compute the observed frequencies in the intervals [breaks[i], breaks[i + 1]).

nbinom_model

fitted negative binomial (fitted using MASS::glm.nb()). This argument is optional.

...

renewal models to be considered.

Details

This function computes a data.frame similar to Table 5.6 in Cameron(2013), using the observed frequencies and predictions from different models. Supported models accepted are Poisson and negative binomial (fitted using MASS::glm.nb()) from the glm family and any model from the renewal family (passed in ...).

Value

data.frame with columns Counts, Actual (observed probability) and then 2 columns per model passed (predicted probability and pearson statistic) for the associated count value.

References

\insertRef

cameron2013regressionCountr


Countr documentation built on Nov. 13, 2022, 1:06 a.m.