327 *********************************************; 328 * f=sasmanual\clinq_expl_tab.sas *; 329 * *; 330 * Clinical data set questions: *; 331 * II. Exploring the data (tabular) *; 332 *********************************************; 333 334 options linesize=min; 335 336 %include 'c:\My Documents\My SAS 336! Files\sasmanual\formats\clinical_fmt.sas'; NOTE: Format $GENDER is already on the library. NOTE: Format $GENDER has been output. NOTE: Format $DXCODES is already on the library. NOTE: Format $DXCODES has been output. NOTE: Format $YESNO is already on the library. NOTE: Format $YESNO has been output. NOTE: PROCEDURE FORMAT used: real time 0.05 seconds 366 367 libname mydir 'c:\My Documents\My SAS Files\sasmanual\data' 367! ; NOTE: Libref MYDIR was successfully assigned as follows: Engine: V7 Physical Name: c:\My Documents\My SAS Files\sasmanual\data 368 369 data clin; 370 set mydir.clinical; 371 run; NOTE: The data set WORK.CLIN has 34 observations and 11 variables. NOTE: DATA statement used: real time 0.11 seconds 372 373 proc freq data=clin; 374 tables gender pregnant vitamins prim_dx sec_dx; 375 format gender $gender. pregnant vitamins $yesno. 376 prim_dx sec_dx $dxcodes.; 377 title1 'The simulated clinical data from the SAS manual'; 378 title2 'Question 1 - 1-way tables for 5 character 378! variables'; 379 run; NOTE: PROCEDURE FREQ used: real time 0.32 seconds 380 381 proc freq data=clin; 382 tables prim_dx * gender; 383 format gender $gender. prim_dx $dxcodes.; 384 title2 'Question 2a - 2-way table'; 385 run; NOTE: PROCEDURE FREQ used: real time 0.22 seconds 386 387 proc freq data=clin; 388 tables pregnant * vitamins; 389 format pregnant vitamins $yesno.; 390 where gender='F'; 391 title2 'Question 2b - 2-way table for women only'; 392 run; NOTE: PROCEDURE FREQ used: real time 0.15 seconds 393 394 proc freq data=clin; 395 tables pregnant * gender /list missing; 396 format pregnant $yesno. gender $gender.; 397 title2 'Question 2c - Gender/pregnancy check'; 398 run; NOTE: PROCEDURE FREQ used: real time 0.22 seconds 399 400 proc freq data=clin; 401 tables gender * prim_dx * vitamins; 402 format vitamins $yesno. prim_dx $dxcodes. gender $gender.; 403 title2 'Question 3 - 3-way table'; 404 run; NOTE: PROCEDURE FREQ used: real time 0.21 seconds