Professional Documents
Culture Documents
Chapter 4 - Preparing Data For Analysis: Bradley Paulse Office 1.87 (Cams) Brpaulse@uwc - Ac.za
Chapter 4 - Preparing Data For Analysis: Bradley Paulse Office 1.87 (Cams) Brpaulse@uwc - Ac.za
Chapter 4 - Preparing Data For Analysis: Bradley Paulse Office 1.87 (Cams) Brpaulse@uwc - Ac.za
Analysis
Bradley Paulse
Office 1.87 (Cams)
brpaulse@uwc.ac.za
Labelling Variables
• Output the labels in the proc print step using the label’ option.
*dlabel.sas,
*dlabel2.sas
*dlabel3.sas
Creating New Variables
*dcalc.sas
*dlabel3
SAS Functions
*time.sas
SAS Functions
*ddates.sas
ddates2.sas
Conditional Statements
• IF-THEN ELSE is a conditional statement that creates variables based on the evaluation of the
expression.
• If the criteria for the expression are not met then ELSE statement is executed.
Conditional Statements
• Can also stack the conditional statements by adding the ELSE-IF statement.
*dcondition.sas
Sub setting data sets
• Smaller data sets can be created from a larger main data set by using the SET statement
along with the conditional IF statement.
• Variables can be included or excluded from the output data set using the DROP and KEEP
statement in data step
• The DROP and KEEP statement only applies to the output data set.
Joining data sets
• Data sets can either be joined by appending or merging data sets to create a new data set.
• By appending data sets, observations are merely added to a new data set.
• By merging data sets, observations can joined by a common variable.
• Data sets can be sorted ascending or descending using the PROC SORT procedure
• Data sets can are sorted according to a single or multiple variables
*dsort.sas
READ THROUGH CHAPTER 4