From finnknudsen at post.tele.dk  Thu Nov 20 16:31:36 2003
From: finnknudsen at post.tele.dk (finnknudsen@post.tele.dk)
Date: Thu Nov 20 16:30:17 2003
Subject: [Rd] glm inconsistent behaviour (PR#5213)
Message-ID: <20031120153136.27CBEF0AE@slim.kubism.ku.dk>

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)


[Rd] glm inconsistent behaviour (PR#5213)
finnknudsen@post.tele.dk