SAS Training Spring 2006

Size: px
Start display at page:

Download "SAS Training Spring 2006"

Transcription

1 SAS Training Spring 2006 Coxe/Maner/Aiken Introduction to SAS: This is what SAS looks like when you first open it: There is a Log window on top; this will let you know what SAS is doing and if SAS encountered any errors or problems with your syntax. (In this class, you will be asked to print out the Log file as well as the Output for your homework if you use SAS.) The lower window is called the Editor; this is where you will edit your syntax. You can see that there is also a bar at the bottom for a window called Output, which will contain (surprise!) the output of any analyses that you run. Right now it doesn t contain anything because we haven t run any analyses.

2 Opening, editing, and saving syntax: As in SPSS, you can open saved syntax files (which have extension.sas) or type syntax directly into the Editor window. To open a saved.sas file, select File then Open, find your file on the computer and select it, and click Open. Similarly, to save a syntax file you have written or edited, select File then Save As

3 Running syntax: The syntax file looks like this when it has been opened. To run the syntax, select it and press the little running man icon ( ) on the right side of the toolbar or select Run then Submit from the pull-down menus.

4 After running the syntax: Now you can see the output (SAS has selected the Output window to be in the front). This will contain all of your output except graphs (which are in a new window called Graph1 that you can select from the window bar at the bottom of SAS, see arrow). You can scroll through the output using the scroll bar at the right, or using the Page Up and Page Down keys on the keyboard. You can cycle through the graphs (there are 2 of them in this example) the same way.

5 Printing SAS output and graphs: When you print the Output, all pages of the output will be printed at once. They are often formatted oddly and use up a lot of pages. It is usually easier to select all of the output and copy and paste it into a word processing program (like Microsoft Word), so you can adjust the margins and page orientation to make the output fit better on the pages (and save a few trees). When you print from the graphs window, only the visible graph will be printed. This is very important! If there are several graphs from your analysis, you will have to scroll through, selecting and printing each one. Here is what it looks like when you first select the Graph window. This is the first graph, a histogram. From here, you can select File then Print to print this graph. Remember that even though there are several graphs in this analysis, SAS will only print the one you are looking at.

6 To print the second graph, use the Page Down button or the scroll bar to show the second graph, which is a scatterplot. Select File then Print to print the second graph.

7 General Syntax and Other Rules SAS is not case-sensitive. It does not differentiate between upper and lowercase. Always include a after each block of code. This enables you to run particular blocks of code within your program, as opposed to running the whole program each time. Remember, SAS will not execute a command unless it is followed by a RUN. Always include a semicolon after each line of code. When debugging your program, always check first to make sure that you did not omit a semi-colon. Four times out of five, that will be the problem. For each procedure (proc) include the name of the dataset for which you want the procedure run (data=yourdata). This is important when you have multiple datasets open in SAS. Use comments frequently. They will help you greatly when you return to a program after spending time away from it. There are 2 ways to include a comment in your program. The first is simply to place an asterisk (*) at the beginning of the line. When it sees an asterisk, SAS will ignore everything until it reaches semicolon. The other way is to place a forward slash and asterisk (/*) at the beginning of the line. When SAS sees this it will ignore everything (including semi-colons) until it reaches an asterisk and slash (*/). This second method of commenting is useful if you want to make SAS ignore a large block of code that includes semicolons. See examples of both methods in the program at the end of the handout. Use titles they will help you organize your output. Remember that titles are always enclosed within single quotation marks. You may use several titles and layer them (title, title2, title3, etc.) Each subsequent title will appear under the one before it. To replace a title simply use a new title line with the new title you want it will automatically overwrite the old one. To get ride of a title line simply put the title line with no title (e.g., title2; ). Data-related Syntax The datastep is the portion of your program in which you read in data from an external file. It consists of a DATA statement, which names your working dataset within SAS, an INFILE statement that tells SAS where your external file is and what it is named, and an INPUT statement, which tells SAS what variables to read in, and what columns each variable is located in. Note that variable names and dataset names cannot exceed 8 characters. You may read in alphanumeric data (contains both letters and numbers) by designating a variable as a string variable. You do this by including a dollar sign ($) after the variable name, and before the column designation (e.g., SEX $ 1-4). There are many ways to manage and manipulate your data in SAS. You can sort your data (using the SORT statement), merge different datasets (using the MERGE statement), create sub-datasets (using the DATA and SET statements), and print your data in the output (using the PROC PRINT command). Examples and explanations are included within the sample program.

8 TITLE 'FALL 93 GRADES, SAS PSY531(ex1.sas)'; TITLE2 Regression Class Example 1 ; OPTIONS NOCENTER LINESIZE=80 PAGESIZE=44; ** Here comes the datastep. Notice that I am using comments to annotate this program; DATA grades; INFILE 'a:\grade230.txt'; INPUT id 2-3 sex 8 T PS1 34 PS2 36 PS3 38 PS4 40 PS5 42 PS6 44 PS7 46 T PS8 51 PS9 53 T PS10 59 PS11 61 PS12 63 PS13 65 T ; LABEL t1='test 1' t2='test 2' t3='test 3' t4='test 4'; ** Notice that I just put a RUN after the datastep include a run after each block of code; /* If the variable sex contained letters (male, fem instead of 1,2) we would need to designate it as a string variable. See the following code: INPUT id 2-3 sex $ 8-12 ; Notice also that I ve used the second method for commenting here. SAS ignores Everything it just saw until it sees the star slash */ * Always use PROC PRINT to look at your data, making sure it has been read in properly; PROC PRINT DATA=grades; * Here we create value labels with PROC FORMAT; PROC FORMAT DATA=grades; VALUE gender 1='Male' 2='Female'; * Here we use PROC FREQ to get frequencies for the different values of sex; * Note that PROC FREQ requires the use of TABLES to designate the variables you want frequencies for; * Note also that we use the FORMAT statement to include value labels in the output; PROC FREQ DATA=grades; TABLES sex; FORMAT sex gender.; /* PROC FREQ can also give you cross tabulations. Imagine that you had a variable called COND (condition), and you wanted to know how many males and females were in each condition. You could use the following code PROC FREQ DATA=grades; TABLES cond*sex; */ * PROC UNIVARIATE supplies univariate statistics. Use the VAR command to tell SAS what variables you want stats for. Most procedures use the VAR command;

