# Power transformation

Command: | Tools Power transformation |

## Description

Allows to create a new variable containing a power transformation of a numeric variable. The transformation is defined by a power parameter λ (Lambda):

x(λ) = x^{λ} | when λ ≠ 0 | |

x(λ) = log(x) | when λ = 0 |

Optionally, you can select the Box-Cox transformation. The Box-Cox power transformation is defined as (Armitage et al., 2002; Box & Cox, 1964):

x(λ) = (x^{λ} - 1) / λ | when λ ≠ 0 | |

x(λ) = log(x) | when λ = 0 |

When some of the data are negative, a shift parameter *c* needs to be added to all observations (in the formulae above x is replaced with x+*c*).

## Required input

**Column**: the column in which you want to place the transformed variable.- Options

**List empty columns only**: if this option is selected, only empty columns are listed in the column selection box.**Clear column**: the selected column will be cleared prior to generating and storing the transformed data.

**Header**: the header (top cell) for the selected column.**Data**: select the numeric variable and a possible filter.**Transformation parameters****Lambda**: the power parameter λ**Shift parameter**: the shift parameter is a constant*c*that needs to be added to the data when some of the data are negative.- Button
**Get from data**: click this button to estimate the optimal value for Lambda, and suggest a value for the shift parameter*c*when some of the observations are negative. The program will suggest a value for Lambda with 2 to 3 significant digits. It may be advantageous to manually round this value to values such as -3, -2, -1, -0.5, 0, 0.5, 1, 2 and 3 (see below).

MedCalc finds the optimal value for Lambda by minimizing the following likelihood function using the "golden search" method (Monahan, 2001):

$$ -\frac{\text{n}}{2} \log({\tilde{\sigma}}^2) + (\lambda - 1) \sum_{i=1}^{n}{\log(\tilde{x}_i)} $$ - Option
**Box-Cox transformation**: select this option to use the Box-Cox power transformation as described above.

Click OK to proceed. The selected column in the spreadsheet is filled with the power-transformed data.

## Interpretation of the power transformation

When you do not select Box-Cox transformation and the shift parameter *c* is zero then the power transformation is easy to interpret for certain values of lambda, for example:

λ = 0 | logarithmic transformation | |

λ = 0.5 | square root transformation | |

λ = -1 | inverse transformation | |

λ = 1 | no transformation! |

## Literature

- Armitage P, Berry G, Matthews JNS (2002) Statistical methods in medical research. 4
^{th}ed. Blackwell Science. - Box GEP, Cox DR (1964) An analysis of transformations. Journal of the Royal Statistical Society, Series B 26: 211–252.
- Monahan JF (2001) Numerical methods of statistics. Cambridge University Press.