boxcox.r: boxcox.r Fit Box-Cox regressions

Description Usage Arguments Details Value References Examples

Description

boxcox.r finds the maximum likelihood estimates of the parameters of the Box–Cox transform and the coefficients on the independent variables.It can fit theta models, lambda models, and models where all but some group of independent variables are not transformed.

Usage

1
2
boxcox.r(formula, data, subset, na.action, x = FALSE, y = FALSE,
noTrans = NULL, optimize.bounds = c(-2, 2), model = "theta", test.params = NULL, ...)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. The details of model specification are given under ‘Details’.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which boxcox.r is called.

subset

an optional vector specifying a subset of observations to be used in the fitting process.

na.action

a function which indicates what should happen when the data contain NAs. The default is set by the na.action setting of options, and is na.fail if that is unset. The ‘factory-fresh’ default is na.omit. Another possible value is NULL, no action. Value na.exclude can be useful.

noTrans

a set of independet variables which are not going to be transformed.

optimize.bounds

bounds for lambda and theta optimization

model

one of the following models: theta, lambda, lhs, rhs

test.params

a pair of c(theta, lambda) parameters. If test.params are passed, no optimization is performed.

...

additional arguments to be passed to the low level regression fitting functions (see below).

Details

The following models could be fitted:

Theta: Different parameters for box-cox transformation are used for independent and dependent variables.

Lambda: the same parameter is used for box-cox transformation of independent and dependent variables.

lhs: only left side of 'formula' is transformed.

rhs: only right side of 'formula' is transformed.

Value

coefficients

a named vector of coefficients

References

Box, G. E. P., and D. R. Cox. 1964. An analysis of transformations. Journal of the Royal Statistical Society, Series B 26: 211 - 252.

Examples

1
2
fit1 = boxcox.r(Volume ~ Height + Girth, data = trees)
summary(fit1)

Paulms/RegUtils documentation built on May 8, 2019, 1:27 a.m.