9 PROC UNIVARIATE DATA=grades; VAR t3 t4; * Using PROC FREQ to get frequency distributions for tests 3 and 4; PROC FREQ DATA=grades; TABLES t3 t4; *Using proc gchart and gplot to make charts and scatterplots; *Note the use of title3 SAS will place this under your first two titles; PROC GCHART DATA=grades; VBAR t3; TITLE3 'Historgram of test 3'; PROC GPLOT DATA=grades; PLOT t4 * t3; TITLE3 'Scatterplot of test 4 against test 3'; *Let s turn off the title3; TITLE3; *PROC CORR generates a correlation matrix of the variables you specify; * it also supplies means and standard deviations for these variables; PROC CORR DATA=grades; VARIABLES T1 T2 T3 T4; * Note the NOMISS keyword in the next correlation procedure this requests casewise/listwise deletion of missing data; PROC CORR DATA=GRADES NOMISS; VARIABLES t1 t2 t3 t4; *Using the DATA and SET commands to add or recode variables, and to create subdatasets; * First create a new dataset called GRADES2, and recode females from a 2 to a 0; DATA grades2; SET grades; IF sex=2 THEN sex=0; * Create 2 subdatasets one for males and one for females; DATA female; SET grades2; If sex=0; DATA male; SET grades2; If sex=1;

