Boxplots for transformations to symmetry
symbox.Rdsymbox first transforms x to each of a series
of selected powers, with each transformation standardized to mean 0 and
standard deviation 1. The results are then displayed side-by-side in boxplots, permiting
a visual assessment of which power makes the distribution reasonably symmetric.
For the "lm" method, the response variable in the model is successively
transformed.
Usage
symbox(x, ...)
# S3 method for class 'formula'
symbox(formula, data=NULL, subset, na.action=NULL, ylab, ...)
# Default S3 method
symbox(x, powers = c(-1, -0.5, 0, 0.5, 1), start,
trans=bcPower, xlab="Powers", ylab, ...)
# S3 method for class 'lm'
symbox(x, powers = c(-1, -0.5, 0, 0.5, 1), start, trans=bcPower,
xlab, ylab="Studentized residuals", ...)Arguments
- x
a numeric vector.
- formula
a one-sided formula specifying a single numeric variable.
- data, subset, na.action
as for statistical modeling functions (see, e.g.,
lm).- xlab, ylab
axis labels; if
ylabis missing, a label will be supplied. For the"lm"method, ifxlabis missing, a label will also be supplied.- powers
a vector of selected powers to which
xis to be raised. For meaningful comparison of powers,1should be included in the vector of powers.- start
a constant to be added to
x. Ifstartis missing andtransisbcPower(the default) orbcnPower, then a start will be automatically generated if there are zero or negative values inx, and a warning will be printed; the auto-generatedstartis the absolute value of the minimumxplus 1 percent of the range ofx.- trans
a transformation function whose first argument is a numeric vector and whose second argument is a transformation parameter, given by the
powersargument; the default isbcPower, and another possibility isyjPower.bcnPowermay also be used, in which case thegammaparameter is set to the value ofstart.- ...
arguments to be passed down.
Author
Gregor Gorjanc, John Fox jfox@mcmaster.ca.

