* Example SAS program that shows some basic procs * and good format for IT 223 assignments * * This example has the data written into the * program. * * Filename: demodata.sas * Written by Craig Miller, Jan 10, 2005 * Note: an asterisk on a line starts a comment /* this can be used to comment multiple lines */ ; proc format; value $cnames 'none'='No Connection' 'dial'='Dial Up' 'dsl'='DSL or Cable' 'high'='High Speed'; value $hnames 'lpc'='On Lincoln Park Campus' 'loop'='On Loop Campus' 'in'='Inside the city off campus' 'out'='Outside the city'; data itclass; input webtrans webhours conntype $ commutemin home $ shoepairs progexp; label webtrans='Number of purchases on the Web in the previous month' webhours='Number of hours using the Web in the previous week' conntype='Type of internet connect for principal computer' commutemin='Time to commute from home to class in minutes' home='Home location' shoepairs='Number of pairs of shoes' progexp='Programming experience on a scale from 1 to 6'; format conntype $cnames.; format home $hnames.; cards; 1 10 dsl 60 out 5 3 4 7 dsl 60 out 3 4 0 3 dsl 20 in 15 2 5 8 dsl 40 in 2 3 1 6 dsl 35 in 9 3 0 40 dsl 45 lpc 20 2 5 25 dsl 30 lpc 15 1 8 6 dsl 45 in 2 3 10 50 dsl 60 in 10 3 2 5 dsl 60 out 5 3 1 15 dsl 75 out 5 4 2 7 dsl 30 in 5 5 3 16 dsl 50 out 3 3 0 5 dsl 45 in 5 5 1 7 dsl 20 in 12 3 3 10 dsl 35 in 3 2 43 18 dsl 27 in 163 3 0 26 dsl 60 out 3 2 13 3 dsl 45 out 6 3 4 15 dsl 30 in 4 4 2 45 dsl 35 out 3 4 4 25 high 8 loop 4 6 0 4 none 45 in 3 3 0 18 dial 45 in 3 1 0 5 dial 60 in 5 2 0 1 high 40 lpc 30 2 5 10 high 5 loop 7 2 proc print data=itclass; title 'Demographics of IT 223 class'; proc freq data=itclass; tables conntype; proc sort data=itclass; by home; /* sort by home before compute means by home */ proc means data=itclass; var commutemin; by home; proc univariate data=itclass; var webtrans webhours; /* minimal frequency chart */ proc gchart data=itclass; vbar webhours; /* frequency chart with options */ axis1 label=('Hours of Web use during previous week') length=10 cm; axis2 length=10 cm; proc gchart data=itclass; vbar webhours / midpoints=0 to 60 by 10 frame maxis=axis1 raxis=axis2; run;