options ls=80; * The options statement allows the linesize (ls) to be 80 characters wide; data hospital; input days progindx gender $; * DAYS : Number of days spent in the hospital; * PROGINDX : Prognosis index on how well the patient will recover - higher means more likely to make a full recovery; * GENDER: M=Male F=Female Note: The $ sign is needed to indicate that gender is character data; cards; 2 54 M 5 50 M 7 45 F 10 37 F 14 35 M 19 25 F 26 20 F 31 16 M 34 18 F 38 13 F 45 8 F 52 11 M 53 8 M 60 4 M 65 6 F ; *PROC UNIVARIATE calculates summary statistics for each listed quantitative variable; proc univariate data=hospital; var days progindx; *Here is a histogram; proc univariate data = hospital noprint; histogram progindx / midpoints = 0 to 60 by 5 vscale = count ; * PROC PLOT provides a scatter plot of Y*X; proc plot data=hospital; plot progindx*days; * PROC CORR provides the correlation between the listed variables; proc corr; var days progindx; * PROC SORT sorts the data by the given variable; proc sort; by gender; * PROC FREQ provides counts of character data. The datasset must be first sorted by the variable that you want counts for (gender); proc freq; tables gender; proc print; * PROC PRINT prints the data in the output file (not to the printer!); run;