spss中有多个if命令

时间:2011-12-02 05:50:06

标签: spss

是否可以在spss中使用嵌套任何命令? 例如

 if any(1, a to c) and if (1, s to x) xx=1.

2 个答案:

答案 0 :(得分:5)

当然,但你的语法不太正确。 if(any(1,a to c)和any(1,s to x))xx = 1。

if表达式可以任意复杂,但它需要是一个表达式。 if部分是一个声明。

HTH

答案 1 :(得分:0)

仅提供一个阐明嵌套部分的答案,下面是使用[ngModel]="MB.YearOfOperation | date: 'dd-MMM-yyyy'" (ngModelChange)="updateDate($event)" 而不是do if的示例。

if

此代码在变量do if any(1, a to c). do if any(1, s to x). compute xx=1. end if. end if. a中的任何一个上查找得分至少为1的行。仅在这些行中,它会找到变量cs中任何一个的得分至少为1的行。通过第一条语句并随后通过第二条语句的行被分配为x

它产生与以下结果相同的结果:

xx=1 if any(1, a to c) and

但是,以下结果会有所不同:

any(1, s to x) xx=1.

从本质上讲,这与在两个条件语句之间使用相同。

if any(1, a to c) xx=1. if any(1, s to x) xx=1. if any(1, a to x) or