From plummer at iarc.fr  Thu Jun 16 17:53:46 2005
From: plummer at iarc.fr (Martyn Plummer)
Date: Thu, 16 Jun 2005 17:53:46 +0200
Subject: [Rd] a bug in glm.fit() (PR#7947)
In-Reply-To: <Pine.LNX.4.61.0506160703510.21725@gannet.stats>
References: <20050616034227.77C02A1F9@slim.kubism.ku.dk>
	<Pine.LNX.4.61.0506160703510.21725@gannet.stats>
Message-ID: <1118937226.3651.95.camel@seurat>

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



[Rd] a bug in glm.fit() (PR#7947)
Martyn Plummer