# boxcoxROC: Box-Cox transformation on three-class ROC data In trinROC: Statistical Tests for Assessing Trinormal ROC Data

## Description

A transformation function for three-class ROC data in order to obtain normally distributed classes.

## Usage

 ```1 2 3 4 5 6 7 8 9``` ```boxcoxROC( x, y, z, lambda = seq(-2, 2, 0.05), lambda2 = NULL, eps = 0.02, verbose = TRUE ) ```

## Arguments

 `x, y, z` vectors containing the data of the three classes "healthy", "intermediate" and "diseased" to be transformed. In two-class ROC analysis only. `lambda` vector of possible lambdas the log-likelihood function is evaluated. `lambda2` numeric shifting parameter. For the implemented Box-Cox transformation positive measurements in `x, y, z` are required. `lambda2` is used to shift these measurements. `eps` numeric; indicating the bandwith around zero, where `lambda` is treated to be zero and the data is log-transformed. `verbose` logical; indicating whether output should be displayed (default) or not.

## Details

A Box-Cox transformation computing

X^{(λ)} = log(X) if λ = 0 and X^{(λ)} = (X^λ -1)/λ otherwise

with optimal λ estimated from the likelihood kernel function, as formally described in the supplementary material in Bantis et al. (2017). If the data include any nonpositive observations, a shifting parameter `lambda2` can be included in the transformation given by:

X^{(λ)} = log(X+λ_2), if λ = 0 and X^{(λ)} = ((X+λ_2)^λ -1)/λ otherwise.

## Value

A list with components:

 `xbc, ybc, zbc` The transformed vectors. `lambda` estimated optimal parameter. `shapiro.p.value` p-values obtained from `shapiro.test()` of the original and transformed data.

## References

Bantis LE, Nakas CT, Reiser B, Myall D and Dalrymple-Alford JC (2015) Construction of joint confidence regions for the optimal true class fractions of receiver operating characteristic (roc) surfaces and manifolds. Statistical Methods in Medical Research 26(3): 1429–1442.

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

`shapiro.test` and `boxcox` from the package `MASS`.
 ```1 2 3 4 5 6``` ```data(cancer) x1 <- with(cancer, cancer[trueClass=="healthy", 9]) y1 <- with(cancer, cancer[trueClass=="intermediate", 9]) z1 <- with(cancer, cancer[trueClass=="diseased", 9]) boxcoxROC(x1, y1, z1) ```