Skip to content

glm inconsistent behaviour (PR#5213)

2 messages · finnknudsen@post.tele.dk, Brian Ripley

#
Full_Name: Finn Knudsen
Version: 1.8.0
OS: windows 2000
Submission from: (NULL) (194.192.22.33)


The problem seems to happen when running the GLM. When both multiplicative
effects and an offset is present. I experienced this problem on my own dataset
when using af Poisson familiy with log link function but the behaviour can be
reproduced with the following code.

I do not know if it is a bug, but there are inconsistencies in the behaviour in
the GLM package when both an offset and multiplicative effects are present. In
this situation offset should be specified directly and not in the model. See
example below.

library(MASS)

data(anorexia)
 
## End Don't run

# These two will give exactly the same result in the summary
anorex.1 <- glm(Postwt ~ Prewt + Treat + offset(Prewt),
                 family = gaussian, data = anorexia)

anorex.1a <- glm(Postwt ~ Prewt + Treat , offset = Prewt,
                 family = gaussian, data = anorexia)

summary(anorex.1)
summary(anorex.1a)

# However the following two will not give the same results. 
# It would seem that the multiplicative effect is lost.

anorex.2 <- glm(Postwt ~ Prewt * Treat + offset(Prewt),
                 family = gaussian, data = anorexia)

anorex.2a <- glm(Postwt ~ Prewt * Treat , offset = Prewt,
                 family = gaussian, data = anorexia)


summary(anorex.2)
summary(anorex.2a)
#
Please try R-patched aka 1.8.1 beta, as I think this has already been
fixed (PR#4941). Certainly I can see no difference there.
On Thu, 20 Nov 2003 finnknudsen@post.tele.dk wrote:

            
Not needed, BTW