* Using PROC FREQ to count data; data nchamp; *infile 'z:\My Documents\teaching\stat_517\champ36pres.txt' firstobs=7 truncover; FILENAME webpage URL 'http://people.stat.sc.edu/hitchcock/champ36pres.txt'; INFILE webpage firstobs=7 truncover; INPUT year 4-7 team $ 9-27 @30 wins 30-31 losses 33 ties 35 Coach $19.; retain maxyear; maxyear=max(maxyear, year); if year= . then year + maxyear; drop maxyear; RUN; PROC FREQ DATA = nchamp; tables team; title 'Football Championships per Team'; RUN; PROC FREQ DATA = nchamp; tables coach / out=frqcoach; title 'Football Championships per Coach'; RUN; PROC FREQ DATA = nchamp; tables wins * losses; title 'Table of wins and losses by Football Champions'; RUN; PROC FREQ DATA = nchamp; tables ties*wins*losses / norow nocol; title 'Table of wins and losses by Football Champions (separate for number of ties)'; RUN; /* Sorting to print coaches, ranked by number of championships */ proc sort data = frqcoach out=srtcoach; by descending count; run; proc print data=srtcoach; title 'Coaches ranked by championships'; run;