10 * Create a new dataset, grades3, that contains only each person s sex and their test scores use KEEP= ; * Note that KEEP immediately follows SET, no semi-colon in between; DATA grades3; SET grades2 (KEEP = sex t1 t2 t3 t4); * PROC SORT is very useful it allows you to run separate analysis for subsets of your data without creating separate datasets. You must first sort by the variable, the values for which you want separate analysis. In the following example I sort by sex, then request means (and SDs) for the 4 test grades, for males and females separately. This procedure generalizes to many procedures (e.g., running separate regression analyses for males and females; PROC SORT DATA=grades2; BY sex; PROC MEANS DATA=grades; VAR t1 t2 t3 t4; BY sex; * Alternatively, I could have requested means for the sex-specific datasets I created earlier; PROC MEANS DATA=male; VAR t1 t2 t3 t4; PROC MEANS DATA=female; VAR t1 t2 t3 t4; * Merging 2 datasets Imagine that when you entered your data, you had 2 research assistants entering 2 different questionnaires (from the same set of subjects) into separate data files. You could read them in separately, and then merge them into a single dataset in SAS using the MERGE statement. You must have a common case identification variable in both datasets you will use that variable to identify subjects. You must sort both datasets by the case id variable. You then create a new dataset that combines the originals. Be careful, if you have variables that are named the same in each dataset, variables will overwrite each other. The following is an example; DATA ques1; INFILE a:\ questionnaire1.txt ; INPUT id 1-3 q1 4 q2 5 q3 6 q4 7 q5 8; DATA ques2; INFILE a:\ questionnaire2.txt ; INPUT id 1-3 q6 4 q7 5 q8 6 q9 7 q10 8; PROC SORT DATA=ques1; BY id; PROC SORT DATA=ques2; BY id; DATA combined; MERGE ques1 ques2; BY ID; * Writing out an ascii dataset from SAS with the PUT statement. If you want to write out a dataset (or part of one), you can use the following code. The following code writes out a file called NEWDATA with all 10 questionnaire items. The output file will have the suffix.dat. Once you have run the code, check the LOG to see where SAS put the file (usually in the SAS folder in PROGRAM FILES on your C: drive). DATA outfile; SET combined; FILE newdata; id 1-3 q1 4 q2 5 q3 6 q4 7 q5 8 q6 9 q7 10 q8 11 q9 12 q10 13;

STAT 7000: Experimental Statistics I

STAT 7000: Experimental Statistics I STAT 7000: Experimental Statistics I 2. A Short SAS Tutorial Peng Zeng Department of Mathematics and Statistics Auburn University Fall 2009 Peng Zeng (Auburn University) STAT 7000 Lecture Notes Fall 2009

More information

Epidemiology Principles of Biostatistics Chapter 3. Introduction to SAS. John Koval

Epidemiology Principles of Biostatistics Chapter 3. Introduction to SAS. John Koval Epidemiology 9509 Principles of Biostatistics Chapter 3 John Koval Department of Epidemiology and Biostatistics University of Western Ontario What we will do today We will learn to use use SAS to 1. read

More information

Chapter 2 The SAS Environment

Chapter 2 The SAS Environment Chapter 2 The SAS Environment Abstract In this chapter, we begin to become familiar with the basic SAS working environment. We introduce the basic 3-screen layout, how to navigate the SAS Explorer window,

More information

STAT 3304/5304 Introduction to Statistical Computing. Introduction to SAS

STAT 3304/5304 Introduction to Statistical Computing. Introduction to SAS STAT 3304/5304 Introduction to Statistical Computing Introduction to SAS What is SAS? SAS (originally an acronym for Statistical Analysis System, now it is not an acronym for anything) is a program designed

More information

Introduction to SAS: General

Introduction to SAS: General Spring 2019 CJ Anderson Introduction to SAS: General Go to course web-site and click on hsb-datasas There are 5 main working environments (windows) in SAS: Explorer window: Lets you view data in SAS data

More information

1. Basic Steps for Data Analysis Data Editor. 2.4.To create a new SPSS file

1. Basic Steps for Data Analysis Data Editor. 2.4.To create a new SPSS file 1 SPSS Guide 2009 Content 1. Basic Steps for Data Analysis. 3 2. Data Editor. 2.4.To create a new SPSS file 3 4 3. Data Analysis/ Frequencies. 5 4. Recoding the variable into classes.. 5 5. Data Analysis/

More information

Lecture 1 Getting Started with SAS

Lecture 1 Getting Started with SAS SAS for Data Management, Analysis, and Reporting Lecture 1 Getting Started with SAS Portions reproduced with permission of SAS Institute Inc., Cary, NC, USA Goals of the course To provide skills required

More information

Introductory Guide to SAS:

Introductory Guide to SAS: Introductory Guide to SAS: For UVM Statistics Students By Richard Single Contents 1 Introduction and Preliminaries 2 2 Reading in Data: The DATA Step 2 2.1 The DATA Statement............................................

More information

SAS PROGRAMMING AND APPLICATIONS (STAT 5110/6110): FALL 2015 Module 2

SAS PROGRAMMING AND APPLICATIONS (STAT 5110/6110): FALL 2015 Module 2 SAS PROGRAMMING AND APPLICATIONS (STAT 5110/6110): FALL 2015 Department of MathemaGcs and StaGsGcs Phone: 4-3620 Office: Parker 364- A E- mail: carpedm@auburn.edu Web: hup://www.auburn.edu/~carpedm/stat6110

More information

Lab #3. Viewing Data in SAS. Tables in SAS. 171:161: Introduction to Biostatistics Breheny

Lab #3. Viewing Data in SAS. Tables in SAS. 171:161: Introduction to Biostatistics Breheny 171:161: Introduction to Biostatistics Breheny Lab #3 The focus of this lab will be on using SAS and R to provide you with summary statistics of different variables with a data set. We will look at both

More information

PART I: USING SAS FOR THE PC AN OVERVIEW 1.0 INTRODUCTION

PART I: USING SAS FOR THE PC AN OVERVIEW 1.0 INTRODUCTION PART I: USING SAS FOR THE PC AN OVERVIEW 1.0 INTRODUCTION The statistical package SAS (Statistical Analysis System) is a large computer program specifically designed to do statistical analyses. It is very

More information

Introduction to SAS. I. Understanding the basics In this section, we introduce a few basic but very helpful commands.

Introduction to SAS. I. Understanding the basics In this section, we introduce a few basic but very helpful commands. Center for Teaching, Research and Learning Research Support Group American University, Washington, D.C. Hurst Hall 203 rsg@american.edu (202) 885-3862 Introduction to SAS Workshop Objective This workshop

More information

EXAMPLE 2: INTRODUCTION TO SAS AND SOME NOTES ON HOUSEKEEPING PART II - MATCHING DATA FROM RESPONDENTS AT 2 WAVES INTO WIDE FORMAT

EXAMPLE 2: INTRODUCTION TO SAS AND SOME NOTES ON HOUSEKEEPING PART II - MATCHING DATA FROM RESPONDENTS AT 2 WAVES INTO WIDE FORMAT EXAMPLE 2: PART I - INTRODUCTION TO SAS AND SOME NOTES ON HOUSEKEEPING PART II - MATCHING DATA FROM RESPONDENTS AT 2 WAVES INTO WIDE FORMAT USING THESE WORKSHEETS For each of the worksheets you have a

More information

Intermediate SAS: Working with Data

Intermediate SAS: Working with Data Intermediate SAS: Working with Data OIT Technical Support Services 293-4444 oithelp@mail.wvu.edu oit.wvu.edu/training/classmat/sas/ Table of Contents Getting set up for the Intermediate SAS workshop:...

More information

ST Lab 1 - The basics of SAS

ST Lab 1 - The basics of SAS ST 512 - Lab 1 - The basics of SAS What is SAS? SAS is a programming language based in C. For the most part SAS works in procedures called proc s. For instance, to do a correlation analysis there is proc

More information

Introduction (SPSS) Opening SPSS Start All Programs SPSS Inc SPSS 21. SPSS Menus

Introduction (SPSS) Opening SPSS Start All Programs SPSS Inc SPSS 21. SPSS Menus Introduction (SPSS) SPSS is the acronym of Statistical Package for the Social Sciences. SPSS is one of the most popular statistical packages which can perform highly complex data manipulation and analysis

More information

Introductory SAS example

Introductory SAS example Introductory SAS example STAT:5201 1 Introduction SAS is a command-driven statistical package; you enter statements in SAS s language, submit them to SAS, and get output. A fairly friendly user interface

More information

Depending on the computer you find yourself in front of, here s what you ll need to do to open SPSS.

Depending on the computer you find yourself in front of, here s what you ll need to do to open SPSS. 1 SPSS 11.5 for Windows Introductory Assignment Material covered: Opening an existing SPSS data file, creating new data files, generating frequency distributions and descriptive statistics, obtaining printouts

More information

You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables

You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables Jennie Murack You will learn: The structure of the Stata interface How to open files in Stata How to modify variable and value labels How to manipulate variables How to conduct basic descriptive statistics

More information

Using an ICPSR set-up file to create a SAS dataset

Using an ICPSR set-up file to create a SAS dataset Using an ICPSR set-up file to create a SAS dataset Name library and raw data files. From the Start menu, launch SAS, and in the Editor program, write the codes to create and name a folder in the SAS permanent

More information

Introduction to SAS. Cristina Murray-Krezan Research Assistant Professor of Internal Medicine Biostatistician, CTSC

Introduction to SAS. Cristina Murray-Krezan Research Assistant Professor of Internal Medicine Biostatistician, CTSC Introduction to SAS Cristina Murray-Krezan Research Assistant Professor of Internal Medicine Biostatistician, CTSC cmurray-krezan@salud.unm.edu 20 August 2018 What is SAS? Statistical Analysis System,

More information

Creating a data file and entering data

Creating a data file and entering data 4 Creating a data file and entering data There are a number of stages in the process of setting up a data file and analysing the data. The flow chart shown on the next page outlines the main steps that

More information

Introduction. How to Use this Document. What is SAS? Launching SAS. Windows in SAS for Windows. Research Technologies at Indiana University

Introduction. How to Use this Document. What is SAS? Launching SAS. Windows in SAS for Windows. Research Technologies at Indiana University Research Technologies at Indiana University Introduction How to Use this Document This document is an introduction to SAS for Windows. SAS is a large software package with scores of modules and utilities.

More information

A Step by Step Guide to Learning SAS

A Step by Step Guide to Learning SAS A Step by Step Guide to Learning SAS 1 Objective Familiarize yourselves with the SAS programming environment and language. Learn how to create and manipulate data sets in SAS and how to use existing data

More information

Easing into Data Exploration, Reporting, and Analytics Using SAS Enterprise Guide

Easing into Data Exploration, Reporting, and Analytics Using SAS Enterprise Guide Paper 809-2017 Easing into Data Exploration, Reporting, and Analytics Using SAS Enterprise Guide ABSTRACT Marje Fecht, Prowerk Consulting Whether you have been programming in SAS for years, are new to

More information

PHPM 672/677 Lab #2: Variables & Conditionals Due date: Submit by 11:59pm Monday 2/5 with Assignment 2

PHPM 672/677 Lab #2: Variables & Conditionals Due date: Submit by 11:59pm Monday 2/5 with Assignment 2 PHPM 672/677 Lab #2: Variables & Conditionals Due date: Submit by 11:59pm Monday 2/5 with Assignment 2 Overview Most assignments will have a companion lab to help you learn the task and should cover similar

More information

INTRODUCTION TO SAS STAT 525 FALL 2013

INTRODUCTION TO SAS STAT 525 FALL 2013 INTRODUCTION TO SAS STAT 525 FALL 2013 Statistical analyses, in practice, are always carried out by computer software In this class, I will focus on the use of SAS to perform these analyses, specifically

More information

A Guided Tour Through the SAS Windowing Environment Casey Cantrell, Clarion Consulting, Los Angeles, CA

A Guided Tour Through the SAS Windowing Environment Casey Cantrell, Clarion Consulting, Los Angeles, CA A Guided Tour Through the SAS Windowing Environment Casey Cantrell, Clarion Consulting, Los Angeles, CA ABSTRACT The SAS system running in the Microsoft Windows environment contains a multitude of tools

More information

Lab #1: Introduction to Basic SAS Operations

Lab #1: Introduction to Basic SAS Operations Lab #1: Introduction to Basic SAS Operations Getting Started: OVERVIEW OF SAS (access lab pages at http://www.stat.lsu.edu/exstlab/) There are several ways to open the SAS program. You may have a SAS icon

More information

IBMSPSSSTATL1P: IBM SPSS Statistics Level 1

IBMSPSSSTATL1P: IBM SPSS Statistics Level 1 SPSS IBMSPSSSTATL1P IBMSPSSSTATL1P: IBM SPSS Statistics Level 1 Version: 4.4 QUESTION NO: 1 Which statement concerning IBM SPSS Statistics application windows is correct? A. At least one Data Editor window

More information

(on CQUEST) A.L. Gibbs

(on CQUEST) A.L. Gibbs STA 302 / 1001 Introduction to SAS for Regression (on CQUEST) A.L. Gibbs September 2007 1 Some Basics of CQUEST The operating system in the ESC lab (1046) is Linux. The operating system in the RW labs

More information

Basic concepts and terms

Basic concepts and terms CHAPTER ONE Basic concepts and terms I. Key concepts Test usefulness Reliability Construct validity Authenticity Interactiveness Impact Practicality Assessment Measurement Test Evaluation Grading/marking

More information

Mr. Kongmany Chaleunvong. GFMER - WHO - UNFPA - LAO PDR Training Course in Reproductive Health Research Vientiane, 22 October 2009

Mr. Kongmany Chaleunvong. GFMER - WHO - UNFPA - LAO PDR Training Course in Reproductive Health Research Vientiane, 22 October 2009 Mr. Kongmany Chaleunvong GFMER - WHO - UNFPA - LAO PDR Training Course in Reproductive Health Research Vientiane, 22 October 2009 1 Object of the Course Introduction to SPSS The basics of managing data

More information

Applied Regression Modeling: A Business Approach

Applied Regression Modeling: A Business Approach i Applied Regression Modeling: A Business Approach Computer software help: SAS code SAS (originally Statistical Analysis Software) is a commercial statistical software package based on a powerful programming

More information

(on CQUEST) A.L. Gibbs

(on CQUEST) A.L. Gibbs STA 302 / 1001 Introduction to SAS for Regression (on CQUEST) A.L. Gibbs September 2009 1 Some Basics of CQUEST The operating system in the RW labs (107/109 and 211) is Windows XP. There are a few terminals

More information

Dr. Barbara Morgan Quantitative Methods

Dr. Barbara Morgan Quantitative Methods Dr. Barbara Morgan Quantitative Methods 195.650 Basic Stata This is a brief guide to using the most basic operations in Stata. Stata also has an on-line tutorial. At the initial prompt type tutorial. In

More information

BIOL 417: Biostatistics Laboratory #3 Tuesday, February 8, 2011 (snow day February 1) INTRODUCTION TO MYSTAT

BIOL 417: Biostatistics Laboratory #3 Tuesday, February 8, 2011 (snow day February 1) INTRODUCTION TO MYSTAT BIOL 417: Biostatistics Laboratory #3 Tuesday, February 8, 2011 (snow day February 1) INTRODUCTION TO MYSTAT Go to the course Blackboard site and download Laboratory 3 MYSTAT Intro.xls open this file in

More information

DEPARTMENT OF HEALTH AND HUMAN SCIENCES HS900 RESEARCH METHODS

DEPARTMENT OF HEALTH AND HUMAN SCIENCES HS900 RESEARCH METHODS DEPARTMENT OF HEALTH AND HUMAN SCIENCES HS900 RESEARCH METHODS Using SPSS Topics addressed today: 1. Accessing data from CMR 2. Starting SPSS 3. Getting familiar with SPSS 4. Entering data 5. Saving data

More information

STAT:5400 Computing in Statistics

STAT:5400 Computing in Statistics STAT:5400 Computing in Statistics Introduction to SAS Lecture 18 Oct 12, 2015 Kate Cowles 374 SH, 335-0727 kate-cowles@uiowaedu SAS SAS is the statistical software package most commonly used in business,

More information

AURA ACADEMY SAS TRAINING. Opposite Hanuman Temple, Srinivasa Nagar East, Ameerpet,Hyderabad Page 1

AURA ACADEMY SAS TRAINING. Opposite Hanuman Temple, Srinivasa Nagar East, Ameerpet,Hyderabad Page 1 SAS TRAINING SAS/BASE BASIC THEORY & RULES ETC SAS WINDOWING ENVIRONMENT CREATION OF LIBRARIES SAS PROGRAMMING (BRIEFLY) - DATASTEP - PROC STEP WAYS TO READ DATA INTO SAS BACK END PROCESS OF DATASTEP INSTALLATION

More information

Some Basics of CQUEST

Some Basics of CQUEST Some Basics of CQUEST The operating system in RW labs (107/109 and 211) is Windows XP. There are a few terminals in RW 213 running Linux. SAS is run from a Linux Server. Your account is the same and files

More information

STA9750 Lecture I OUTLINE 1. WELCOME TO 9750!

STA9750 Lecture I OUTLINE 1. WELCOME TO 9750! STA9750 Lecture I OUTLINE 1. Welcome to STA9750! a. Blackboard b. Tentative syllabus c. Remote access to SAS 2. Introduction to reading data with SAS a. Manual input b. Reading from a text file c. Import

More information

Economics 145 Fall 2009 Howell Getting Started with Stata

Economics 145 Fall 2009 Howell Getting Started with Stata Getting Started with Stata This simple introduction to Stata will allow you to open a dataset and conduct some basic analyses similar to those that we have discussed in Excel. For those who would like

More information

There are 3 main windows, and 3 main types of files, in SPSS: Data, Syntax, and Output.

There are 3 main windows, and 3 main types of files, in SPSS: Data, Syntax, and Output. U6310 Quantitative Techniques Lab - September 2001 Intro to SPSS SPSS works like this: You have a data set (either you create one or use an existing file such as the GSS). You choose analysis techniques

More information

Contents of SAS Programming Techniques

Contents of SAS Programming Techniques Contents of SAS Programming Techniques Chapter 1 About SAS 1.1 Introduction 1.1.1 SAS modules 1.1.2 SAS module classification 1.1.3 SAS features 1.1.4 Three levels of SAS techniques 1.1.5 Chapter goal

More information

UNIT 4. Research Methods in Business

UNIT 4. Research Methods in Business UNIT 4 Preparing Data for Analysis:- After data are obtained through questionnaires, interviews, observation or through secondary sources, they need to be edited. The blank responses, if any have to be

More information

I Launching and Exiting Stata. Stata will ask you if you would like to check for updates. Update now or later, your choice.

I Launching and Exiting Stata. Stata will ask you if you would like to check for updates. Update now or later, your choice. I Launching and Exiting Stata 1. Launching Stata Stata can be launched in either of two ways: 1) in the stata program, click on the stata application; or 2) double click on the short cut that you have

