4 Other useful features on the course web page. 5 Accessing SAS



Similar documents
Data exploration with Microsoft Excel: univariate analysis

Using SPSS, Chapter 2: Descriptive Statistics

AMS 7L LAB #2 Spring, Exploratory Data Analysis

IBM SPSS Statistics 20 Part 1: Descriptive Statistics

Getting Started with R and RStudio 1

Dongfeng Li. Autumn 2010

SPSS Manual for Introductory Applied Statistics: A Variable Approach

Appendix A How to create a data-sharing lab

EXCEL Tutorial: How to use EXCEL for Graphs and Calculations.

How to install and use the File Sharing Outlook Plugin

EXST SAS Lab Lab #4: Data input and dataset modifications

An Introduction to SPSS. Workshop Session conducted by: Dr. Cyndi Garvan Grace-Anne Jackman

WA2262 Applied Data Science and Big Data Analytics Boot Camp for Business Analysts. Classroom Setup Guide. Web Age Solutions Inc.

SECTION 2-1: OVERVIEW SECTION 2-2: FREQUENCY DISTRIBUTIONS

Data Analysis Tools. Tools for Summarizing Data

Quick Start Using DASYLab with your Measurement Computing USB device

Importing and Exporting With SPSS for Windows 17 TUT 117

How to use SURA in three simple steps:

Using the GroupWise Client

Appendix 2.1 Tabular and Graphical Methods Using Excel

Introduction to SAS on Windows

Directions for Frequency Tables, Histograms, and Frequency Bar Charts

An introduction to using Microsoft Excel for quantitative data analysis

Ohio University Computer Services Center August, 2002 Crystal Reports Introduction Quick Reference Guide

This manual provides information and instructions for Mac SharePoint Users at Fermilab. Using Sharepoint from a Mac: Terminal Server Instructions

Inquisite Reporting Plug-In for Microsoft Office. Version 7.5. Getting Started

Virtual Owl. Guide for Windows. University Information Technology Services. Training, Outreach, Learning Technologies & Video Production

Decision Support AITS University Administration. Web Intelligence Rich Client 4.1 User Guide

GeoGebra Statistics and Probability

Using Internet or Windows Explorer to Upload Your Site

MAPPING THE WEBDRIVE REFERENCE GUIDE

Getting Started with MozyPro Online Backup Online Software from Time Warner Cable Business Class

Chapter 15: Forms. User Guide. 1 P a g e

Getting started with the Stata

Directions for using SPSS

Introduction to SPSS 16.0

Learning SPSS: Data and EDA

Appendix III: SPSS Preliminary

How to Use a Data Spreadsheet: Excel

Describing, Exploring, and Comparing Data

Working with Office Applications and ProjectWise

State of Michigan Data Exchange Gateway. Web-Interface Users Guide

Remote Desktop Web Access. Using Remote Desktop Web Access

How To Use Spss

STC: Descriptive Statistics in Excel Running Descriptive and Correlational Analysis in Excel 2013

4. Descriptive Statistics: Measures of Variability and Central Tendency

Table of Contents. 1. Overview Materials Required System Requirements User Mode Installation Instructions..

IBM SPSS Statistics for Beginners for Windows

Online Backup and Recovery Manager Setup for Microsoft Windows.

Integrated Company Analysis

ProjectWise Explorer V8i User Manual for Subconsultants & Team Members

1. Right click using your mouse on the desktop and select New Shortcut.

Quick and Easy Web Maps with Google Fusion Tables. SCO Technical Paper

H-ITT CRS V2 Quick Start Guide. Install the software and test the hardware

Step Sheet: Creating a Data Table and Charts

Creating a Website with Publisher 2013

ithenticate User Manual

Getting started manual

SOS SO S O n O lin n e lin e Bac Ba kup cku ck p u USER MANUAL

Word 2010: Mail Merge to with Attachments

How To Set Up Dataprotect

Setting Up ALERE with Client/Server Data

Kaspersky Password Manager USER GUIDE

