options ls=78;
data hw2;
infile 'hwk2data.txt';
input sn gender $ color $ propvio music;
run;
proc print data=hw2;
title 'name, printing out data to check format';
run;
proc univariate
data=hw2 plot;
var propvio
music;
title 'name, univariate to assess
distribution';
run;
proc means data=hw2;
var propvio
music;
title 'name, calculating means';
run;
proc chart data=hw2;
vbar propvio
music / levels=12;
title 'name, charting data to examine distributions';
run;
proc sort data=hw2;
by gender;
run;
proc univariate
data=hw2 plot;
by gender;
var propvio
music;
title 'name, univariate to examine
distributions sorted by gender';
run;
proc means data=hw2;
by gender;
var propvio
music;
title 'name, examining means when sorting by gender';
run;
proc chart data=hw2;
by gender;
vbar propvio
music / levels=7;
title 'name, examining chart when sorting by gender';
run;
proc sort data=hw2;
by color;
run;
proc univariate
data=hw2 plot;
by color;
var propvio
music;
title 'name, univariate to examine
distributions when sorting by car color';
run;
proc means data=hw2;
by color;
var propvio
music;
title 'name, calculating means when sorting by car color';
run;
proc chart data=hw2;
by color;
vbar propvio
music / levels=7;
title 'name, examining chart when sorting by car color';
run;
proc sort data=hw2;
by gender color;
run;
proc univariate
data=hw2 plot;
by gender color;
var propvio
music;
title 'name, univariate to examine
dist when sorting by gender and car color';
run;
proc means data=hw2;
by gender color;
var propvio
music;
title 'name, calculating means sorted by gender and car
color';
run;
proc chart data=hw2;
by gender color;
vbar propvio
music / levels=7;
title 'name, examining chart when sorting by gender and
color';
run;
quit;