More information

3. Almost always use system options options compress =yes nocenter; /* mostly use */ options ps=9999 ls=200;

3. Almost always use system options options compress =yes nocenter; /* mostly use */ options ps=9999 ls=200; Randy s SAS hints, updated Feb 6, 2014 1. Always begin your programs with internal documentation. * ***************** * Program =test1, Randy Ellis, first version: March 8, 2013 ***************; 2. Don

More information

Opening a Data File in SPSS. Defining Variables in SPSS

Opening a Data File in SPSS. Defining Variables in SPSS Opening a Data File in SPSS To open an existing SPSS file: 1. Click File Open Data. Go to the appropriate directory and find the name of the appropriate file. SPSS defaults to opening SPSS data files with

More information

SAS Online Training: Course contents: Agenda:

SAS Online Training: Course contents: Agenda: SAS Online Training: Course contents: Agenda: (1) Base SAS (6) Clinical SAS Online Training with Real time Projects (2) Advance SAS (7) Financial SAS Training Real time Projects (3) SQL (8) CV preparation

More information

Base and Advance SAS

Base and Advance SAS Base and Advance SAS BASE SAS INTRODUCTION An Overview of the SAS System SAS Tasks Output produced by the SAS System SAS Tools (SAS Program - Data step and Proc step) A sample SAS program Exploring SAS

