| assumptions {trafo} | R Documentation |
First check of assumptions to find suitable transformations
Description
Gives a first overview if a transformation is useful and which transformation is promising to fulfill the model assumptions normality, homoscedasticity and linearity.
Usage
assumptions(object, method = "ml", std = FALSE, ...)
Arguments
object |
an object of type |
method |
a character string. Different estimation methods can be used for the estimation of the optimal transformation parameter: (i) Maximum likelihood approach ("ml"), (ii) Skewness minimization ("skew"), (iii) Kurtosis optimization ("kurt"), (iv) Divergence minimization by Kolmogorov-Smirnov ("div.ks"), by Cramer-von-Mises ("div.cvm") or by Kullback-Leibler ("div.kl"). Defaults to "ml". |
std |
logical. If |
... |
other parameters that can be passed to the function, e.g. other
lambdaranges. Self-defined lambdaranges are given to the function as an
argument that is the combination of the name of the transformation and lr and
the range needs to be a numeric vector of length 2. For instance, changing the
lambdarange for the Manly transformation would mean to add an argument
|
Value
A table with tests for normality and homoscedasticity. Furthermore, scatterplots are returned to check the linearity assumption.
See Also
bickeldoksum, boxcox, dual,
glog, gpower, log,
logshiftopt, manly, modulus,
neglog, sqrtshift, yeojohnson
Examples
# Load data
data("cars", package = "datasets")
# Fit linear model
lm_cars <- lm(dist ~ speed, data = cars)
assumptions(lm_cars)
assumptions(lm_cars, method = "skew", manly_lr = c(0.000005,0.00005))