Last active
July 12, 2017 11:03
-
-
Save christophergandrud/fc5215fa730263e3a1ee to your computer and use it in GitHub Desktop.
Inverse hyperbolic sine transformation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Inverse hyperbolic sine transformation | |
#' | |
#' @param x a numeric vector | |
#' | |
#' @details A useful transformation for skewed data that includes 0's and | |
#' negative values | |
ihs <- function(x) { | |
transformed <- log(x + sqrt(x ^ x + 1)) | |
return(transformed) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Correct me if I am wrong but the inverse hyperbolic sine function is x^2 not x^x
Therefore in my mind the code should be like this:
ihs <- function(x) { transformed <- log(x + sqrt(x^2+1)); return(transformed) }