You are on page 1of 2

Proc rank used to create categorical variables

proc univariate for descriptive stats

if then most commonly used to create new variables with conditional logic

else cannot be used without if

Account for all possible values in data using if then else

Missing data(.) are viewed as negative numbers. When you use < operator, missing data might get
included

Character values “red” must be enclosed in quotes when specifying using conditional statements

LIST prints output in list format and not tabular format

MISSING option includes missing values in frequency distributions

Always use END statement with DO statement=DO group

PROC RANK computes rank for one or more numerical variables across observations of a SAS data
set-by default-smallest to largest

PROC RANK DATA= work.master;

OUT=work.master4 GROUPS=5;

VAR age;

RANKS ageRank;

Run;

Proc univariate data= epic.anthro;

Var age;

Histogram height/normal; run;

Arrays are used to make program more efficient (less code)

In combination with DO statement, arrays can do group processing of many variables together

ARRAY statement defines a set of variables that you plan to process as a group

ARRAY bpa [2] sbp dbp; *variables name can be put here even if variables have not been created*

DO i=1 to 2; *repeated*

IF bpa[i]=888 THEN bpa [i]=.;

END; RUN;

SHORT in proc contents gives a list of variables so you can copy paste and put in array

ARRAY numa [*] _NUMERIC_ [*] I don’t know how many elements are in the array, you count it
DO i=1 to DIM(numa);

….. END; RUN;

PROC FORMAT defines rules-instructions that SAS follows to write data values to the output window.
Enhance readability of the output.

PROC FORMAT;

VALUE genderf 1=”Male” 2=”female”; *value provides names and rules for the format*

Run;

Proc print data=work.alwt;

Format sex genderf. ;

Var sex;

Run;

Format sex; removes any format to the variable

You might also like