User Manual. Version Yeastar Technology Co., Ltd.

Engineering Problem Solving and Excel. EGN 1006 Introduction to Engineering

Novell ZENworks Asset Management 7.5

Introduction Course in SPSS - Evening 1

SAS Analyst for Windows Tutorial

Performance and Contract Management System Data Submission Guide

DEPLOYING A VISUAL BASIC.NET APPLICATION

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins)

Data exploration with Microsoft Excel: analysing more than one variable

ITP 101 Project 3 - Dreamweaver

Getting started with OneDrive

Introduction to the use of the environment of Microsoft Visual Studio 2008

ithenticate User Manual

Exploratory data analysis (Chapter 2) Fall 2011

Follow the instructions below for first-time users only

There are six different windows that can be opened when using SPSS. The following will give a description of each of them.

Virtual Exhibit 5.0 requires that you have PastPerfect version 5.0 or higher with the MultiMedia and Virtual Exhibit Upgrades.

Using SSH Secure Shell Client for FTP

WebSphere Business Monitor V7.0 Business space dashboards

Getting Started with Vision 6

ewebextra OfficeMate Integration User s Guide

REUTERS/TIM WIMBORNE SCHOLARONE MANUSCRIPTS COGNOS REPORTS

Using Excel for Analyzing Survey Questionnaires Jennifer Leahy

Introduction To Microsoft Office PowerPoint Bob Booth July 2008 AP-PPT5

Installing the Microsoft Network Driver Interface

Faculty Access for the Web 7 - New Features and Enhancements

BULK SMS USER GUIDE. Version 2.0 1/18

Creating a Database in Access

Real Time Monitor. A Real-Time Windows Operator Interface. DDE Compliant. (for remote data display)

MS Excel. Handout: Level 2. elearning Department. Copyright 2016 CMS e-learning Department. All Rights Reserved. Page 1 of 11

Using Adobe Dreamweaver CS4 (10.0)

How To Restore Your Data On A Backup By Mozy (Windows) On A Pc Or Macbook Or Macintosh (Windows 2) On Your Computer Or Mac) On An Pc Or Ipad (Windows 3) On Pc Or Pc Or Micro

Primavera P6 Professional Windows 8 Installation Instructions. Primavera P6. Installation Instructions. For Windows 8 Users

Access Queries (Office 2003)

Spring 2014 Urban Affairs network computers and computer labs Mapping your H:\ drive using Microsoft Windows 7

TM Online Storage: StorageSync

Transcription:

1 Using SAS outside of ITCs Statistical Methods and Computing, 22S:30/105 Instructor: Cowles Lab 1 Jan 31, 2014 You can access SAS from off campus by using the ITC Virtual Desktop Go to https://virtualdesktopuiowaedu You will be prompted to assent to an agreement and to enter your Hawkid and password Click the SAS 9_3 folder After some set-up, SAS will come up on your screen When you are finished, you must both exit from SAS and log off from the Virtual Desktop When you run SAS this way, although you can interact with it on your screen, it is actually running on a computer on campus Consequently, SAS can t access files that are on your hard drive unless you specify drive letter mapping In this lab, I will show you the most reliable way to get data into SAS when you are running it on the Virtual Desktop 2 Getting started in the ITC ITC computers will display a login screen Users should enter their HawkID and password in the spots provided Students can find their HawkID and default passwords on the ISIS system 3 Downloading files from the course web page Bring up a web browser, either Firefox or Internet Explorer Enter the address of my web page in the location box wwwstatuiowaedu/~kcowles Then click on Course homepages and 22S:30/105 Click on Datasets, and when the next screen appears, click on the underlined link Datasets Three types of files may be accessed: Files ending in dat are data files for your use with the software package SAS Files ending in info contain descriptive information about datasets Files ending in txt are datasets for use in a different class with a different software package Note that this list is case-sensitive, with all files with names beginning with capital letters appearing before all other files 1 If you are going to work with SAS on the Virtual Desktop, it is easiest to copy and paste the data from the web page directly into the SAS program If you are running SAS on the computer at which you are sitting, it is preferable to download the dataset into a file and tell SAS where to find the file Below, I will show you how to have SAS access data both ways To download a data file for use in this lab: Right click the file name (use the right, not left, mouse button) In the dialog box that opens, left click Save target as (use the left mouse button) In the save as dialog box chose My Computer/Local Disk C:/ Temp Click Save (If you preferred to save the file on your own disk in drive A: so that you could use it on a different computer later, you would move to drive A: in the dialog box before saving) Left click the billioninfo file to read a description of the billion dataset Click Back to get back to the list of datasets Then download the file billiondat according to the directions above 4 Other useful features on the course web page Return to the main course web page and click Web resources Note that there is a directory of the locations and hours of all the campus ITCs Lecture notes, homework assignments, and lab handouts are posted under Handouts These are in a format that may be read and printed in most ITCs 5 Accessing SAS To access SAS on your own laptop, go to https://virtualdesktopuiowaedu Log in with your Hawkid and password; then single click SAS, then SAS 9_3 To access SAS in the ITCs, click on Start/All Programs/SAS/SAS 93 This actually takes you to the Virtual Desktop as described above In either case, you will get a screen that shows: a menu bar a log window a program editor window 2