More information

STATA 13 INTRODUCTION

STATA 13 INTRODUCTION STATA 13 INTRODUCTION Catherine McGowan & Elaine Williamson LONDON SCHOOL OF HYGIENE & TROPICAL MEDICINE DECEMBER 2013 0 CONTENTS INTRODUCTION... 1 Versions of STATA... 1 OPENING STATA... 1 THE STATA

More information

Your Name: Section: INTRODUCTION TO STATISTICAL REASONING Computer Lab #4 Scatterplots and Regression

Your Name: Section: INTRODUCTION TO STATISTICAL REASONING Computer Lab #4 Scatterplots and Regression Your Name: Section: 36-201 INTRODUCTION TO STATISTICAL REASONING Computer Lab #4 Scatterplots and Regression Objectives: 1. To learn how to interpret scatterplots. Specifically you will investigate, using

More information

Introduction to Stata: An In-class Tutorial

Introduction to Stata: An In-class Tutorial Introduction to Stata: An I. The Basics - Stata is a command-driven statistical software program. In other words, you type in a command, and Stata executes it. You can use the drop-down menus to avoid

More information

Stata: A Brief Introduction Biostatistics

Stata: A Brief Introduction Biostatistics Stata: A Brief Introduction Biostatistics 140.621 2005-2006 1. Statistical Packages There are many statistical packages (Stata, SPSS, SAS, Splus, etc.) Statistical packages can be used for Analysis Data

