2018-01-15 16:18:06 UTC
I did not find a function that produces a Box-Cox transformation in
PSPP. On Raynald's SPSS macro pages a SPSS macro with syntax
has been published is published that does the job.
* Box-Cox transformation for all 31 values of lambda between -2 to 1
(increments of .1). * Raynald Levesque 2003/11/08. GET FILE='c:\\program
files\\spss\\employee data.sav'. COMPUTE var1=salary. VECTOR lam(31)
/xl(31). LOOP idx=1 TO 31. - COMPUTE lam(idx)=-2.1 + idx * .1. - DO IF
lam(idx)=0. - COMPUTE xl(idx)=LN(var1). - ELSE. - COMPUTE
xl(idx)=(var1**lam(idx) - 1)/lam(idx). - END IF. END LOOP. EXECUTE.
I used the Box-Cox transformation macro
produces a series of values for the variable to be transformed called xl
for values of lambda above -2.1.
The original variables in the test data set, salary, shows a skew of
2.12 and a kurtosis of above 5.
After having run the macro I don't see how to continue. How to decide
which is the best lambda value and thus, the best transformation?
I did a frequency of all transformed xl variables to find the
transformed , i.e. xl, variable with the skew and kurtosis the closest
to 0. I also tried to visually find the best transformation.
FREQUENCIES xl1 to xl31
VARIABLES= xl1 to xl31
Are these the appropriate ways ?
In my view the results show that xl10 and xl11 show a good combination
of skew and kurtosis and are together close to 0.
1/ Are there other ways in PSPP to run a box-cox transformation ?
2/ Which is the best way to find the best transformation ?
If not what do you recommend how to decide about the appropriate
transformed variable ?
Thanks in advance,