R/boxCoxTransform.R

Defines functions boxCoxTransform

# TODO: Add comment
# 
# Author: Vahid Nassiri
###############################################################################
# #' @importFrom caret BoxCoxTrans



#' computes Box-Cox tranform of the response
#' @param x 
#' @return vector the transfomed variable
#' @importFrom caret BoxCoxTrans
#' @author Vahid Nassiri
#' @noRd
boxCoxTransform <- function(x){
	lambda <- BoxCoxTrans(x)$lambda  
	if(lambda==0){
		y=log(x)
	}else{
		y=((x^lambda)-1)/lambda
	}
	return(y)
}

Try the clustDRM package in your browser

Any scripts or data that you put into this service are public.

clustDRM documentation built on May 2, 2019, 5:07 a.m.