70 likes | 230 Views
IF 條件指令 選取觀測體. DATA a; INFILE C:datab.dat; INPUT name $ sex $ ht wt; IF sex= ‘ m ’ ; PROC PRINT;. IF THEN 選取觀測體. DATA a; INFILE C:datab.dat; INPUT name $ sex $ ht wt; IF ht<155 THEN DELETE; PROC PRINT;. IF THEN/ELSE 選取觀測體.
E N D
IF 條件指令 選取觀測體 • DATA a;INFILE C:\data\b.dat;INPUT name $ sex $ ht wt; IF sex=‘m’;PROC PRINT;
IF THEN 選取觀測體 • DATA a;INFILE C:\data\b.dat;INPUT name $ sex $ ht wt; IF ht<155 THEN DELETE;PROC PRINT;
IF THEN/ELSE 選取觀測體 • DATA a;INFILE C:\data\b.dat;INPUT name $ sex $ ht wt; IF ht>=165 THEN OUTPUT high; ELSE OUTPUT common; PROC PRINTdata=high; PROC PRINTdata=common;
WHERE 條件指令 選取觀測體 • DATA a;INFILE C:\data\b.dat;INPUT name $ sex $ ht wt;DATA fat; set a; WHERE (wt/ht/ht)>25; PROC PRINT DATA=fat;
WHERE BETWEEN AND • DATA a;INFILE C:\data\b.dat;INPUT name $ sex $ ht wt;DATA normal; set a; where (wt/ht/ht) between 19 and 24; PROC PRINT DATA=normal;
WHERE CONTAINS • DATA a;INFILE C:\data\b.dat;INPUT name $ sex $ ht wt;DATA normal; set a; where (wt/ht/ht) between 19 and 24; PROC PRINT DATA=normal; WHERE name CONTAINS ‘楊’;
WHERE IS NULL(or is missing) • DATA a;INFILE C:\data\b.dat;INPUT name $ sex $ ht wt;DATA normal; set a; where (wt/ht/ht) between 19 and 24; PROC PRINT DATA=normal; WHERE name IS NULL ;/*缺漏值者*/