1 / 7

IF 條件指令 選取觀測體

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 選取觀測體.

juana
Download Presentation

IF 條件指令 選取觀測體

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IF 條件指令 選取觀測體 • DATA a;INFILE C:\data\b.dat;INPUT name $ sex $ ht wt; IF sex=‘m’;PROC PRINT;

  2. IF THEN 選取觀測體 • DATA a;INFILE C:\data\b.dat;INPUT name $ sex $ ht wt; IF ht<155 THEN DELETE;PROC PRINT;

  3. 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;

  4. 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;

  5. 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;

  6. 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 ‘楊’;

  7. 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 ;/*缺漏值者*/

More Related