[R] AIC in glm.fit with intercept

Luke jyzz88 at gmail.com
Thu Jun 16 05:18:08 CEST 2005


Dear R users,

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

Is my code wrong or is it a bug in glm.fit?

-Luke




More information about the R-help mailing list