You are on page 1of 3

SAS Commands and Procedures

SAS Commands and Procedures


In the documentation below, each SAS command will be briefly described and then the syntax of the command will be specified. The necessary SAS command will always appear in BOLD CAPITAL LETTERS, required information that needs to be specified by the programmer (you) will appear in italics, and optional information will be enclosed in <...>. CHART PROCEDURE charts. Produces vertical and horizontal bar charts, histograms, block charts, pie charts, and star

PROC CHART <option list>; BY variable-list; VBAR variable-list / options; HBAR variable-list / options; BLOCK variable-list / options; PIE variable-list / options; STAR variable-list / options; CORRELATION PROCEDURE association. Computes Pearson correlation coefficients and nonparametric measures of

PROC CORR <option list>; BY variable-1 <variable-2> ... <variable-n>; VAR variable-1 variable 2 <variable-3> ... <variable-n>; DATA COMMAND Begins a data step to create a SAS data set.

DATA data-set-name; FILENAME COMMAND Associates a SAS file reference with an external file.

FILENAME fileref 'external filename'; INFILE COMMAND INFILE fileref; INPUT COMMAND Describes the arrangement of values in an input record and assigns input values to corresponding SAS variables. INPUT variable-1 <variable-2> ... <variable-n>; GPLOT PROCEDURE Plots the values of two or more variables on a set of coordinate axes (X and Y). Identifies an external file to read with an INPUT statement.

PROC GPLOT <options>; PLOT plot-requests / options; PRINT PROCEDURE Prints the obseravations in a SAS data set.

PROC PRINT <option list>; VAR variable-list; RANK PROCEDURE Computes ranks for one or more numerical variables and outputs the ranks to a new SAS data

file:///C|/Users/Arun/Desktop/SAS Commands and Procedures.htm[6/14/2012 1:51:03 PM]

SAS Commands and Procedures

set. PROC RANK <options>; NORMAL=BLOM Computes normal scores for assessing normality. BY variable-1 <variable-2> ... <variable-n>; VAR data-set-variables; RANKS new variables; REGRESSION PROCEDURE Provides a general-purpose procedure for regression.

PROC REG <options>; OUTEST=data-set-name outputs a data set that contains parameter estimates and other model fit statistics MODEL dependent variable(s) = explanatory variable(s) </options>; Model Statement Options ALPHA= CLB CLI CLM I NOINT P PRESS PCORR1 PCORR2 R sets significance value for confidence and prediction intervals and tests computes confidence limits for the parameter estimates computes confidence limits for an individual predicted value computes confidence limits for the expected value of the dependent variable displays inverse of sums of squares and crossproducts fits a model without an intercept computes predicted values outputs the PRESS statistic to the OUTEST= data set. displays squared partial correlation coefficients using Type I sums of squares displays squared partial correlation coefficients using Type II sums of squares produces analysis of residuals

SELECTION= specifies model selection method (FORWARD, BACKWARD, STEPWISE, MAXR, MINR, RSQUARE, ADJRSQ, or CP) SLE= SLS= SS1 SS2 XPX sets criterion for entry into model sets criterion for staying in model displays the sequential sum of squares displays the partial sum of squares displays sums-of-squares and crossproducts matrix

BY variable(s); ID variable(s); OUTPUT <OUT=SAS-data-set> keyword-1=name1 ... <keyword-n=name-n>; Keywords for Output COOKD = name DFFITS = name H = name LCL = name LCLM = name Cook's D influence statistic standard influence of observation on predicted value leverage lower bound of a confidence interval for an individual prediction lower bound of a confidence interval for the expected value (mean) of the

file:///C|/Users/Arun/Desktop/SAS Commands and Procedures.htm[6/14/2012 1:51:03 PM]

SAS Commands and Procedures

dependent variable PREDICTED (or P) predicted values = name PRESS = name ith residual divided by (1-h), where h is the leverage and the model has been refit without the ith observation

RESIDUAL (or R) = residuals, caclulated as observed-predicted name RSTUDENT = name a studentized residual with the current observation deleted STDI = name STDP = name STDR = name STUDENT = name UCL = name UCLM = name standard error of the individual predicted value standard error of the mean predicted value standard error of the residual studentized residuals, residuals divided by their standard errors upper bound of a confidence interval for an individual prediction upper bound of a confidence interval for the expected value (mean) of the dependent variable

PLOT <y-variable*x-variable>; RESTRICT equation1 <equation2> ... <equationn>; SORT PROCEDURE Sorts observations in a SAS data set by one or more variables.

PROC SORT <option list>; BY variable-list; UNIVARIATE PROCEDURE Produces simple descriptive statistics.

PROC UNIVARIATE <option list>; VAR variable-list; BY variable-list;

file:///C|/Users/Arun/Desktop/SAS Commands and Procedures.htm[6/14/2012 1:51:03 PM]

You might also like