I ran a function called BoxCox, taken from the book by Venables and Ripley, for checking the need for power transformation. This function works fine using the version 0.50 of R, but gives an error message with version 0.60. The lm function in version 0.60 is different from that in version 0.50. Is there a bug in the new lm function? Kung-Sik Chan> BoxCox(lm(log.O2UP~BOD+TKN+TS+TVS+COD,data=alr222a))Error in terms.default(formula, data = data) : unused argument to function> traceback()[1] "terms.default(formula, data = data)" [2] "lm(model, ...)" [3] "BoxCox(lm(log.O2UP ~ BOD + TKN + TS + TVS + COD, data = alr222a))"> BoxCox(lm(log.O2UP~BOD+TKN+TS+TVS+COD,data=alr222a))Error in terms.default(formula, data = data) : unused argument to function> lm(log.O2UP~BOD+TKN+TS+TVS+COD,data=alr222a) > BoxCox(lm(log.O2UP~BOD+TKN+TS+TVS+COD,data=alr222a))Error in terms.default(formula, data = data) : unused argument to function> lm(log.O2UP~BOD+TKN+TS+TVS+COD,data=alr222a)Call: lm(formula = log.O2UP ~ BOD + TKN + TS + TVS + COD, data = alr222a) Coefficients: (Intercept) BOD TKN TS TVS -1.776735e+00 3.245189e-05 1.020862e-03 1.560704e-04 6.631681e-03 COD 5.859737e-05 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 19 Dec 1997, Kung-Sik Chan wrote:> > I ran a function called BoxCox, taken from the book by Venables and > Ripley, for checking the need for power transformation. This function > works fine using the version 0.50 of R, but gives an error message > with version 0.60. > > The lm function in version 0.60 is different from that in version 0.50. > > Is there a bug in the new lm function?> > > BoxCox(lm(log.O2UP~BOD+TKN+TS+TVS+COD,data=alr222a)) > Error in terms.default(formula, data = data) : unused argument to functionNo, there is a bug in terms.default(). The generic terms() function accepts a number of arguments controlling how terms objects are constructed. As terms.default() just extracts a terms object that is already present it doesn't use these arguments. However, it hasn't been written to ignore them. A fix is to redefine terms.default() to ignore these arguments terms.default<-function (x,...) x$terms In the future it may be desirable to change terms.default so that it recomputes the terms object if the other arguments are present, in case they are different from the original versions. Thomas Lumley ------------------------------------------------------+------ Biostatistics : "Never attribute to malice what : Uni of Washington : can be adequately explained by : Box 357232 : incompetence" - Hanlon's Razor : Seattle WA 98195-7232 : : ------------------------------------------------------------ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._