*********************************************; * f=sasmanual\clinq_expl_tab.sas *; * *; * Clinical data set questions: *; * II. Exploring the data (tabular) *; *********************************************; options linesize=min; %include 'c:\My Documents\My SAS Files\sasmanual\formats\clinical_fmt.sas'; libname mydir 'c:\My Documents\My SAS Files\sasmanual\data'; data clin; set mydir.clinical; run; proc freq data=clin; tables gender pregnant vitamins prim_dx sec_dx; format gender $gender. pregnant vitamins $yesno. prim_dx sec_dx $dxcodes.; title1 'The simulated clinical data from the SAS manual'; title2 'Question 1 - 1-way tables for 5 character variables'; run; proc freq data=clin; tables prim_dx * gender; format gender $gender. prim_dx $dxcodes.; title2 'Question 2a - 2-way table'; run; proc freq data=clin; tables pregnant * vitamins; format pregnant vitamins $yesno.; where gender='F'; title2 'Question 2b - 2-way table for women only'; run; proc freq data=clin; tables pregnant * gender /list missing; format pregnant $yesno. gender $gender.; title2 'Question 2c - Gender/pregnancy check'; run; proc freq data=clin; tables gender * prim_dx * vitamins; format vitamins $yesno. prim_dx $dxcodes. gender $gender.; title2 'Question 3 - 3-way table'; run;