OPTIONS LS=72 PS=55 NODATE NONUMBER NOCENTER; ******************************************************; *** Program Date Disk Programmer ; TITLE1 "Source: FREQP1.SAS 9/24/98 WEB Ed Stanek "; * DESCRIPTION: ; * a. Obtaining simple frequency tables ; * b. Cross-classified frequency tables for 2 vars ; * c. Attaching formats to discete value ; * using ICU.SD2 created from icu.dat ; * Examples of PROC FREQ, PROC FORMAT ; ******************************************************; *****************************; *** Read ICU Study data ***; *****************************; DATA icu; INFILE 'c:\temp\icu.dat' FIRSTOBS=11; INPUT id sta age sex race ser can crn inf cpr sys hra pre typ fra po2 ph pco bic cre loc; PROC FREQ; TABLES sex ; TITLE2 "Table 1a. Frequency Distribution of Gender"; PROC FORMAT; VALUE sexf 0="Male" 1="Female"; VALUE staf 0="Live" 1="Die"; PROC FREQ; TABLES sex ; FORMAT sex sexf. ; TITLE2 "Table 1b. Frequency Distribution of Gender with Formats"; PROC FREQ; TABLES age; TITLE2 "Table 1c. Frequency Distribution of age"; PROC FREQ; TABLES sex*sta /MISSPRINT; TITLE2 "Table 1d. Freq Dist of Gender by Survival cross-classification"; PROC FREQ; TABLES sex*sta /MISSPRINT NOROW NOCOL NOPERCENT; FORMAT sex sexf. sta staf. ; TITLE2 "Table 1e. Freq Dist of Gender by Survival cross-classification"; TITLE3 " with no percentages given "; PROC SORT; BY sta; PROC FREQ; BY sta; TABLES sex /LIST; FORMAT sex sexf. sta staf. ; TITLE2 "Table 2. Freq Dist. of Gender by Survival Status"; RUN;