0
$\begingroup$

I have 10 variables, and am trying to determine which transformation between each variable provides the best linear relationship. To this end, I am using the Box-Cox method to determine a power transformation to apply. I wrote a simple code that loops through all variables, changing the independent variable while keeping the dependent variable the same, then moving onto the next row, calculating the lambda value for every loop cycle. The final result is a 10 x 10 matrix of lambda values. Along the diagonal of this matrix, I would have thought all the values would be 1.0, indicating no transformation is necessary. As any value plotted against itself, forms a perfect linear relationship. However, the values range from -0.26 to 0.99.

Could someone help me to understand why this is the case?

I am working within MATLAB (R2018b), since the native MATLAB boxcox function only considers the univariate case, I am using the Box-Cox code from: https://www.mathworks.com/matlabcentral/fileexchange/10419-box-cox-power-transformation-for-linear-models

$\endgroup$
  • 1
    $\begingroup$ Could you explain what you mean by "the Box-Cox method"? As originally proposed it doesn't involve anything like what you describe. $\endgroup$ – whuber Feb 12 '19 at 16:18
  • $\begingroup$ Based on the methodology presented by Box and Cox (G. E. P. Box, D. R. Cox, "An Analysis of Transformation", Journal of the Royal Statistical Society. Series B (Methodological), Vol. 26, No. 2 (1964) , pp. 211-252), I found the maximized log likelihood which indicates the optimal lambda value for producing a linear relationship between my independent and dependent variable. Similar to the example from Wikipedia (<en.wikipedia.org/wiki/Power_transform#/media/…) where a lambda value of approximately 0 was found indicating a log transformation. Does this help? $\endgroup$ – Ryan Feb 12 '19 at 17:42
  • 1
    $\begingroup$ What sense does that make when you match a variable with itself? The relationship will be linear for every possible $\lambda$! $\endgroup$ – whuber Feb 12 '19 at 17:46
  • $\begingroup$ I am aware it forms a perfectly linear relationship, as stated in the original post. I was hoping to understand why the calculated lambda value is not 1 in all of these instances, since it is perfectly linear. My main concern is that perhaps it is symptomatic of having incorrectly completed the analysis, or perhaps some peculiarity of the method. I am using this for research, and while it is not important to present the results of a variable with itself, for my own personal understanding I was hoping someone would be able to shed some light on it, or point me in the right direction. $\endgroup$ – Ryan Feb 12 '19 at 17:54
0
$\begingroup$

After looking through my data I have determined that the Box-Cox transformation of a variable against itself becomes the univariate case. That is to say, if the variable is approximately normally distributed, then the λ value of maximum log likelihood is close to 1 corresponding to no transformation. However, if the data is non-normally distributed, then the λ value of maximum log likelihood is a value which will best transform the variable to the normal distribution.

To answer the question, the multivariate Box-Cox λ value should only be 1 if the data is normally distributed, and ≠1 otherwise.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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