More information

User Services Spring 2008 OBJECTIVES Introduction Getting Help Instructors

User Services Spring 2008 OBJECTIVES  Introduction Getting Help  Instructors User Services Spring 2008 OBJECTIVES Use the Data Editor of SPSS 15.0 to to import data. Recode existing variables and compute new variables Use SPSS utilities and options Conduct basic statistical tests.

More information

Getting started with Minitab 14 for Windows

Getting started with Minitab 14 for Windows INFORMATION SYSTEMS SERVICES Getting started with Minitab 14 for Windows This document provides an introduction to the Minitab (Version 14) statistical package. AUTHOR: Information Systems Services, University

More information

General Guidelines: SAS Analyst

General Guidelines: SAS Analyst General Guidelines: SAS Analyst The Analyst application is a data analysis tool in SAS for Windows (version 7 and later) that provides easy access to basic statistical analyses using a point-and-click

More information

INTRODUCTION to. Program in Statistics and Methodology (PRISM) Daniel Blake & Benjamin Jones January 15, 2010

INTRODUCTION to. Program in Statistics and Methodology (PRISM) Daniel Blake & Benjamin Jones January 15, 2010 INTRODUCTION to Program in Statistics and Methodology (PRISM) Daniel Blake & Benjamin Jones January 15, 2010 While we are waiting Everyone who wishes to work along with the presentation should log onto

More information

Advanced Regression Analysis Autumn Stata 6.0 For Dummies

Advanced Regression Analysis Autumn Stata 6.0 For Dummies Advanced Regression Analysis Autumn 2000 Stata 6.0 For Dummies Stata 6.0 is the statistical software package we ll be using for much of this course. Stata has a number of advantages over other currently

More information

Introduction to Stata Toy Program #1 Basic Descriptives

Introduction to Stata Toy Program #1 Basic Descriptives Introduction to Stata 2018-19 Toy Program #1 Basic Descriptives Summary The goal of this toy program is to get you in and out of a Stata session and, along the way, produce some descriptive statistics.

More information

Reading data in SAS and Descriptive Statistics

Reading data in SAS and Descriptive Statistics P8130 Recitation 1: Reading data in SAS and Descriptive Statistics Zilan Chai Sep. 18 th /20 th 2017 Outline Intro to SAS (windows, basic rules) Getting Data into SAS Descriptive Statistics SAS Windows

More information

1 Introduction to Using Excel Spreadsheets

1 Introduction to Using Excel Spreadsheets Survey of Math: Excel Spreadsheet Guide (for Excel 2007) Page 1 of 6 1 Introduction to Using Excel Spreadsheets This section of the guide is based on the file (a faux grade sheet created for messing with)

More information

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL We have spent the first part of the course learning Excel: importing files, cleaning, sorting, filtering, pivot tables and exporting

More information

Statements with the Same Function in Multiple Procedures

Statements with the Same Function in Multiple Procedures 67 CHAPTER 3 Statements with the Same Function in Multiple Procedures Overview 67 Statements 68 BY 68 FREQ 70 QUIT 72 WEIGHT 73 WHERE 77 Overview Several statements are available and have the same function

More information

April 4, SAS General Introduction

April 4, SAS General Introduction PP 105 Spring 01-02 April 4, 2002 SAS General Introduction TA: Kanda Naknoi kanda@stanford.edu Stanford University provides UNIX computing resources for its academic community on the Leland Systems, which

More information

Chapter One: Getting Started With IBM SPSS for Windows

Chapter One: Getting Started With IBM SPSS for Windows Chapter One: Getting Started With IBM SPSS for Windows Using Windows The Windows start-up screen should look something like Figure 1-1. Several standard desktop icons will always appear on start up. Note

More information

DSCI 325: Handout 9 Sorting and Options for Printing Data in SAS Spring 2017

