Means procedure

The MEANS procedure produces summary or descriptive statistics for a dataset. It can calculate simple statistics (mean, median, standard deviation), confidence intervals, quantile estimates and do a oneway t-test. These statistics can be across all observations of a dataset (one per dataset) or based on groups (one per bygroup).

Syntax

PROC MEANS < options >;
  BY byvar(s);
  CLASS var(s) / options;
  FREQ var;
  VAR var(s) ;
  WEIGHT var;
  OUTPUT < OUT=dataset keyword<(var list)> =newvar(s) ... / options> ;
  ID var(s);
  TYPES request(s);
  WAYS list;

RUN;
Basic options on PROC MEANS statement

DATA= : specify input dataset.

ALPHA= : specify alpha for confidence limits.

statistic keyword: specify statistics displayed. See below.

MAXDEC= : The number of decimal places for the statistics.

NOPRINT= : Suppresses displayed output.

Statements

BY : Statistics are calculated separately for each bygroup, separated by a BYLINE.

CLASS: Statistics are calculated separately for each bygroup, separated by a blank line. Some statistics depend on this class statement.

FREQ : Identifies the variable that contains the frequency of each observation.

VAR : List the variables to analyze in desired order.

WEIGHT : Identifies the variable containing the weight of each observation for statistical calculations.

OUTPUT : Creates a SAS dataset containing specified output.

ID : Lists additional variables to include in the output dataset.

TYPES : Identifies combinations of class variables to subdivide data.

WAYS : Specifies the number of ways to make unique combinations of class variables. (Use instead of TYPES.)

Statistic keywords

Descriptive statistics: N, NMISS, MIN, MAX, MEAN, STDDEV|STD, STDERR, VAR, SUM, RANGE, SKEWNESS, KURTOSIS, CV, CLM, LCLM, UCLM.

Quantile statistics: P5, P10, Q1|P25, MEDIAN|P50, Q3|P75, P90, P95, P99, QRANGE.

Hypothesis testing: PROBT T.

Default statistics: N, MEAN, STD, MIN, MAX.