【问题标题】:Box-Cox Transformation in SPSSSPSS 中的 Box-Cox 变换
【发布时间】:2017-11-21 18:18:53
【问题描述】:

我用对数、平方根等对我的统计数据进行了转换……但我的因变量尚未达到正态分布。

然后,我知道 Box-Cox 变换允许我们找出最佳变换方法以实现正态分布,因此可以应用参数检验,例如 ANOVA。

谁能帮助我如何在 SPSS 软件中执行 Box-Cox 转换?可以通过它的语法来申请吗?

【问题讨论】:

    标签: transformation spss


    【解决方案1】:

    Raynald's SPSS tools website 上有 Box Cox 转换语法。数据只是举例。

    我添加了一些简单的语法来轻松查看结果。

    * Box-Cox transformation for all 31 values of lambda between -2 to 1
    (increments of .1).
    * Raynald Levesque 2003/11/08.
    * http://www.spsstools.net/en/syntax/syntax-index/compute/box-cox-transformation/
    
    GET FILE="C:\{SPSS user folder}\Employee data.sav".
    COMPUTE var1=salary./* salary is a skewed test variable.
    
    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.
    
    * visual examination of results.
    EXAMINE
    VARIABLES= salary  xl1 to xl31
    /PLOT=NPPLOT
    /stat descrip.
    
    * numerical examination of results.
    FREQUENCIES
    /VARIABLES= salary, xl1 to xl31
    /FORMAT= NOTABLE
    /STATISTICS=SKEWNESS KURTOSIS.
    

    将结果复制到电子表格中后,数值检查效果最佳。

    【讨论】:

      猜你喜欢
      • 2014-12-11
      • 2015-09-29
      • 2019-12-25
      • 1970-01-01
      • 2015-07-13
      • 2016-03-04
      • 2014-12-24
      • 2022-01-06
      • 2020-11-21
      相关资源
      最近更新 更多