登录
首页精彩阅读Spss中syntax语句运用实例
Spss中syntax语句运用实例
2017-04-24
收藏

Spss中syntax语句运用实例

Spss syntax 语句运用实例

Sort 命令

Sort cases by age.

Select cases命令(filter)

USE ALL.

COMPUTE filter_$=(r26 < 1 & r26 > 4).

VARIABLE LABEL filter_$ 'r26 < 1 & r26 > 4 (FILTER)'.

VALUE LABELS filter_contentnbsp; 0 'Not Selected' 1 'Selected'.

FORMAT filter_$ (f1.0).

FILTER BY filter_$.

EXECUTE .

Select cases命令(delete)

FILTER OFF.

USE ALL.

SELECT IF(年龄 >= 5).

EXECUTE .

Frequencies 命令

freq

variables=就业状态  r22

/order= analysis.

Compute 命令

例一

IF (r22 = 1) 教育 = 周岁 / 12 .

EXECUTE .

例二

if (r16 = 2) edu = 0 .

if (r16 =1 and r17 = 1) edu = 1 .

if (r16 =1 and r17 = 2 and r18 = 2) edu = 6.

if (r16 =1 and r17 = 2 and r18 = 3) edu = 5.

if (r16 =1 and r17 = 2 and r18 = 4) edu = 3.

if (r16 =1 and r17 = 2 and r18 = 5) edu = 3.

if (r16 =1 and r17 = 3 and r18 = 2) edu = 9.

if (r16 =1 and r17 = 3 and r18 = 3) edu = 8.

if (r16 =1 and r17 = 3 and r18 = 4) edu = 7.

if (r16 =1 and r17 = 3 and r18 = 5) edu = 7.

if (r16 =1 and r17 = 4 and r18 = 1) edu = 11.

if (r16 =1 and r17 = 4 and r18 = 2) edu = 12.

if (r16 =1 and r17 = 4 and r18 = 3) edu = 11.

if (r16 =1 and r17 = 4 and r18 = 4) edu = 10.

if (r16 =1 and r17 = 4 and r18 = 5) edu = 10.

if (r16 =1 and r17 = 5 and r18 = 1) edu = 14.

if (r16 =1 and r17 = 5 and r18 = 2) edu = 15.

if (r16 =1 and r17 = 5 and r18 = 3) edu = 14.

if (r16 =1 and r17 = 6 and r18 = 1) edu = 15.

if (r16 =1 and r17 = 6 and r18 = 2) edu = 16.

if (r16 =1 and r17 = 6 and r18 = 3) edu = 15.

if (r16 =1 and r17 = 7 and r18 = 1) edu = 18.

if (r16 =1 and r17 = 7 and r18 = 2) edu = 20.

exe.

Recode 命令

RECODE

r22

(SYSMIS=9)  (1=1)  (2=2)  (3=3)  (4=4)  (5=5)  (6=6)  (7=7)  (8=8)  INTO  就业状态 .

VARIABLE LABELS 就业状态 '单位类型'.数据分析师培训

EXECUTE .


数据分析咨询请扫描二维码

客服在线
立即咨询