options ls=78; title "Profile Plot - Swiss Bank Notes"; /* After reading in the swiss 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 'variable', * and all response values minus their null values * are in another column called 'x'. * The subtraction is useful for plotting purposes because * it allows for a common reference value of 0 for all variables. */ data swiss; infile "D:\Statistics\STAT 505\data\swiss3.csv" firstobs=2 delimiter=','; input type $ length left right bottom top diag; variable="length"; x=length-215.0; output; variable="left "; x=left-130.0; output; variable="right "; x=right-130.0; output; variable="bottom"; x=bottom-9.0; output; variable="top "; x=top-10.0; output; variable="diag "; x=diag-141.354; output; run; proc sort; by type variable; run; /* The means procedure calculates and saves mean for * each variable and saves the results in a new data set 'a' * for use in the steps below. * / proc means data=swiss; by type variable; var x; output out=a mean=xbar; run; filename t1 "swiss13b.gif"; goptions device=gif gsfname=t1 gsfmode=replace; /* The axis commands define the size of the plotting window. * The horizontal axis is of the variables, and the vertical * axis is used for the mean values. * / proc gplot; axis1 length=4 in label=("Mean"); axis2 length=6 in; plot xbar*variable=type / vaxis=axis1 haxis=axis2; symbol1 v=J f=special h=2 i=join color=black; symbol2 v=K f=special h=2 i=join color=black; run;