Last data update: 2014.03.03

R: A Function to Estimate Box-Cox Power Transformation Parameter...
boxcoxncR Documentation

A Function to Estimate Box-Cox Power Transformation Parameter via Normality Tests and Artifical Covariate Method

Description

boxcoxnc utilizes seven different normality tests and artifical covariate method to estimate Box-Cox power transformation parameter and provides graphical analysis

Asar, O., Ilk, O., Dag, O. (2014). Estimating Box-Cox Power Transformation Parameter via Goodness of Fit Tests. Communications in Statistics - Simulation and Computation, DOI:10.1080/ 03610918.2014.957839.

Dag, O., Asar, O., Ilk, O. (2014). A Methodology to Implement Box-Cox Transformation When No Covariate is Available. Communications in Statistics - Simulation and Computation, 43:7, 1740–1759.

Usage

boxcoxnc(data, method = "all", lam = seq(-2,2,0.01), plotit = TRUE, rep = 30, 
p.method = "none")

Arguments

data

is a vector, matrix for univariate dataset.

method

expects a character string to select the desired method to be used to estimate Box-Cox transformation parameter. To use Shapiro-Wilk test method should be set to "sw". For method = "ad", boxcoxnc function uses Anderson-Darling test to estimste Box-Cox transformation parameter. Similarly, method should be set to "cvm", "pt", "sf", "lt", "jb", "ac" to use Cramer-von Mises, Pearson Chi-square, Shapiro-Francia, Lilliefors, Jarque-Bera tests and artificial covariate method, respectively. To use all the methods at the same time, default is set to method = "all".

lam

is a vector which includes the sequence of candidate lambda values. Default is set to (-2,2) with increment 0.01.

plotit

plots normality test statistic vs lambda for methods utilizing normality tests. It also plots log-likelihood vs lambda for artificial covariate method. Defaults plotit = TRUE.

rep

is an integer which denotes the replication number for artificial covariate method. Default is set to 30.

p.method

expects a character string which defines the method to adjust the p-values of normality tests. Default is set to "none". p.method is same with the "method" in p.adjust documentation. See the documentation of p.adjust for other possible choices of methods and details.

Value

Returns a matrix of output with the results of seven different normality tests and artifical covariate method. The first row of the matrix corresponds to the related estimates of lambda. The subsequent rows correspond to the p-values of different normality tests for each estimates of lambda.

Author(s)

Osman Dag, Ozgur Asar, Ozlem Ilk

References

Asar, O., Ilk, O., Dag, O. (2014). Estimating Box-Cox Power Transformation Parameter via Goodness of Fit Tests. Communications in Statistics - Simulation and Computation, DOI:10.1080/ 03610918.2014.957839.

Box, G. E. P., Cox, D. R. (1964). An Analysis of Transformations (with discussion). Journal of the Royal Statistical Society, Series B (Methodological), 26, 211–252.

Dag, O., Asar, O., Ilk, O. (2014). A Methodology to Implement Box-Cox Transformation When No Covariate is Available. Communications in Statistics - Simulation and Computation, 43:7, 1740–1759.

Gross, J. (2012). nortest: Tests for Normality. R package version 1.0.

Thode, H. C. (2002). Testing for Normality. New York: Marcel Dekker.

Trapletti, A., Hornik, K. (2012). tseries: Time Series Analysis and Computational Finance. R package version. 0.10-28.

Venables, W. N., Ripley, B. D. (2002). Modern Applied Statistics with S 4th ed.. New York: Springer.

Examples

data(textile)
boxcoxnc(textile[,1])
boxcoxnc(textile[,1])$result[1,1]

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(AID)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/AID/boxcoxnc.Rd_%03d_medium.png", width=480, height=480)
> ### Name: boxcoxnc
> ### Title: A Function to Estimate Box-Cox Power Transformation Parameter
> ###   via Normality Tests and Artifical Covariate Method
> ### Aliases: boxcoxnc
> ### Keywords: functions
> 
> ### ** Examples
> 
> data(textile)
> boxcoxnc(textile[,1])
$title
[1] "Implementation of Box-Cox Power Transformation when No Covariate Is Available"

$method
[1] "All"

$date
[1] "Mon Jul  4 14:12:03 2016"

$result
                   sw         ad        cvm        pt         sf         lt
lambda.hat -0.0600000 -0.0800000 -0.1000000 0.0200000 -0.0600000 -0.0600000
sw.pvalue   0.9821308  0.9813378  0.9787300 0.9654437  0.9821308  0.9821308
sf.pvalue   0.9953051  0.9947247  0.9931056 0.9867536  0.9953051  0.9953051
jb.pvalue   0.8261366  0.8251727  0.8203498 0.7934014  0.8261366  0.8261366
                   jb          ac
lambda.hat -0.0600000 -0.04766667
sw.pvalue   0.9821308  0.98178978
sf.pvalue   0.9953051  0.99524972
jb.pvalue   0.8261366  0.82484681

> boxcoxnc(textile[,1])$result[1,1]
[1] -0.06
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>