Lecture5_1 - Chapter 8: Validating and Cleaning Data 8.1...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Chapter 8: Validating and Cleaning Data 8.1 Introduction to Validating and Cleaning Data 8.2 Examining Data Errors When Reading Raw Data Files 8.3 Validating Data with the PRINT and FREQ Procedures 8.4 Validating Data with the MEANS and UNIVARIATE Procedures 8.5 Cleaning Invalid Data
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Objectives Clean data by using the Viewtable window. Clean data by using assignment statements in the DATA step. Clean data by using IF-THEN / ELSE statements in the DATA step.
Background image of page 2
3 Invalid Data to Clean The orion.nonsales data set contains invalid data that needs to be cleaned. After validating the data and finding the invalid data, the correct data values are needed.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Variable Obs Invalid Value Correct Value Employee_ID 7 120108 120109 14 . 120116 Gender 12 G F 101 F Job_Title 10 Security Guard I Country 2, 84, 87, 125, 197, and 200 au or us AU or US Salary 4 . 26960 13 2650 26500 20 2401 24015 Hire_Date 5 21/01/1953 21/01/1995 9 . 01/11/1978 214 01/01/1968 01/01/1998
Background image of page 4
5 Interactively Cleaning Data If using the SAS windowing environment, the Viewtable window can be used to interactively clean data. Use the Viewtable window to interactively clean the following five observations: Variable Obs Invalid Value Correct Value Employee_ID 7 120108 120109 14 . 120116 Gender 12 G F 101 F Job_Title 10 Security Guard I
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Interactively Cleaning Data The Viewtable window enables you to browse, edit, or create SAS data sets.
Background image of page 6
7 Quiz Open the Viewtable window for orion.nonsales . Use the Viewtable window to interactively clean the following observation: Variable Obs Invalid Value Correct Value Job_Title 10 Security Guard I
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Quiz Correct Answer Open the Viewtable window for orion.nonsales . Use the Viewtable window to interactively clean the following observation:
Background image of page 8
9 Programmatically Cleaning Data The DATA step can be used to programmatically clean the invalid data. Use the DATA step to clean the following observations: Variable Obs Invalid Value Correct Value Country 2, 84, 87, 125, 197, and 200 au or us AU or US Salary 4 . 26960 13 2650 26500 20 2401 24015 Hire_Date 5 21/01/1953 21/01/1995 9 . 01/11/1978 214 01/01/1968 01/01/1998
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10 The Assignment Statement The assignment statement evaluates an expression and assigns the resulting value to a variable. General form of the assignment statement: variable names an existing or new variable. expression is a sequence of operands and operators that form a set of instructions that produce a value. variable = expression ;
Background image of page 10
11 The Assignment Statement Expression Operands are character constants numeric constants date constants character variables numeric variables. Operators are symbols that represent an arithmetic calculation SAS functions.
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
12 The Assignment Statement Expression Examples: Country = upcase(Country); Salary = 26960; Gender = 'F'; Hire_Date = '21JAN1995'd; function variable numeric constant character constant date constant
Background image of page 12
13 SAS Functions A SAS function is a a routine that returns a value that is determined from specified arguments.
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 182

Lecture5_1 - Chapter 8: Validating and Cleaning Data 8.1...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online