Welcome to the Exciting World of ! Lessons to familiarize yourself with.

Slides:



Advertisements
Similar presentations
Summary Statistics/Simple Graphs in SAS/EXCEL/JMP.
Advertisements

1) Terms to Know 2) Starting an Office 97 Application 8) Finding a missing file 7)File Managment 4) Utilizing the Right Mouse Button 6) Using Help 3)
How to Import an Excel File Using the SAS Import Wizard SAS 9 for Windows.
The INFILE Statement Reading files into SAS from an outside source: A Very Useful Tool!
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Developing an Excel Application
Tutorial 8: Developing an Excel Application
Understanding Microsoft Excel
Introduction to SAS Programming Christina L. Ughrin Statistical Software Consulting Some notes pulled from SAS Programming I: Essentials Training.
Microsoft Word 2010 Lesson 1: Introduction to Word.
Welcome to Florida International University Online J.O.B.S. Link Applicant Tutorial.
Today: Run SAS programs on Saturn (UNIX tutorial) Runs SAS programs on the PC.
1 An Introduction to IBM SPSS PSY450 Experimental Psychology Dr. Dwight Hennessy.
Biostatistical Methods II PubH 6415 Spring PubH 6415 – Biostatistics I Instructor: Susan Telke (office hours: lecture.
Welcome to the Brookdale Community College Online Employment System Applicant Tutorial.
1 Chapter 7 Linear Programming Models Continued – file 7c.
Plots, Correlations, and Regression Getting a feel for the data using plots, then analyzing the data with correlations and linear regression.
Welcome to the Ivy Tech Community College Online Employment System Applicant Tutorial.
A Visual Introduction to PC SAS. Start SAS by double-clicking on the SAS icon...
1 Welcome to the Colgate University Online Employment System Applicant Tutorial.
Pet Fish and High Cholesterol in the WHI OS: An Analysis Example Joe Larson 5 / 6 / 09.
Graphing with Excel: Graphing Made Easy Mac 2008 Version.
Lesson 46: Using Information From the Web copy and paste information from a Web site print a Web page download information from a Web site customize Web.
Introduction to SAS Essentials Mastering SAS for Data Analytics
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Chapter Sixteen Starting the Data Analysis Winston Jackson and Norine Verberg Methods: Doing Social Research, 4e.
Welcome to the University of Florida Online Employment System Applicant Tutorial.
Welcome to the Alaska Statewide System Online Employment System Applicant Tutorial.
Welcome to the Southeastern Louisiana University’s Online Employment Site Applicant Tutorial!
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
Welcome to the University of West Florida Online Employment System Applicant Tutorial.
XP New Perspectives on Introducing Microsoft Office XP Tutorial 1 1 Introducing Microsoft Office XP Tutorial 1.
SAS Workshop Lecture 1 Lecturer: Annie N. Simpson, MSc.
Create Database Tables
PowerPoint. Basic Vocabulary Slide - Presentation - Slide layout – ► ► ► ► a single page in PowerPoint all the slides for a speech all the slides for.
Introduction to SAS BIO 226 – Spring Outline Windows and common rules Getting the data –The PRINT and CONTENT Procedures Manipulating the data.
4/22/2017 5:36 PM EViews Training Creating Workfiles.
LINDSEY BREWER CSSCR (CENTER FOR SOCIAL SCIENCE COMPUTATION AND RESEARCH) UNIVERSITY OF WASHINGTON September 17, 2009 Introduction to SPSS (Version 16)
To make a graph in Excel, first you have to highlight the data you want to graph. To do this, click and drag over the “blocks” you need. Be sure to include.
Microsoft Access Get a green book. Page AC 2 Define Access Define database.
15.1 Fundamentals of HTML.
SAS 介绍和举例 Presented by 经济实验教学中心 商务数据挖掘中心. Raw Data Read in Data Process Data (Create new variables) Output Data (Create SAS Dataset) Analyze Data Using.
Microsoft Access 2000 Presentation 2 Creating Databases Part I (Creating Tables)
← Select Exchange Once logged in. ↓ click Join Course Icon.
Productivity Programs Common Features and Commands.
Windows Tutorial Common Objects ACOS: 1, 4. Using the Taskbar 1. Using the taskbar, you can switch between open programs and between open documents within.
Chapter 1: Introduction to SAS  SAS programs: A sequence of statements in a particular order  Rules for SAS statements: –Every SAS statement ends in.
Welcome to Biology Class of 2014!! Your teacher is: Mrs. Linda Pellegrini This presentation will get you and your laptop ready for this coming year!
Introduction to Excel Editing Your Workbook.
ISU Basic SAS commands Laboratory No. 1 Computer Techniques for Biological Research Animal Science 500 Ken Stalder, Professor Department of Animal Science.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 EPIB 698E Lecture 1 Notes Instructor: Raul Cruz 7/9/13.
15.1 Fundamentals of HTML DeKalb County School System.
BMTRY 789 Lecture 11: Debugging Readings – Chapter 10 (3 rd Ed) from “The Little SAS Book” Lab Problems – None Homework Due – None Final Project Presentations.
11/25/2015Slide 1 Scripts are short programs that repeat sequences of SPSS commands. SPSS includes a computer language called Sax Basic for the creation.
Basics of Biostatistics for Health Research Session 1 – February 7 th, 2013 Dr. Scott Patten, Professor of Epidemiology Department of Community Health.
15.1 Fundamentals of HTML 2 assignments: 1st—complete the worksheet. 2nd—create your first HTML web page following the directions in this PowerPoint where.
1.Introduction to SPSS By: MHM. Nafas At HARDY ATI For HNDT Agriculture.
 Columns  Rows  Cells  Ranges  Cell addresses  Column headers  Row headers  Formulas  Spreadsheet.
Computing with SAS Software A SAS program consists of SAS statements. 1. The DATA step consists of SAS statements that define your data and create a SAS.
1 EPIB 698C Lecture 1 Instructor: Raul Cruz-Cano
SAS Programming Training Instructor:Greg Grandits TA: Textbooks:The Little SAS Book, 5th Edition Applied Statistics and the SAS Programming Language, 5.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
Based on Learning SAS by Example: A Programmer’s Guide Chapters 1 & 2
EXPLORING THE WINDOWS SECTION PART 1 MOAC Lesson 1.
Development Environment
PubH 6420 Introduction to SAS Programming
Adding Assignments and Learning Units to Your TSS Course
Chapter 1: Introduction to SAS
15.1 Fundamentals of HTML 2 assignments: 1—complete the worksheet
Presentation transcript:

Welcome to the Exciting World of ! Lessons to familiarize yourself with

Getting to Know SAS SAS is a computer program used to analyze data. In this course you will learn how to write programs for your data sets, run these programs, and interpret the output they produce.

Resources The tutorials that follow will help you learn how to use SAS for the various statistical analyses covered in this course. Other useful resources are: SAS Official Tutorial (available in an open SAS window under Help/Getting Started with SAS Software) The Little SAS Book: A Primer, 3 rd ed., by L. Delwiche & S. Slaughter, (2003) SAS Institute

Resources, cont. Applied Statistics and SAS Programming Language, 4 th ed., by R. Cody & J. Smith, (1997) Prentice-Hall Inc. UCLA Academic Technology Services South Dakota State SAS Tutorial Numerous online resources are also available through search engines, like Google

Let’s Get Started! Open your SAS program. If you do not have a shortcut to SAS on your desktop, you will most likely find SAS under Programs from your Start Menu. You may be asked if you would like to run the SAS tutorial. If you opt not to see this notice every time you open SAS, the tutorial can be reached at any time by clicking on Help/Getting Started with SAS Software.

SAS Tutorial

SAS Windows When you open SAS, you will see 5 main windows: Editor Log Output Explorer Results You can easily navigate between windows by clicking on the tabs along the bottom of the SAS window. Clicking on a tab will make that window active. Try it!

Editor Window The Editor Window is where you write the SAS programs. You can type your data sets directly into the Editor window, or you can import data from an outside source, such as Excel. You will see examples of SAS programs shortly.

SAS Windows: Editor

Log Window The log window displays messages such as notes, errors, and warnings about your programs. It is important to always check the log after you have submitted a program to SAS. NOTEs are simply comments about the programs. WARNINGs are sometimes of concern when running your programs. ERRORs will stop your program from running, and they provide important information about what needs to be fixed before you can continue with the analysis.

SAS Windows: Log

Output Window The Output window will display the results from your analyses as well as anything you explicitly tell SAS to print, such as a data set. The output window is currently empty, because we have not run any programs.

SAS Windows: Output

Explorer Window The Explorer window gives you access to all of your files and data sets. The current program and data sets you are working with are stored temporarily in a “Work” file, which can be accessed by clicking on the file cabinet icon “Libraries.” We will explore this in more depth later.

SAS Windows: Editor

Results Window The Results window systematically lists each section of your output, making it easy to search through your output. You can also use the results window to save or print selected portions of your output. Because we have not submitted any programs, our results section is currently empty.

SAS Windows: Results

SAS Programs Now that you are familiar with the general appearance of SAS windows, let’s get to the fun part: SAS programs! SAS programs consist of ordered statements, which tell SAS what you would like it to perform. The programming language may seem awkward at first, but after some practice you will become comfortable using it.

Statements SAS programs are made up of statements. Each statement is like a command to SAS, and each statement ends with a semicolon (;). This tells SAS that one statement has ended and another will begin. The following is an example of a program containing three statements. The first line tells SAS to do a univariate analysis on the data set called “example.” It is only going to run this analysis on the variable “height.”

Notice on the previous example that certain words were in blue. These are words that SAS considers “key words.” You will become familiar with these key words and the color-coding system in SAS. NOTE: SAS is NOT case sensitive. Some people type key words in CAPS for easier reading and organization, but it is not necessary. Feel free to find a system that works for you. Also, SAS does not require statements to be typed on separate lines. It is a common practice to give each statement its own line and to indent each statement after the first line of the program for better organization. Again, this is not necessary, but it generally makes your programs easier to read.

Comments Comments are statements that are ignored by SAS. They are very useful when organizing your data, because they can provide titles or headings throughout your code. They are set apart by either an asterisk at the beginning of the comment and a semicolon at the end, or by /* at the beginning and */ at the end:

Entering Data in SAS Before you can analyze data in SAS, you must first enter a data set to work with. This is done using a DATA step, which contains statements that do the following: 1.name your new data set 2.name each variable 3.tell SAS that you are inputting the data 4.input the values of the data. A semi-colon on the next line completes your data set.

Data Sets A SAS data set consists of rows and columns. Each row represents an individual unit (such as a person, plant, country, etc.) on which data was collected. Each column represents a variable which contains information about that experimental unit (such as gender, age, height, education, income, race, blood pressure, etc.)

Variable Names When inputting the variable names, put a $ after labels for categorical variables. This tells SAS that the variable is not quantitative. Variable names must start with a letter or underscore (_), and they can also contain numbers. Let’s try creating a simple data set!

The following program creates a data set called “example1” with five variables: clinic, diastolic blood pressure at 6 months, systolic blood pressure at 6 months, diastolic blood pressure at baseline, and systolic blood pressure at baseline. The program also creates a sixth variable called increase, depending on whether diastolic pressure was higher after six months than at baseline. The output is given a title, and then variables clinic, sbpbl, sbp6, and increase are printed in the output.

Type this program into SAS:

Running a Program You can run this program in multiple ways. The simplest is by clicking on the icon of the running man at the top of your toolbar (you will see the word “Submit” if you put your cursor over this icon). You can also right-click anywhere on your Editor window and select “Submit All.” If you would like to submit only a portion of your code, highlight the portion you would like to run, then either click on the running man icon or right- click in the editor window and select “Submit selection.” NOTE: You must submit your data set before you can analyze it. If you try to analyze a data set that has not been submitted, SAS will not be able to run the program.

Always Check Your Log! The first step after running a program is to check your log to make sure there are no warnings or error messages. If your program did not run, the log will give clues about why it had to stop. Take a look at your log.

The previous log shows no errors, and that means we are ready to look at our output. (Notice, now that you have printed your data set, you have something in your Results section with the title you gave it.) If your program did not run, or if there are Error messages in your log, compare your code to the sample code. You may have forgotten something as simple as a semi- colon at the end of a statement. Make appropriate changes and run it again.

Output After you created the data set, you also told SAS to perform the procedure (PROC) of printing certain variables from that data set. You should now see those variables in your output window. Take a look. Do you see them? Do you see the new variable, increase, you created? Notice the title you created at the top of the output.

Try Another One! Now that you’ve seen the basic format of a data set, try entering the following data set into SAS and printing the variables in your output. In addition, create a variable called resid for residency, where resid = ‘Y’ if the student is from MN, and ‘N’ if the student is not from MN. Try inputting the data set in SAS, run the program, and compare your results to the answer. Also, give your output a title.

Use these data for your data set (don’t forget to put a “$” after any categorical variables): genderagemarstatcreditsstate F23S15MN F21S15WI F22S9MN F35M2MN F22M13MN F25S13WI M20S13MN M26M15WI M27S5MN M23S14IA M21S14MN M29M15MN

Checklist Did your program run successfully? Did you: Check your log Remember a semi-colon after every statement Put a semi-colon on the following line after your last row of data See the next slide for sample code.

Sample Code for Data Set

Output of Variables

Now that you’ve seen the sample code, make any necessary adjustments to your code and re-run your program. The next section will show you how to save your code and output.

Saving SAS Programs To save a SAS program, while in the Editor window, click on File, Save As…Choose a location to save your file and a name for it. It will automatically be saved as a.sas file. After closing SAS, if you open that file, SAS will automatically start and your code will be in the Editor window.

Saving Code as a Text File Some of your homework assignments will require you to submit your SAS code. To do this, you will need to copy and paste your code into some type of text editor. Sometimes it is possible to simply copy and paste your code into Word; however this does not always work and it is not recommended. As an alternative, copy and paste your code into a simple text editor, like Notepad. From Notepad, recopy the text, then paste it into Word. You can then save your code as a Word document.

Example of Using Notepad and Word

Saving Output For your homework assignments you will also be asked to incorporate your output into write-ups on each problem. It is important to know how to save your output so that it can be used in a Word document. While in the output window, click on File, Save As…A window will pop-up. Change the file type from List to RTF. Create a name for your file and decide where to save it. Your output is now saved as a.rtf file, and it can be used in Word.

Save Output as a.RTF File

Now that you have seen the basic SAS set- up, you will learn how to use SAS for data analysis! We start with descriptive statistics, then move on to hypothesis testing.