首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SPSS中的Box-Cox变换

SPSS中的Box-Cox变换
EN

Stack Overflow用户
提问于 2017-11-22 02:18:54
回答 1查看 2.8K关注 0票数 1

我用对数,平方根,...但是我的因变量还没有达到正态分布。

然后,我知道Box-Cox变换允许我们找到最佳变换方法,以便实现正态分布,从而应用参数检验,如ANOVA。

有没有人能教我如何在SPSS软件中执行Box-Cox变换?可以通过它的语法来应用吗?

EN

回答 1

Stack Overflow用户

发布于 2018-02-07 00:17:05

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

我添加了一些简单的语法,以便更容易地看到结果。

代码语言:javascript
复制
* 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.

在将结果复制到电子表格中之后,数值考试效果最好。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47420038

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档