DSCI 325: Handout 9 Sorting and Options for Printing Data in SAS Spring 2017 DSCI 325: Handout 9 Sorting and Options for Printing Data in SAS Spring 2017 There are a handful of statements (TITLE, FOOTNOTE, WHERE, BY, etc.) that can be used in a wide variety of procedures. For example,

More information

4. Descriptive Statistics: Measures of Variability and Central Tendency

4. Descriptive Statistics: Measures of Variability and Central Tendency 4. Descriptive Statistics: Measures of Variability and Central Tendency Objectives Calculate descriptive for continuous and categorical data Edit output tables Although measures of central tendency and

More information

R syntax guide. Richard Gonzalez Psychology 613. August 27, 2015

R syntax guide. Richard Gonzalez Psychology 613. August 27, 2015 R syntax guide Richard Gonzalez Psychology 613 August 27, 2015 This handout will help you get started with R syntax. There are obviously many details that I cannot cover in these short notes but these

More information

Maximizing Statistical Interactions Part II: Database Issues Provided by: The Biostatistics Collaboration Center (BCC) at Northwestern University

Maximizing Statistical Interactions Part II: Database Issues Provided by: The Biostatistics Collaboration Center (BCC) at Northwestern University Maximizing Statistical Interactions Part II: Database Issues Provided by: The Biostatistics Collaboration Center (BCC) at Northwestern University While your data tables or spreadsheets may look good to

More information

Introduction. About this Document. What is SPSS. ohow to get SPSS. oopening Data

Introduction. About this Document. What is SPSS. ohow to get SPSS. oopening Data Introduction About this Document This manual was written by members of the Statistical Consulting Program as an introduction to SPSS 12.0. It is designed to assist new users in familiarizing themselves

More information

2. Don t forget semicolons and RUN statements The two most common programming errors.

2. Don t forget semicolons and RUN statements The two most common programming errors. Randy s SAS hints March 7, 2013 1. Always begin your programs with internal documentation. * ***************** * Program =test1, Randy Ellis, March 8, 2013 ***************; 2. Don t forget semicolons and

More information

IPUMS Training and Development: Requesting Data

IPUMS Training and Development: Requesting Data IPUMS Training and Development: Requesting Data IPUMS PMA Exercise 2 OBJECTIVE: Gain an understanding of how IPUMS PMA service delivery point datasets are structured and how it can be leveraged to explore

More information

SPSS QM II. SPSS Manual Quantitative methods II (7.5hp) SHORT INSTRUCTIONS BE CAREFUL

SPSS QM II. SPSS Manual Quantitative methods II (7.5hp) SHORT INSTRUCTIONS BE CAREFUL SPSS QM II SHORT INSTRUCTIONS This presentation contains only relatively short instructions on how to perform some statistical analyses in SPSS. Details around a certain function/analysis method not covered

More information

Key Strokes To make a histogram or box-and-whisker plot: (Using canned program in TI)

Key Strokes To make a histogram or box-and-whisker plot: (Using canned program in TI) Key Strokes To make a histogram or box-and-whisker plot: (Using canned program in TI) 1. ing Data: To enter the variable, use the following keystrokes: Press STAT (directly underneath the DEL key) Leave

More information

Chapter 1: Introduction to SAS

Chapter 1: Introduction to SAS Chapter 1: Introduction to SAS SAS programs: A sequence of statements in a particular order. Rules for SAS statements: 1. Every SAS statement ends in a semicolon!!!; 2. Upper/lower case does not matter

More information

ECONOMICS 351* -- Stata 10 Tutorial 1. Stata 10 Tutorial 1

ECONOMICS 351* -- Stata 10 Tutorial 1. Stata 10 Tutorial 1 TOPIC: Getting Started with Stata Stata 10 Tutorial 1 DATA: auto1.raw and auto1.txt (two text-format data files) TASKS: Stata 10 Tutorial 1 is intended to introduce (or re-introduce) you to some of the

More information

ECLT 5810 SAS Programming - Introduction

ECLT 5810 SAS Programming - Introduction ECLT 5810 SAS Programming - Introduction Why SAS? Able to process data set(s). Easy to handle multiple variables. Generate useful basic analysis Summary statistics Graphs Many companies and government

More information

TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT

TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT PRIMER FOR ACS OUTCOMES RESEARCH COURSE: TYPES OF VARIABLES, STRUCTURE OF DATASETS, AND BASIC STATA LAYOUT STEP 1: Install STATA statistical software. STEP 2: Read through this primer and complete the

More information

1 Downloading files and accessing SAS. 2 Sorting, scatterplots, correlation and regression

1 Downloading files and accessing SAS. 2 Sorting, scatterplots, correlation and regression Statistical Methods and Computing, 22S:30/105 Instructor: Cowles Lab 2 Feb. 6, 2015 1 Downloading files and accessing SAS. We will be using the billion.dat dataset again today, as well as the OECD dataset

More information

Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State University.

Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State University. Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State University Spring 2000 This is a brief guide to using SPSS in the Macintosh

More information

Homework 1 Excel Basics

Homework 1 Excel Basics Homework 1 Excel Basics Excel is a software program that is used to organize information, perform calculations, and create visual displays of the information. When you start up Excel, you will see the

More information

WORKSHOP: Using the Health Survey for England, 2014

WORKSHOP: Using the Health Survey for England, 2014 WORKSHOP: Using the Health Survey for England, 2014 There are three sections to this workshop, each with a separate worksheet. The worksheets are designed to be accessible to those who have no prior experience

More information

WELCOME! Lecture 3 Thommy Perlinger