The first time you use SAS, you will want to adjust some settings Use the menus to select Tools/Options/Preferences Then open the Results tab Check Create listing and uncheck Create HTML 6 Entering commands and programs Click in the program editor window You may now type commands and programs in this window 7 How SAS programs and commands are organized Use a DATA step to organize your data by creating a SAS dataset Then use PROC steps or automated features to analyze your data Once you have created a SAS dataset, you may apply any SAS procedures or automated features to it during the SAS session without recreating the dataset DATA and PROC steps consist of SAS statements Each statement must end with a semicolon Most statements include one or more keywords that must be spelled exactly as shown 8 The DATA step: Creating a SAS dataset Before it can process data, SAS must read in the data in the form of a table with a row for each observation a column for each variable You must choose a name for the entire dataset and a name for each variable SAS has the following rules for names: SAS names must begin with a letter or an underscore The remaining characters in a SAS name can be letters, numbers, or underscores There must be no embedded blanks SAS distinguishes between two types of variables: numeric variables, which contain only digits and decimal points and with which arithmetic operations may be done, and character variables (all other kinds of data) 9 Controlling print width Put this line at the beginning of every SAS program if you want output to print correctly on 8-1/2 by 11 inch paper: 3 options linesize = 75 ; 10 Reading data in from an existing datafile You have saved the file billiondat in the temp directory Use an infile statement to tell SAS to use it data billion ; * gives dataset a name for SAS ; infile c:\temp\billiondat ; * tells SAS where the data is ; input wlth age region $ ; * names the variables in each row ; * $ after region identifies character vbl ; * end of data step ; 11 Copying data directly into the data step In this alternative method to get data into SAS, do not use an infile statement Instead use the datalines statement, and copy and paste the data in immediately following it Put a semicolon all by itself on the line after the last line of data data billion ; * gives dataset a name for SAS ; input wlth age region $ ; * names the variables in each row ; * $ after region identifies character vbl; datalines ; 37 50 M 24 88 U 14 64 A 1 59 E 1 E 1 O ; * end of data step; Type one of these data steps into the program editor window To make SAS run these statements and create the dataset, use the mouse to highlight the block of statements and then click on the icon of the running man SAS will use the log window to tell you what it has done Be sure to check the log window for any error messages If any errors are reported, click in the program editor window to make it active Correct the errors in the code and then rerun the block of code Note: if you wanted to read in the file from your own disk in the A: drive the infile statement would be: 4

