Proc means is used to compute simple statistics from a data set. Here is an example using some of the most common options.
proc means data=first alpha=0.10 vardef=n mean std t prt n lclm uclm; var x y; by x; run;
data=first statement selects the data set used in
alpha= option sets the significance level for any confidence
intervals computed (defaults to alpha=0.05 if not specified).
vardef=n option sets the divisor for the sample variance to be the
sample size n (default is to use the degrees of freedom n-1 and
is the same as
vardef=df). NOTE: do not use the
if you also use the
prt options. THE T AND PRT VALUES
GENERATED WHEN VARDEF=N ARE INCORRECT.
The optional last line gives a list of the statistics to be computed.
std options give the sample mean and sample standard
deviation for each variable in the analysis.
t option computes the value of the t-statitistic for a test
of zero mean for each variable.
prt option computes the p-value for a test of the null
hypothesis of zero mean for each variable.
n option prints the sample size.
uclm options produce the lower and upper endpoints of a
100(1-alpha)% confidence interval for the mean.
If no statistics are specified,
n mean std min and
printed for each variable.
max are the sample minimum
value and maximum value.
var option can be used to limit the output to a specific
list of variables in the data set. If it is not used, the
requested statistics will be computed for all variables in the
The optional by statement generates separate analyses for each level of the by variable(s).
For additional information, see the online help under SAS SYSTEM HELP--MODELING & ANALYSIS TOOLS--DATA ANALYSIS--(ELEMENTARY)MEANS or the SAS Procedures Guide.
Copyright © 1997 by Jerry Alan Veeh. All rights reserved.