Computes the Box-Tidwell power transformations of the predictors in a linear model.
boxTidwell(y, ...)# S3 method for formula
boxTidwell(formula, other.x=NULL, data=NULL, subset,
na.action=getOption("na.action"), verbose=FALSE, tol=0.001,
max.iter=25, ...)
# S3 method for default
boxTidwell(y, x1, x2=NULL, max.iter=25, tol=0.001,
verbose=FALSE, ...)
# S3 method for boxTidwell
print(x, digits, ...)
two-sided formula, the right-hand-side of which gives the predictors to be transformed.
one-sided formula giving the predictors that are not candidates for transformation, including (e.g.) factors.
an optional data frame containing the variables in the model.
By default the variables are taken from the environment from which
boxTidwell
is called.
an optional vector specifying a subset of observations to be used.
a function that indicates what should happen when the data contain NA
s.
The default is set by the na.action
setting of options
.
if TRUE
a record of iterations is printed; default is FALSE
.
if the maximum relative change in coefficients is less than tol
then
convergence is declared.
maximum number of iterations.
response variable.
matrix of predictors to transform.
matrix of predictors that are not candidates for transformation.
not for the user.
boxTidwell
object.
number of digits for rounding.
an object of class boxTidwell
, which is normally just printed.
The maximum-likelihood estimates of the transformation parameters are computed by Box and Tidwell's (1962) method, which is usually more efficient than using a general nonlinear least-squares routine for this problem. Score tests for the transformations are also reported.
Box, G. E. P. and Tidwell, P. W. (1962) Transformation of the independent variables. Technometrics 4, 531-550.
Fox, J. (2008) Applied Regression Analysis and Generalized Linear Models, Second Edition. Sage.
Fox, J. and Weisberg, S. (2011) An R Companion to Applied Regression, Second Edition, Sage.
# NOT RUN {
boxTidwell(prestige ~ income + education, ~ type + poly(women, 2), data=Prestige)
# }
Run the code above in your browser using DataLab