[R] glm() with non-integer responses

Prof Brian D Ripley ripley at stats.ox.ac.uk
Wed Aug 1 08:57:43 CEST 2001


On Wed, 1 Aug 2001, Adrian Baddeley wrote:

> A question about the inner workings of glm() and dpois():
> Suppose I call
>
> 	glm(y ~ x, family=poisson, weights = w)
>
> where y contains NON-INTEGER (but still nonnegative) values.
>
> 	(a) Does glm() still correctly maximise
> 	the weighted Poisson loglikelihood ?
>
> (i.e. the function given by the same formal expression as the
> weighted loglikelihood of independent Poisson variables Y_i
> except that the y_i are now nonnegative real numbers)

Well, as that is not a loglikelihood, it's hard to be precise, but yes
it will locally maximize the appropriate weighted log quasi-likelihood.
(It's not clear to me that the log-concavity etc carry over.)

> 	(b) is this likely to change in future versions of R?

No.  Quite a few other things depend on this being really a Poisson
with variance = mean, and that's why these things were tightened up.

> In R version 1.3.0, glm() gives a warning that the responses are not integers.
> This seems to originate from dpois() which is used to evaluate the deviance
> of the fitted model. In R versions prior to 1.3 it seemed to work
> without complaint. So ..

It uses dpois() to evaluate the AIC, not the deviance.
The change was much earlier (1.2.1 I think, looking at NEWS).

> 	(c) what is the recommended way to suppress the warning from
> 	dpois() that the responses are not integers ?

Use a quasi- model.  That's a general conclusion if you want IWLS but not
the exact distributional assumptions of the standard families.  It this
particular case you could use quasipoisson() also, I think.

> Ideally I would like dpois() to accept noninteger responses and
> evaluate using the gamma function..

Then it would not be a probability mass function.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list