Box-Cox transformation

Does the response in the savings data need transformation? You'll need this Splus function Pf Julian Faraway wrote. Copy this function in to Splus:
    "boxcox"<-
    function(g, i=seq(-2,2,by=0.1))
    {
      y <- g$fit + g$res
      x <- model.matrix(g)
      qrf <- lsfit(x, y, int=F)$qr
      sly <- sum(log(y))
            n <- length(y)
            ll <- rep(0, length(i))
            for(j in 1:length(i)) {
                    l <- i[j]
                    if(l == 0)
                            ty <- log(y)
                    else ty <- (y^l - 1)/l
                    cat(dim(qrf$qr$qr))
                    res <- qr.resid(qrf, ty)
                    ll[j] <- ( - n * log(sum(res^2)/n))/2 + (l - 1) * sly
            }
            list(lambda = i, loglik = ll)
    }
Try it out on the savings dataset:
    > g <- lm(sav ~ p15 + p75 + inc + gro)
    > a <- boxcox(g)
    > motif()
    > plot(a$lambda,a$loglik,type="l")
    > abline(h=max(a$loglik - 0.5*qchisq(0.95,1)))
Need to focus in on the area of the maximum:
    > a <- boxcox(g,seq(0.5,1.5,by=0.1))
    > plot(a$lambda,a$loglik,type="l")
    > abline(h=max(a$loglik - 0.5*qchisq(0.95,1)))
The confidence interval for lambda runs from 0.55 to about 1.35. What do we conclude?