I am running a simple z-test and instead of displaying the data in a table, i.e. z-score=.67 and z-statistic at 95% = 1.96. I would like to display the test statistics graphically.
-1) Draw a normal distribution plot.
-2) on the graph put a marker for the threshold value 95% z (1.96) and fill with color values above the threshold
-3) Put a marker for the calculated z-score so the customer can visually see if the statistics is in the rejection zone. (above 1.96 or below -1.96).
Also, I am using Enterprise Guide 4.1 and SAS 9.1 is the SAS server.
This is a good use case where you can get the benefit of the SGPlot procedure that supports band plots. Here is the code. Note the small change in the data step to compute z1 and z2 (used to draw the bands).
a=1 / sqrt(2 * constant('PI'));
do x=-3.5 to 3.5 by .01;
y= a * exp(-(x**2)/2);
if x>= &z_cutoff then z1=y;
if x<=-&z_cutoff then z2=y;
ods html file='Normal.htm';
ods graphics / reset imagename='normal';
proc sgplot data=normal2;
label x='Standard Deviations';
band x=x upper=z1 lower=0;
band x=x upper=z2 lower=0;
series x=x y=y;
xaxis values=(-4 to 4 by 1);
inset ("Z-Score =" = "&z_score" "Z-Cutoff =" = "&z_cutoff") / border osition=topright;
ods html close;