mean
and standard deviation equal to sd
, in the normal scale.rboxcox(n, lambda, lambda2 = NULL, mean = 0, sd = 1)dboxcox(x, lambda, lambda2 = NULL, mean = 0, sd = 1)
NULL
.dboxcox
) or an output of
boxcox.fit
(print
, plot
, lines
). The function rboxcox
samples $Y'$ from the normal distribution using
the function rnorm
and backtransform the values according to the
equations above to obtain values of $Y$.
If necessary the back-transformation truncates the values such that
$Y' \geq \frac{1}{\lambda}$ results in
$Y = 0$ in the original scale.
Increasing the value of the mean and/or reducing the variance might help to avoid truncation.
boxcox.fit
,
the function boxcox
in the package boxcox
in the package ## Simulating data
simul <- rboxcox(100, lambda=0.5, mean=10, sd=2)
##
## Comparing models with different lambdas,
## zero means and unit variances
curve(dboxcox(x, lambda=-1), 0, 8)
for(lambda in seq(-.5, 1.5, by=0.5))
curve(dboxcox(x, lambda), 0, 8, add = TRUE)
Run the code above in your browser using DataLab