Learn R Programming

AID (version 1.5)

boxcoxnc: 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. (2015). Estimating Box-Cox Power Transformation Parameter via Goodness of Fit Tests. Accepted to be published in Communications in Statistics - Simulation and Computation. 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="BY")

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 tra
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. Default is set to "BY". 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.

References

Asar, O., Ilk, O., Dag, O. (2015). Estimating Box-Cox Power Transformation Parameter via Goodness of Fit Tests. Accepted to be published in Communications in Statistics - Simulation and Computation. 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

Run this code
data(textile)
boxcoxnc(textile[,1])
boxcoxnc(textile[,1])$result[1,1]

Run the code above in your browser using DataLab