3.5.2.18 jtrans
Description
This function takes a vector and transforms it into approximately normal distributed one by using Johnson transformation method.
The three Johnson families of distribution include SB, SL and SU, which are the Johnson families distributions with the variable bounded (SB), lognormal (SL) and unbounded (SU) respectively. And the formulas for the transformation of these three families are:
\[ Y'=\left\{ \begin{array}{ll} SB = \gamma + \eta \ln\frac{Y-\epsilon}{\lambda+\epsilon-Y} &\eta, \lambda > 0, -\infty < \gamma < \infty, -\infty < \epsilon < \infty, \epsilon < Y < \epsilon + \lambda\cr SL = \gamma + \eta \ln(Y-\epsilon) & \eta > 0, -\infty < \gamma < \infty, -\infty < \epsilon < \infty, \epsilon < Y\cr SU = \gamma + \eta \sinh^{-1}\frac{Y-\epsilon}{\lambda} &\eta, \lambda > 0, -\infty < \gamma < \infty, -\infty < \epsilon < \infty, -\infty < Y < \infty, \sinh^{-1}(x) = \ln(x+\sqrt{1+x^2}) \end{array} \right. \]
The function will transform the input dataset by selecting the best transformation function from the three Johnson families.
See detaied algorithm on this page.
Syntax
vector jtrans(vector vd)
Parameter
vd
- The input vector (column) to be transformed. vd can include positive, negative and zero numbers.
Return
Transformed vector (column) tby the best transformation function from the three Johnson families mentioned in the Description.
Example
EX1
newbook; col(A) = data(0.1, 1.1, 0.002); col(B) = jtrans(col(A));