Sas tutorial 10

25
SAS tutorial 10/20

description

SASPROC SUMMARYPROC SORT----------LABELGOTO

Transcript of Sas tutorial 10

Page 1: Sas tutorial 10

SAS tutorial 10/20

Page 2: Sas tutorial 10

Overview

• PROC SUMMARY

• PROC SORT

• LABEL

• GOTO

Page 3: Sas tutorial 10

SUMMARY & SORT

Page 4: Sas tutorial 10

PROC SUMMARY

• Provides data summarization tools that compute descriptive statistics for variables across all observations or within groups of observations.

• Similar to PROC MEANS

Page 5: Sas tutorial 10

Syntax

Page 6: Sas tutorial 10

Differences to MEANS

• Cannot do t-test

• Cannot calculate confidence limits

• Cannot estimate quantiles

Page 7: Sas tutorial 10

Example 1

Page 8: Sas tutorial 10

DATA creativity

Page 9: Sas tutorial 10

Result

Page 10: Sas tutorial 10

Use “BY” option

Page 11: Sas tutorial 10

“Not sorted in ascending sequence”

Page 12: Sas tutorial 10

PROC SORT

• Orders SAS data set observations by the values of one or more character or numeric variables

Page 13: Sas tutorial 10

Syntax

Page 14: Sas tutorial 10

Example 2

Page 15: Sas tutorial 10

Result

Page 16: Sas tutorial 10

Example 1

Page 17: Sas tutorial 10
Page 18: Sas tutorial 10

Result

Page 19: Sas tutorial 10

LABEL & GOTO

Page 20: Sas tutorial 10

GOTO

• Directs program execution immediately to the statement label that is specified and, if followed by a RETURN statement, returns execution to the beginning of the DATA step.

Page 21: Sas tutorial 10

(Statement) Label

• Specifies a statement label that identifies the GOTO destination. The destination must be within the same DATA step. You must specify the label argument.

Page 22: Sas tutorial 10

Example 3

Page 23: Sas tutorial 10

Result

Page 24: Sas tutorial 10

Return

Page 25: Sas tutorial 10

Result