This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Box-Cox transformation coefficient (lambda) in SPSS or R

Hello all, I want to transform one variable, which is skewed, to a normal distribution. An appropriate transformation method should be decided based on Box-Cox transformation coefficient (lambda) value. However, I couldn't calculate in SPSS or R.

Anyone who have experience?

Thanks in advance.

box-cox lambda spss r

First of all, thank you very much. I have seen both links you mentioned.

I have non-normally distributed continuous outcome variable. Therefore, I need to transform to a normal distribution using an appropriate method that is selected based on Box-Cox transformation coefficient (λ) value. The decision should be made as follows: λ = 1.00: no transformation needed; produces results identical to original data λ = 0.50: square root transformation λ = 0.33: cube root transformation λ = 0.25: fourth root transformation λ = 0.00: natural log transformation λ = -0.50: reciprocal square root transformation λ = -1.00: reciprocal (inverse) transformation and so forth.

Now, I have got difficulty to calculate λ using SPSS or R.

1 answer

One of my friends advised me to use forecast package in R.

install.packages("forecast")

library(forecast)

lambda2<- BoxCox.lambda(dataname$variablename, method = "loglik", lower = -20, upper = 20)

Then, if lambda (λ);

λ = 1.00: no transformation needed; produces results identical to original data
λ = 0.50: square root transformation
λ = 0.33: cube root transformation
λ = 0.25: fourth root transformation
λ = 0.00: natural log transformation
λ = -0.50: reciprocal square root transformation
λ = -1.00: reciprocal (inverse) transformation and so forth.

If the lambda (λ) estimate is none of the above value, use another transformation method. At least in my experience, I can recommend the two-step transformation method in SPSS. 

Reference: 

1. Osborne JW. Improving your data transformations: Applying the Box-Cox transformation. Practical Assessment, Research & Evaluation. 2010 Oct;15(12):1-9.

2. Templeton GF. A two-step approach for transforming continuous variables to normal: implications and recommendations for IS research. Communications of the Association for Information Systems. 2011 Jan 1;28(4):41-58.

Box-Cox transformation coefficient (lambda) in SPSS or R - ResearchGate. Available from: https://www.researchgate.net/post/Box-Cox_transformation_coefficient_lambda_in_SPSS_or_R [accessed Mar 27, 2017].

Log in to answer this question.