The following
functions return a numeric constant, based on a summary operation
that is performed on a numeric column. The results of these functions
are the same as if the corresponding statistics were requested with
PROC SUMMARY. These functions take a single argument, which resolves
to the name of a numeric column. They take precedence over similar
multi-argument DATA step functions.
number = EVAL( function-name(
numeric-column ) )
|
|
|
|
|
|
|
|
|
|
One-sided confidence
limit below the mean
|
|
|
|
|
|
|
|
|
|
Number of non-missing
values
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
p-value for Student's
t statistic
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Standard error of the
mean
|
|
|
|
|
|
|
|
One-sided confidence
limit above the mean
|
|
Uncorrected sum of squares
|
|
|
The following
example uses GTL summary statistic functions to dynamically construct
reference lines and a table of statistics for a numeric variable,
which is supplied at runtime.
proc template;
define statgraph expression;
dynamic NUMVAR "required";
begingraph;
entrytitle "Distribution of " eval(colname(NUMVAR));
layout overlay / xaxisopts=(display=(ticks tickvalues line));
histogram NUMVAR;
/* create reference lines at computed positions */
referenceline x=eval(mean(NUMVAR)+2*std(NUMVAR)) /
lineattrs=(pattern=dash) curvelabel="+2 STD";
referenceline x=eval(mean(NUMVAR)) /
lineattrs=(thickness=2px) curvelabel="Mean";
referenceline x=eval(mean(NUMVAR)-2*std(NUMVAR)) /
lineattrs=(pattern=dash) curvelabel="-2 STD";
/* create inset */
layout gridded / columns=2 order=rowmajor
autoalign=(topleft topright) border=true;
entry halign=left "N";
entry halign=left eval(strip(put(n(NUMVAR),12.0)));
entry halign=left "Mean";
entry halign=left eval(strip(put(mean(NUMVAR),12.2)));
entry halign=left "Std Dev";
entry halign=left eval(strip(put(stddev(NUMVAR),12.2)));
endlayout;
endlayout;
endgraph;
end;
run;
proc sgrender data=sashelp.heart template=expression;
dynamic numvar="MRW";
run;