Sunteți pe pagina 1din 34

DATA

SCIENCE
WITH SAS
LANGUAGE OF SAS

Introduction to SAS

Data Manipulation with SAS

Combining Datasets in SAS

Advanced SAS Concepts


INTRODUCTION TO SAS

Introduction to SAS
INTRODUCTION TO SAS

SAS Overview

SAS Setup

Base SAS Basics


Windows structure
Explorer

Data Structure
Records
Tables
INTRODUCTION TO SAS

SAS Overview

SAS Setup

Base SAS Basics


Windows structure
Explorer

Data Structure
Records
Tables
INTRODUCTION TO SAS

SAS Overview

SAS Setup

Base SAS Basics


Windows structure
Explorer

Data Structure
Records
Tables
INTRODUCTION TO SAS

SAS Overview

SAS Setup

Base SAS Basics


Windows structure
Explorer

Data Structure
Records
Tables
INTRODUCTION TO SAS

Importing Data into SAS


INFILE / INPUT
PROC IMPORT
GUI

Data Storage
Libraries

How to get data out of SAS


Gui v/s Put
INTRODUCTION TO SAS

SAS Overview

SAS Setup

Base SAS Basics


Windows structure
Explorer

Data Structure
Records
Tables
Image from http://www.psych.yorku.ca/lab/SAS/SAS4win.htm
SAS Overview
Statistical Analysis System developed in the 1970s

Widely used to analyze large volumes of data

Multiple components:

Base SAS
SAS Graph
SAS Enterprise Miner
SAS IML
SAS BI etc.

Offers solution specific products, for example:

SAS Aerospace Solutions


SAS Credit Scoring
SAS for Health Insurance etc.

http://en.wikipedia.org/wiki/SAS_(software)#Components
http://www.SAS.com/software/index.html
SAS Overview
SAS can be installed on multiple OS including:

Windows
Unix
Solaris
Linux

GUI options available on some OS

Current Base SAS version 9.4


SAS Overview
5 Main windows via Windows SAS

Program Editor
Used for writing, editing, and submitting SAS commands
and programs

Log
Displays status of SAS commands submitted

Output
Lists output of SAS commands submitted
SAS Overview
5 Main windows via Windows SAS

Results
Tracks output from various commands submitted

Explorer
Allows the user to list, view, and manage SAS datasets
INTRODUCTION TO SAS

SAS Overview

SAS Setup

Base SAS Basics


Windows structure
Explorer

Data Structure
Records
Tables
SAS Setup

Image from http://www.psych.yorku.ca/lab/SAS/SAS4win.htm


INTRODUCTION TO SAS

SAS Overview

SAS Setup

Base SAS Basics


Windows structure
Explorer

Data Structure
Records
Tables
SAS Program Editor

Image from http://www.SAS.com/govedu/edu/programs/od_academics.html


SAS Program Editor
Text editor that allows the
analyst to type in SAS
commands or sets of
commands (programs)

Editor is user-friendly, color-


coding of keywords available

All commands in the editor


window or part of program
can be submitted for
execution

Image from http://www.SAS.com/govedu/edu/programs/od_academics.html


SAS Program Editor
Commands grouped into a
program can be saved
.SAS extension

Multiple programs (editor


windows) can be open at the
same time

Image from http://www.SAS.com/govedu/edu/programs/od_academics.html


SAS Log Window

Image from https://onlinecourses.science.psu.edu/stat481/node/64


SAS Log Window
Record of activity in a
SAS session

Displays status of
commands submitted
Successful completion
or stopped due to
errors

User-friendly color-coding
of errors or warnings

Image from https://onlinecourses.science.psu.edu/stat481/node/64


SAS Log Window
Displays information on
data processed
Xxx records sorted

Displays information on
computing/processing time

Log files can be saved


(.log extension)

Very critical to review the


log once submitted
commands are run

Image from https://onlinecourses.science.psu.edu/stat481/node/64


SAS Output & Results Windows

Results
Window

Output
Window

Image from http://www.uni.edu/SASdoc/win/ztartSAS.htm


SAS Output & Results Windows
SAS Output Window

Displays output generated from


SAS commands

Default is HTML
Text output also possible

Multiple SAS output generated in Output


the course of a SAS program Window

Image from http://www.uni.edu/SASdoc/win/ztartSAS.htm


SAS Output & Results Windows
SAS Results Window

All SAS output generated in a


current SAS instance displayed Results
sequentially Window

Can display any output in output


window by clicking on it

Image from http://www.uni.edu/SASdoc/win/ztartSAS.htm


SAS Explorer Window

Image from http://support.SAS.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001105236.htm


SAS Explorer Window
Like Windows Explorer, but for SAS

Displays datasets, libraries

Image from http://support.SAS.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001105236.htm


INTRODUCTION TO SAS

SAS Overview

SAS Setup

Base SAS Basics


Windows structure
Explorer

Data Structure
Records
Tables
SAS Data and Procs

Two concepts that are very important in SAS:

1. Data sets

2. Procedures
SAS Data and Procs
DATA SETS

Data is collated in the form of datasets in SAS

A dataset is a collection of variables with values in column format:

http://support.SAS.com/rnd/itech/doc9/dev_guide/reader/dsviewer.html
SAS Dataset
Example of a SAS dataset
SAS Data and Procs
PROCEDURES

Procedure Proc - command used to manipulate data in a particular


way

Many kinds of data manipulation will require specific procedures in


SAS

Sorting : PROC SORT


Generate summary statistics : PROC MEANS
Generate frequency distributions : PROC FREQ
Create a chart : PROC CHART
Create a linear regression model : PROC REG
THANK YOU

S-ar putea să vă placă și