WELCOME! Lecture 3 Thommy Perlinger Quantitative Methods II WELCOME! Lecture 3 Thommy Perlinger Program Lecture 3 Cleaning and transforming data Graphical examination of the data Missing Values Graphical examination of the data It is important

More information

Chapter 2 Assignment (due Thursday, April 19)

Chapter 2 Assignment (due Thursday, April 19) (due Thursday, April 19) Introduction: The purpose of this assignment is to analyze data sets by creating histograms and scatterplots. You will use the STATDISK program for both. Therefore, you should

More information

Lab #9: ANOVA and TUKEY tests

Lab #9: ANOVA and TUKEY tests Lab #9: ANOVA and TUKEY tests Objectives: 1. Column manipulation in SAS 2. Analysis of variance 3. Tukey test 4. Least Significant Difference test 5. Analysis of variance with PROC GLM 6. Levene test for

More information

SPSS 11.5 for Windows Assignment 2

SPSS 11.5 for Windows Assignment 2 1 SPSS 11.5 for Windows Assignment 2 Material covered: Generating frequency distributions and descriptive statistics, converting raw scores to standard scores, creating variables using the Compute option,

More information

SPSS Instructions and Guidelines PSCI 2300 Intro to Political Science Research Dr. Paul Hensel Last updated 10 March 2018

SPSS Instructions and Guidelines PSCI 2300 Intro to Political Science Research Dr. Paul Hensel Last updated 10 March 2018 SPSS Instructions and Guidelines PSCI 2300 Intro to Political Science Research Dr. Paul Hensel Last updated 10 March 2018 Table of Contents Introduction... 1 Accessing SPSS... 2 Possible Alternative: PSPP...

More information

Introduction to STATA

Introduction to STATA Introduction to STATA Duah Dwomoh, MPhil School of Public Health, University of Ghana, Accra July 2016 International Workshop on Impact Evaluation of Population, Health and Nutrition Programs Learning

More information

How to program with Matlab (PART 1/3)

How to program with Matlab (PART 1/3) Programming course 1 09/12/2013 Martin SZINTE How to program with Matlab (PART 1/3) Plan 0. Setup of Matlab. 1. Matlab: the software interface. - Command window - Command history - Section help - Current

More information

Course Code: SPSS19 Introduction to IBM SPSS Statistics

Course Code: SPSS19 Introduction to IBM SPSS Statistics Centre for Learning and Academic Development (CLAD) Technology Skills Development Team Course Code: SPSS19 Introduction to IBM SPSS Statistics www.intranet.birmingham.ac.uk/itskills An Introduction to

More information

The Very Basics of the R Interpreter

The Very Basics of the R Interpreter Chapter 2 The Very Basics of the R Interpreter OK, the computer is fired up. We have R installed. It is time to get started. 1. Start R by double-clicking on the R desktop icon. 2. Alternatively, open

More information

INSTRUCTIONS FOR USING MICROSOFT EXCEL PERFORMING DESCRIPTIVE AND INFERENTIAL STATISTICS AND GRAPHING

INSTRUCTIONS FOR USING MICROSOFT EXCEL PERFORMING DESCRIPTIVE AND INFERENTIAL STATISTICS AND GRAPHING APPENDIX INSTRUCTIONS FOR USING MICROSOFT EXCEL PERFORMING DESCRIPTIVE AND INFERENTIAL STATISTICS AND GRAPHING (Developed by Dr. Dale Vogelien, Kennesaw State University) ** For a good review of basic

More information

Excel Tips and FAQs - MS 2010

Excel Tips and FAQs - MS 2010 BIOL 211D Excel Tips and FAQs - MS 2010 Remember to save frequently! Part I. Managing and Summarizing Data NOTE IN EXCEL 2010, THERE ARE A NUMBER OF WAYS TO DO THE CORRECT THING! FAQ1: How do I sort my

More information

Introduction to Stata. Written by Yi-Chi Chen

Introduction to Stata. Written by Yi-Chi Chen Introduction to Stata Written by Yi-Chi Chen Center for Social Science Computation & Research 145 Savery Hall University of Washington Seattle, WA 98195 U.S.A (206)543-8110 September 2002 http://julius.csscr.washington.edu/pdf/stata.pdf

More information

Data-Analysis Exercise Fitting and Extending the Discrete-Time Survival Analysis Model (ALDA, Chapters 11 & 12, pp )

Data-Analysis Exercise Fitting and Extending the Discrete-Time Survival Analysis Model (ALDA, Chapters 11 & 12, pp ) Applied Longitudinal Data Analysis Page 1 Data-Analysis Exercise Fitting and Extending the Discrete-Time Survival Analysis Model (ALDA, Chapters 11 & 12, pp. 357-467) Purpose of the Exercise This data-analytic

More information

Writing Programs in SAS Data I/O in SAS

Writing Programs in SAS Data I/O in SAS Writing Programs in SAS Data I/O in SAS Statistics 135 Autumn 2005 Copyright c 2005 by Mark E. Irwin Writing SAS Programs Your SAS programs can be written in any text editor, though you will often want

More information

Step-by-Step Guide to Basic Genetic Analysis

Step-by-Step Guide to Basic Genetic Analysis Step-by-Step Guide to Basic Genetic Analysis Page 1 Introduction This document shows you how to clean up your genetic data, assess its statistical properties and perform simple analyses such as case-control

More information

Stata v 12 Illustration. First Session

Stata v 12 Illustration. First Session Launch Stata PC Users Stata v 12 Illustration Mac Users START > ALL PROGRAMS > Stata; or Double click on the Stata icon on your desktop APPLICATIONS > STATA folder > Stata; or Double click on the Stata

More information