PROC MEANS produces descriptive statistics (means, standard deviation, minimum, maximum, etc.) for numeric variables in a set of data. PROC MEANS can be used for
Describing continuous data where the average has meaning Describing the means across groups Searching for possible outliers or incorrectly coded values Performing a single sample t-test
The syntax of the PROC MEANS statement is:
PROC MEANS ; ;
If the PROC MEANS procedure does not produce the statistic you need for a data set then PROC UNIVARIATE may be your choice. Although it is similar to PROC MEANS, its strength is in calculating a wider variety of statistics, specifically useful in examining the distribution of a variable.
Use PROC UNIVARIATE to examine the distribution of your data, including an assessment of normality and discovery of outliers.
The syntax of the PROC UNIVARIATE statement is:
PROC UNIVARIATE ; ;
Commonly used options for PROC UNIVARIATE include:
DATA= - Specifies data set to use NORMAL - Produces a test of normality FREQ Produces a frequency table PLOT Produces stem-and-leaf plot
Commonly used statements used with PROC UNIVARIATE include:
BY variable list; VAR variable list; OUTPUT OUT = datasetname;
The BY‑group specification causes UNIVARIATE to calculate statistics separately for groups of observations (i.e., treatment means). The OUTPUT OUT= statement allows you to output the means to a new data set. The following SAS program (PROCUNI1.SAS) produces a large number of statistics on the variable AGE:
DATA EXAMPLE; INPUT TREATMENT LOSS ; DATALINES; ; PROC UNIVARIATE NORMAL PLOT DATA=EXAMPLE; VAR AGE; HISTOGRAM AGE/NORMAL (COLOR=RED W=5); TITLE 'PROC UNIVARIATE EXAMPLE'; FOOTNOTE 'Evaluate distribution of variables'; RUN;
Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!