vis.boxcox(lambda = sample(c(-1,-0.5,0,1/3,1/2,1,2), 1),
hscale=1.5, vscale=1.5, wait=FALSE)
vis.boxcoxu(lambda = sample( c(-1,-0.5,0,1/3,1/2,1,2), 1),
y, xlab=deparse(substitute(y)),
hscale=1.5, vscale=1.5, wait=FALSE)
vis.boxcox.old(lambda = sample(c(-1, -0.5, 0, 1/3, 1/2, 1, 2), 1))
vis.boxcoxu.old(lambda = sample(c(-1, -0.5, 0, 1/3, 1/2, 1, 2), 1))
tkrplot
.tkrplot
.wait
is FALSE
then they will return an invisible NULL, if wait
is TRUE then
the return value will be a list with the final value of lamda
,
the original data, and the transformed y (at the final lamda
value).lambda
is 1 and the 2 sets of
plots will be identical.
You then adjust the transformation parameter lambda
to see how
the right panels change.
The function vis.boxcox
shows the effect of transforming the
y-variable in a simple linear regression.
The function vis.boxcoxu
shows a single variable compared to
the normal distribution.bct
, boxcox
in package MASSif(interactive()) {
vis.boxcoxu()
vis.boxcox()
}
Run the code above in your browser using DataLab