Title: | A Novel Automatic Shifted Log Transformation |
---|---|
Description: | A novel parametrization of log transformation and a shift parameter to automate the transformation process are proposed in R package 'AutoTransQF' based on Feng et al. (2016). Please read Feng et al. (2016) <doi:10.1002/sta4.104> for more details of the method. |
Authors: | Yue Hu [aut, cre], Hyeon Lee [aut], J. S. Marron [aut] |
Maintainer: | Yue Hu <[email protected]> |
License: | GPL-3 |
Version: | 0.1.3 |
Built: | 2024-11-24 06:32:23 UTC |
Source: | CRAN |
The R package AutoTransQF based on Feng et al.(2016) introduces a novel parametrization of log transformation and a shift parameter to automate the transformation process. Please read Feng et al. (2016) <doi: 10.1002/sta4.104> for more details of the method.
Yue Hu [aut, cre], Hyeon Lee [aut], J. S. Marron [aut]
The function is used to calculate the Anderson-Darling test statistic of standard normal distribution. The input needs to be vectors with seven or more entries.
## Calculate Anderson-Darling test statistic for vector x: ADStatQF(x)
## Calculate Anderson-Darling test statistic for vector x: ADStatQF(x)
x |
a vector with seven or more entries. |
Returns the Anderson-Darling test statistic for the given vector.
Yue Hu, Hyeon Lee, J. S. Marron
Feng, Q. , Hannig J. , Marron, J. S. (2016). A Note on Automatic Data Transformation. STAT, 5, 82-87. doi: 10.1002/sta4.104
## Generate a vector z from normal distribution with mean 0 and standard deviation 6. z = rnorm(10, mean = 0, sd = 6) ## Calculate the Anderson-Darling test statistic for z ADStatQF(z)
## Generate a vector z from normal distribution with mean 0 and standard deviation 6. z = rnorm(10, mean = 0, sd = 6) ## Calculate the Anderson-Darling test statistic for z ADStatQF(z)
This function transforms individual vectors into normality. Paper from Feng et al. (2016) includes more details about the transformation mechanism.
autotransfuncQF(vari, istat, paraindex)
autotransfuncQF(vari, istat, paraindex)
vari |
a vector needs to be transformed |
istat |
a value representing the type of test statistic for evaluation of normality of the transformed vector. If |
paraindex |
a value delivered to calculate the specific shift parameter beta |
Returns a transformed vector with the shift parameter calculated by the input paraindex
Yue Hu, Hyeon Lee, J. S. Marron
Feng, Q. , Hannig J. , Marron, J. S. (2016). A Note on Automatic Data Transformation. STAT, 5, 82-87. doi: 10.1002/sta4.104
## Generate a vector vec from Gamma distribution with parameters shape 1 and scale 2. vec = rgamma(50, shape = 1, scale = 2) ## Choose Anderson-Darling test statistic for transformed vector. ## Assign paraindex to be 0.9. autotransfuncQF(vec, istat = 1, paraindex = 0.9) ## Choose skewness for transformed vector ## Assign paraindex to be 0.9 autotransfuncQF(vec, istat = 2, paraindex = 0.9)
## Generate a vector vec from Gamma distribution with parameters shape 1 and scale 2. vec = rgamma(50, shape = 1, scale = 2) ## Choose Anderson-Darling test statistic for transformed vector. ## Assign paraindex to be 0.9. autotransfuncQF(vec, istat = 1, paraindex = 0.9) ## Choose skewness for transformed vector ## Assign paraindex to be 0.9 autotransfuncQF(vec, istat = 2, paraindex = 0.9)
This function helps to transform each vector of the matrix into normality based on the optimal test statistic of transformed vectors.
## The function tries to transform each vector of mdata into normality AutoTransQF(mdata, paramstruct = list(istat, iscreenwrite, FeatureNames))
## The function tries to transform each vector of mdata into normality AutoTransQF(mdata, paramstruct = list(istat, iscreenwrite, FeatureNames))
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 |
iscreenwrite |
Whether there is screenwrite with default to be |
FeatureNames |
Contains feature names of each vector with default to be 'Feature1' |
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 |
When a vector of the original matrix is not transformed, its corresponding alpha and beta are both -1.
Yue Hu, Hyeon Lee, J. S. Marron
Feng, Q. , Hannig J. , Marron, J. S. (2016). A Note on Automatic Data Transformation. STAT, 5, 82-87. doi: 10.1002/sta4.104
## 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))
## 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))
The dataset from Miedema et al. (2012) is built based on 49 hematoxylin and eosin stained slides of distinctive melanocytic lesions.
Melanoma
Melanoma
A data frame with 10152 observations on 49 variables where columns serve as data objects and rows serve as features. All 49 features are numeric variables including Area
, Hu.1
, Hu.2
etc.
Miedema, Jayson, et al. (2012). Image and statistical analysis of melanocytic histology. Histopathology, 61(3), pp.436-444. doi: 10.1111/j.1365-2559.2012.04229.x