Interview Questions   Tutorials   Discussions   Programs   Videos

# SAS - What is the difference btw proc means and proc univariate?

1454
views
asked mar September 20, 2014 06:30 AM

What is the difference btw proc means and proc univariate?

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;
``````
flag

### Join with account you already have

Preview

Online-Classroom Classes
www.writeabc.com

1 person following this question

Question tags

sas × 1

Asked 2 years and 3 months ago ago
Number of Views -1454