infile a:billiondat ; The output is: 12 Using SAS procedures to list and tabulate the dataset Once the dataset is created, you may run SAS procedures to analyze it To list the entire dataset: proc print data = billion ; To get a frequency distribution of the regions in which billionaires lived: proc freq data = billion ; tables region ; The output is: * tables is a keyword; region is the name of * the variable for which you want counts ; The FREQ Procedure Cumulative Cumulative region Frequency Percent Frequency Percent ----------------------------------------------------------- A 38 1631 38 1631 E 80 3433 118 5064 M 22 944 140 6009 O 29 1245 169 7253 U 64 2747 233 10000 13 Proc univariate: SAS workhorse of descriptive statistics Use proc univariate for quantitative variables when you want the following: means medians quartiles 5-number summary stem plots (for small datasets) or histograms (large datasets) boxplots proc univariate plot data = billion ; var wlth ; 5 The UNIVARIATE Procedure Variable: wlth Moments N 233 Sum Weights 233 Mean 268154506 Sum Observations 6248 Std Deviation 331884032 Variance 110147011 Skewness 657544276 Kurtosis 569655987 Uncorrected SS 423084 Corrected SS 255541064 Coeff Variation 123765972 Std Error Mean 021742446 Location Basic Statistical Measures Variability Mean 2681545 Std Deviation 331884 Median 1800000 Variance 1101470 Mode 1000000 Range 3600000 Interquartile Range 170000 Tests for Location: Mu0=0 Test -Statistic- -----p Value------ Student s t t 1233323 Pr > t <0001 Sign M 1165 Pr >= M <0001 Signed Rank S 136305 Pr >= S <0001 6

Quantiles (Definition 5) Quantile Estimate 100% Max 370 99% 140 95% 62 90% 45 75% Q3 30 50% Median 18 25% Q1 13 10% 11 5% 10 1% 10 0% Min 10 ----Lowest---- Extreme Observations ----Highest--- Value Obs Value Obs 1 233 13 4 1 232 13 5 1 231 14 3 1 230 24 2 1 229 37 1 Histogram # Boxplot 37+* 1 * * 1 * 19+ * 1 * * 2 * * 2 * * 2 0 * 3 0 ******** 23 0 ************************ 72 +--+--+ 1+****************************************** 126 *-----* ----+----+----+----+----+----+----+----+-- * may represent up to 3 counts -2-1 0 +1 +2 14 Bar graphs and pie charts goptions device = win ; pattern v = solid color = gray ; proc gchart data = billion ; vbar region ; title Billionaires in 1992; Regions ; proc gchart data = billion ; pie region ; title Billionaires in 1992; Regions ; 7 8

15 SAS Analyst: Automating descriptive statististics and plots Use the following steps to get into Analyst from the menu: Solutions 17 When you have finished Be sure to exit from SAS using the File menu, and to log out of the computer using the icon on the desktop Analysis Analyst You must specify which dataset you wish to use Do so by clicking File Open by SAS name Work library (double click) Billion (double click) To get a bar chart of the counts of how many billionaires are from each region, select Graphs/Barchart/Vertical Then click on REGION and then on Chart to indicate that the region variable is the one you want graphed Click OK Then click on Options, check off Bars for each discrete level, and click OK Then click OK again To get a numeric and graphical summary of the values of the wealth variable, select Statistics/Descriptive/Distributions Click WLTH, then Analysis / plots Check off the types of plots you want 16 Printing and Saving Files Copying output from SAS windows into Microsoft Word will enable you to edit the SAS output and incorporate it into your homework writeups You can then print from Word When you highlight a block of text in the SAS output window in order to copy it, do not highlight all the way to the right margin of the last line Due to a bug in SAS, that prevents the copy from working To save a file, click in the window whose contents you want to save Go to the file menu and choose Save as SAS will automatically give the file extension sas to SAS commands and programs For example, to name a SAS program myprog, you would type a:myprog in the box for the name of the file If you re running SAS on the Virtual Desktop and want to save a program for future use, an option is to copy and paste your SAS code into a text document on the computer on which you re working, and save the text document Then at your next SAS session, you can bring up the text document and copy and paste the code into the SAS program editor window 9 10