options ls=78; title "Profile Plot for Pottery Data"; /* After reading in the pottery data, where each variable is * originally in its own column, the next statements stack the data * so that all variable names are in one column called 'chemical', * and all response values are in another column called 'amount'. * This format is used for the calculations that follow, as well * as for the profile plot. */ data pottery; infile "D:\Statistics\STAT 505\data\pottery.csv" delimiter=',' firstobs=2; input site $ al fe mg ca na; chemical="al"; amount=al; output; chemical="fe"; amount=fe; output; chemical="mg"; amount=mg; output; chemical="ca"; amount=ca; output; chemical="na"; amount=na; output; proc sort data=pottery; by site chemical; run; /* The means procedure calculates and saves the mean amount, * for each site and chemical. It then saves these results * in a new data set 'a' for use in the steps below. * / proc means data=pottery; by site chemical; var amount; output out=a mean=mean; run; /* The axis commands define the size of the plotting window. * The horizontal axis is of the chemicals, and the vertical * axis is used for the means. Using the =site syntax also * separates these plotted means by site. * / proc gplot data=a; axis1 length=3 in; axis2 length=4.5 in; plot mean*chemical=site / vaxis=axis1 haxis=axis2; symbol1 v=J f=special h=2 l=1 i=join color=black; symbol2 v=K f=special h=2 l=1 i=join color=black; symbol3 v=L f=special h=2 l=1 i=join color=black; symbol4 v=M f=special h=2 l=1 i=join color=black; run;