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