[Rd] a bug in glm.fit() (PR#7947)
Martyn Plummer
plummer at iarc.fr
Thu Jun 16 17:53:46 CEST 2005
On Thu, 2005-06-16 at 07:06 +0100, Prof Brian Ripley wrote:
> What is the bug?
>
> This is the same model: the `intercept' term affects the null model, not
> the actual model. Just look at all the output.
I think the documentation is misleading (On a related issue, it still
refers to the defunct glm.fit.null() function). I'll fix it.
Luke, you be using glm() instead of glm.fit().
> On Thu, 16 Jun 2005 jyzz88 at gmail.com wrote:
>
> > glm.fit() gave me the same AIC's regardless of TRUE or FALSE intercept option.
> >
> >> myX <- as.matrix(1:10)
> >> myY <- 3+5*myX
> >> foo <- glm.fit(x=myX, y=myY, family = gaussian(link = "identity"), intercept=TRUE)
> >> foo$aic
> > [1] 38.94657
> >> foo <- glm.fit(x=myX, y=myY, family = gaussian(link = "identity"), intercept=FALSE)
> >> foo$aic
> > [1] 38.94657
> >> AIC(lm(myY~0+myX, data=data.frame(myY,myX)))
> > [1] 38.94657
> >> AIC(lm(myY~1+myX, data=data.frame(myY,myX)))
> > [1] -650.9808
>
-----------------------------------------------------------------------
This message and its attachments are strictly confidential. If you are
not the intended recipient of this message, please immediately notify
the sender and delete it. Since its integrity cannot be guaranteed,
its content cannot involve the sender's responsibility. Any misuse,
any disclosure or publication of its content, either whole or partial,
is prohibited, exception made of formally approved use
More information about the R-devel
mailing list