AutoTransQF {AutoTransQF}R Documentation

Transforms Datasets into Normality

Description

This function helps to transform each vector of the matrix into normality based on the optimal test statistic of transformed vectors.

Usage

## The function tries to transform each vector of mdata into normality
AutoTransQF(mdata, paramstruct = list(istat, iscreenwrite, FeatureNames))

Arguments

mdata

the matrix needs to be transformed.

paramstruct

A list with three entries istat, iscreenwrite and FeatureNames respectively. Missing entries will be set to default.

istat

a value representing the type of test statistic for evaluation of normality of the transformed vector with default to be istat = 1. If istat = 1, Anderson-Darling test statistic is chosen; if istat = 2, standard skewness statistic is chosen.

iscreenwrite

Whether there is screenwrite with default to be iscreenwrite = 0. If iscreenwrite = 1, to write progress to screen; if iscreenwrite = 0, no screenwrite.

FeatureNames

Contains feature names of each vector with default to be 'Feature1'

Value

Returns a list with three elements:

data

the transformed matrix

beta

a list of all shift parameters beta

alpha

a list of all shift parameters alpha

Note

When a vector of the original matrix is not transformed, its corresponding alpha and beta are both -1.

Author(s)

Yue Hu, Hyeon Lee, J. S. Marron

References

Feng, Q. , Hannig J. , Marron, J. S. (2016). A Note on Automatic Data Transformation. STAT, 5, 82-87. doi: 10.1002/sta4.104

See Also

ADStatQF, autotransfuncQF

Examples

## Create a random matrix x.
x = matrix(rgamma(40, shape = 1, scale = 2), nrow = 4)

## Transform matrix x in default setting and 
## output transformed data
AutoTransQF(x)$data

## Transform matrix x in default setting and 
## output a list of shift parameter beta
AutoTransQF(x)$beta

## Transform matrix x with feature names and
## output a list of shift parameter alpha
Names = c('Feature1', 'Feature2', 'Feature3', 'Feature4')
AutoTransQF(x, paramstruct = list(FeatureNames = Names))$alpha

## Transform matrix x with feature names, progress to screen,
## and apply standard skewness statistic to transformed vectors
AutoTransQF(x, paramstruct = list(istat = 2, iscreenwrite = 1, FeatureNames = Names))

## Transform matrix x with progress to screen and 
## apply standard skewness statistic to transformed vectors
AutoTransQF(x, paramstruct = list(istat = 2, iscreenwrite = 1))

[Package AutoTransQF version 0.1.3 Index]