Take the 2-minute tour ×
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

In R, I am using the bc function to do a box-cox transformation. What factors do I need to consider when setting p (the power argument)?

share|improve this question
1  
The answer varies according to your reason for considering the transformation: whether it is for exploratory or confirmatory purposes, whether it is a dependent or independent variable in a regression, and so on. Could you perhaps share some of that relevant information with us so we can give you appropriate, focused answers? –  whuber May 30 '12 at 1:15
    
It's for exploratory purposes. I'd like to transform certain measures of an event into a comparable space for clustering (euclidean distance perhaps?). In order to get a roughly normal distribution in order to use scale to get standard scores, I'm transforming these measures –  user1202664 May 30 '12 at 8:32
add comment

2 Answers

up vote 3 down vote accepted

I've found that I can use the following to get a transformation that best approximates a normal distribution:

library(geoR)
bc(x=vecToTransform, p=boxcoxfit(y)$lambda)
share|improve this answer
add comment

If this is on a single variable, a likelihood profile wrt p is typically used, as in Wikipedia example. Note that you need to use the right scale with geometric means of your variable and such for it to make sense.

share|improve this answer
    
Thanks. What do you mean by "Note that you need to use the right scale with geometric means of your variable and such for it to make sense." How can I implement this? –  user1202664 May 29 '12 at 23:16
1  
Box-Cox transformation is not just $x^\lambda$, it is $\lambda\frac{x^\lambda - 1}{\dot x^{\lambda-1}}$ where $\dot x$ is the geometric mean. The reason for introducing this geometric mean is to provide correct likelihood ratio tests. –  StasK May 30 '12 at 1:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.