SAS tutorial 10/20
SAS tutorial 10/20
Overview
• PROC SUMMARY
• PROC SORT
• LABEL
• GOTO
SUMMARY & SORT
PROC SUMMARY
• Provides data summarization tools that compute descriptive statistics for variables across all observations or within groups of observations.
• Similar to PROC MEANS
Syntax
Differences to MEANS
• Cannot do t-test
• Cannot calculate confidence limits
• Cannot estimate quantiles
Example 1
DATA creativity
Result
Use “BY” option
“Not sorted in ascending sequence”
PROC SORT
• Orders SAS data set observations by the values of one or more character or numeric variables
Syntax
Example 2
Result
Example 1
Result
LABEL & GOTO
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.
(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.
Example 3
Result
Return
Result