-1

I am relatively new to R and I am interested in performing a Box-Cox transformation. However, I am a little lost as to the step-by-step process of doing this. I have been searching the web for a number of days and have tried various code to no avail.

Overall, within my dataset (data=fw) I want to test for differences in a dependent variable (x) between between two locations (north and south). However, my data is not normally distributed and has unequal variance. Therefore, I need to transform my data (log and square root have not worked). Is the 'MASS' package the only package that I need to use to perform the Box-Cox transformation, or do I need some others? Any advice on the step-by-step process on Box-Cox transformation of the data would be much appreciated.

2 Answers2

5

First, I would review some introductory resources on data transformations, in general, and on Box-Cox transformation, in particular. For example, see my relevant answer and this webpage.

For more details on performing Box-Cox transformation in R, check this excellent discussion. In addition to MASS package, some other R packages can be used for Box-Cox transformation, also consider using car package, which offers several types of power transformations and somewhat more general than in MASS functions, for example this one.

In regard to selecting the optimal parameter for the transformation, see this answer on StackOverflow as well as the AID R package (see page on CRAN).

0

You can use function "preProcess" of caret package for univariate CB transformation and "bcPower" function of "car" package for multivariate CB transformation. Regards, Jüri.