assumptions: First check of assumptions to find suitable transformations

Description Usage Arguments Value See Also Examples

View source: R/assumptions.R

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

1
assumptions(object, method = "ml", std = FALSE, ...)

Arguments

object

an object of type lm.

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 TRUE, the transformed model is returned based on the standardized/scaled transformation. Defaults to FALSE.

...

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 manly_lr = manly_lr = c(0.000005,0.00005). For the default values that are used for the lambdaranges see the documentation for the provided transformations.

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

1
2
3
4
5
6
7
8
# 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))

trafo documentation built on May 2, 2019, 2:13 p.m.

Related to assumptions in trafo...