Re: [Rd] a bug in glm.fit() (PR#7947)

From: Martyn Plummer <plummer_at_iarc.fr>
Date: Thu 16 Jun 2005 - 15:53:46 GMT

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@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

R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Jun 17 02:27:19 2005

This archive was generated by hypermail 2.1.8 : Mon 24 Oct 2005 - 22:27:20 GMT