[R] Error using glm with poisson family and identity link
Federico Gherardini
f.gherardini at pigrecodata.net
Thu Nov 25 14:00:49 CET 2004
Hi all
I'm trying to use the function glm from the MASS package to do the
following fit.
fit <- glm(FP ~ rand, data = tab, family = poisson(link = "identity"),
subset = rand >= 1)
(FP is >= 0)
but I get the following error
Error: no valid set of coefficients has been found:please supply
starting values
In addition: Warning message:
NaNs produced in: log(x)
in contrast if I fit a model without intercept
fit <- glm(FP ~ rand - 1, data = tab, family = poisson(link =
"identity"), subset = rand >= 1)
everything goes fine.
Now my guess is that the points "naturally" have a negative intercept so
the error is produced because I'm using the poisson distribution for the
y and negative values are of course not admitted. Am I right?
Also if this is the cause, shouldn't the function always try to do the
best fit given the parameters? I mean shouldn't it fit a model with
intercept 0 anyway and report it as a bad fit?
Thanks
Federico
More information about the R-help
mailing list