全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SPSS论坛
1800 2
2014-05-23
A new extension command for SPSS Statistics, STATS IF, has been uploaded to the SPSS Community website. This command allows you in essence to apply IF logic to procedure stream execution.  For example, you could write
STATS IF CONDITION1="spss.GetCaseCount()> 100" CONDITION2="True"
/SYNTAX1
"DESC ALL."
"REGRESSION"
"  /DEPENDENT salary"
"  /METHOD=ENTER jobtime educ."
/SYNTAX2
"FREQ ALL.".

It would run DESCRIPTIVES and REGRESSION if there are more than 100 cases and FREQUENCIES otherwise.

It also includes fine-grained error control.  For example, you could use it to log all serious errors to an external file for review and respond to errors dynamically.

The traditional syntax lines must be quoted so that they can be controlled by STATS IF.
The conditions must be Python expressions with inputs from apis as above and variables previously constructed in Python program blocks.

This command even supports conditional macro definition, so it offers an interesting way of letting macros adapt to the data and metadata in a way that is not possible with macro alone (brain damage alert).

All the functionality of this extension could be done with pure Python Statistics code, but this command may be more convenient in many cases.

STATS IF requires the Python Essentials and at least version 18 of Statistics. It can be downloaded from within Statistics using the Utilities menu in version 22. For older versions you can download it from the SPSS Community website (
[url=]www.ibm.com/developerworks/spssdevcentral[/url]) in the Extension Commands collection.



Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
peck@us.ibm.com
phone: 720-342-5621

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-5-26 20:04:55
Lisrelchen 发表于 2014-5-23 01:11
A new extension command for SPSS Statistics, STATS IF, has been uploaded to the SPSS Community websi ...
更新包?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-7-13 05:54:52
thanks for your sharing
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群