Example1D.1.sas. * Procedures : ; * 1. print to show the dataset. ;

Size: px
Start display at page:

Download "Example1D.1.sas. * Procedures : ; * 1. print to show the dataset. ;"

Transcription

1 Example1D.1.sas * SAS example program 1D.1 ; * 1. Create a dataset called prob from the following data: ; * age prob lb ub ; * ; * ; * ; * ; * ; * 2. The age in the prob dataset is in months. Create a new dataset called ; * probyr with the age calculated in years. ; * Also calculate the midpoint of the confidence interval. ; * Procedures : ; * 1. print to show the dataset. ; * Data step statements : ; * 1. infile : to list the variable to be read ; * 2. datalines : to indicate that data is following. ; * 1. make a dataset called prob in the work library; data prob; input age prob lb ub; datalines; ; proc print data = prob; title "The PROB dataset"; * 2. read the prob dataset and make a new dataset with some changes; data probyr; set prob; age = age / 12; /* recode age to years */ midpoint = (lb+ub)/2; /* calculate the midpoint of lb and ub */ proc print data = probyr; title "The PROBYR dataset"; The PROB dataset Obs age prob lb ub The PROBYR dataset Obs age prob lb ub midpoint

2 Example1D.2.sas * SAS example program 1D.2 ; * 1. Create a dataset called AE from the following data: ; * subject Event Date ; * ; * ID361 Headache 03SEP2015 ; * ID312 Rash 15DEC2015 ; * ID223 Abdominal Pain 12FEB2016 ; * ID109 Constipation 30NOV2015 ; * ID211 Non-Fatal MI 08DEC2015 ; * ID361 Headache 22OCT2015 ; * ID141 Fatal MI 12DEC2015 ; * ID812 Non fatal MI 08NOV2015 ; * ID033 Dissyness 07OCT2015 ; * ID102 Head ache 17SEP2015 ; * 2. The data have been entered in "free-form" so that the adverse events ; * are not written consistently. Rewrite them so that they are ; * consistent. ; * Procedures : print and freq to show the data. ; * Data step statements : ; * 1. infile : to list the variable to be read ; * 2. datalines : to indicate that data is following. ; * 3. if then : for conditional processing. ; data ae; input subject $ Event $ Date date9.; datalines; ID361 Headache 03SEP2015 ID312 Rash 15DEC ID361 Head ache 17SEP2015 ; proc print data = ae; title "The AE dataset -- before correction"; format date date9.; proc freq data = ae; table Event; data ae; set ae; if event = "Non fatal MI" if event = "Head ache" if event = "Dissyness" then event = "Non-Fatal MI"; then event = "Headache"; then event = "Dizziness"; proc print data = ae; title "The AE dataset -- after correction"; format date date9.; proc freq data = ae; table Event;

3 The AE dataset - before correction Obs subject Event Date 1 ID361 Headache 03SEP ID312 Rash 15DEC ID223 Abdominal Pain 12FEB ID109 Constipation 30NOV ID211 Non Fatal MI 08DEC ID263 Headache 22OCT ID141 Fatal MI 12DEC ID812 Non fatal MI 08NOV ID033 Dissyness 07OCT ID361 Head ache 17SEP2015 Cumulative Cumulative Event Frequency Percent Frequency Percent Abdominal Pain Constipation Dissyness Fatal MI Head ache Headache Non fatal MI Non-Fatal MI Rash The AE dataset after correction Obs subject Event Date 1 ID361 Headache 03SEP ID312 Rash 15DEC ID223 Abdominal Pain 12FEB ID109 Constipation 30NOV ID211 Non Fatal MI 08DEC ID263 Headache 22OCT ID141 Fatal MI 12DEC ID812 Non Fatal MI 08NOV2015 Cumulative Cumulative Event Frequency Percent Frequency Percent Abdominal Pain Constipation Dizziness Fatal MI Headache Non-Fatal MI Rash ID033 Dizziness 07OCT ID361 Headache 17SEP2015

4 Example1D.3.sas * SAS example program 1D.3 ; * 1. Read the sashelp.class dataset and create a new dataset in the work ; * library called newclass. ; * Create a new variable called wt_kg holding the weight of each ; * student in kilograms. The original weight variable is in pounds. ; * 2. Calculate the mean and standard deviation of the weights in kilograms ; * for the male and female students separately. ; * Procedures : ; * 1. means to calculate the means and standard deviations ; * Statements in the data step : ; * 1. set : to read in the dataset ; * 2. = : to assign values to variables ; * 3. +,-,*,/ : arithmetic ; * 4. where : to subset data ; * 6. run : to execute all code currently in the execution buffer ; data work.newclass; set sashelp.class; wt_kg = weight / 2.2; proc means data = work.newclass; title "The CLASS dataset -- weights in kg, Females"; var wt_kg; where sex = "F"; proc means data = work.newclass; title "The CLASS dataset -- weights in kg, Males"; var wt_kg; where sex = "M"; The CLASS dataset weights in kg, Females Analysis Variable : wt_kg N Mean Std Dev Minimum Maximum The CLASS dataset weights in kg, Males Analysis Variable : wt_kg N Mean Std Dev Minimum Maximum

5 Example1D.4.sas * SAS example program 1D.4 ; * 1. From the sashelp.class dataset create two datasets, one with male ; * students and one with female students. ; * Datastep Statements : ; * 1. output : to write an observation to an output dataset ; * 2. if then : to decide if sex is male or female ; data males females; set sashelp.class; if sex = "M" then output males; else if sex = "F" then output females; proc print data = males; title "MALES"; proc print data = females; title "FEMALES"; MALES Obs Name Sex Age Height Weight 1 Alfred M Henry M James M Jeffrey M John M Philip M Robert M Ronald M Thomas M William M FEMALES Obs Name Sex Age Height Weight 1 Alice F Barbara F Carol F Jane F Janet F Joyce F Judy F Louise F Mary F

6 Example1D.5.sas * SAS example program 1D.5 ; * 1. Using a datastep read the sashelp.heart dataset and produce a new ; * dataset called newheart. ; * Create a new variable called agecat which 1 to represent those whose ; * ageatstart is less than 20, 2 to represent ageatstart greater than or ; * equal to 20 but less than 30, 3 to represent ageatstart greater than ; * or equal to 30 but less than 40, etc. ; * Procedures : ; * 1. freq to examine the new variable ; * Datastep Statements : ; * 1. set : to read the input dataset. ; * 2. if then : to decide the values of agecat. ; data newheart; set sashelp.heart; if ageatstart =. then agecat =.; else if ageatstart < 20 then agecat = 1; else if ageatstart < 30 then agecat = 2; else if ageatstart < 40 then agecat = 3; else if ageatstart < 50 then agecat = 4; else if ageatstart < 60 then agecat = 5; else if ageatstart < 70 then agecat = 6; else if ageatstart < 80 then agecat = 7; else if ageatstart < 90 then agecat = 8; else agecat = 9; proc freq data = newheart; table agecat; The Frequency Procedure Cumulative Cumulative agecat Frequency Percent Frequency Percent

Quality Control of Clinical Data Listings with Proc Compare

Quality Control of Clinical Data Listings with Proc Compare ABSTRACT Quality Control of Clinical Data Listings with Proc Compare Robert Bikwemu, Pharmapace, Inc., San Diego, CA Nicole Wallstedt, Pharmapace, Inc., San Diego, CA Checking clinical data listings with

More information

Ready To Become Really Productive Using PROC SQL? Sunil K. Gupta, Gupta Programming, Simi Valley, CA

Ready To Become Really Productive Using PROC SQL? Sunil K. Gupta, Gupta Programming, Simi Valley, CA PharmaSUG 2012 - Paper HW04 Ready To Become Really Productive Using PROC SQL? Sunil K. Gupta, Gupta Programming, Simi Valley, CA ABSTRACT Using PROC SQL, can you identify at least four ways to: select

More information

Using a HASH Table to Reference Variables in an Array by Name. John Henry King, Hopper, Arkansas

Using a HASH Table to Reference Variables in an Array by Name. John Henry King, Hopper, Arkansas PharmaSUG 2011 - Paper TT04 Using a HASH Table to Reference Variables in an Array by Name John Henry King, Hopper, Arkansas ABSTRACT Array elements are referenced by their index value using a constant,

More information

The Art of Defensive Programming: Coping with Unseen Data

The Art of Defensive Programming: Coping with Unseen Data INTRODUCTION Paper 1791-2018 The Art of Defensive Programming: Coping with Unseen Data Philip R Holland, Holland Numerics Limited, United Kingdom This paper discusses how you cope with the following data

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

Introduction to SQL 4/24/2017. University of Iowa SAS Users Group. 1. Introduction and basic uses 2. Joins and Views 3. Reporting examples

Introduction to SQL 4/24/2017. University of Iowa SAS Users Group. 1. Introduction and basic uses 2. Joins and Views 3. Reporting examples University of Iowa SAS Users Group 1. Introduction and basic uses 2. Joins and Views 3. Reporting examples 1 Patient Sex YOB Blood Type Visit # Weight Joe male 73 A+ 1 150 Joe male 73 A+ 2 153 Joe male

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

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

data Vote; /* Read a CSV file */ infile 'c:\users\yuen\documents\6250\homework\hw1\political.csv' dsd; input state $ Party $ Age; run;

data Vote; /* Read a CSV file */ infile 'c:\users\yuen\documents\6250\homework\hw1\political.csv' dsd; input state $ Party $ Age; run; Chapter 3 2. data Vote; /* Read a CSV file */ infile 'c:\users\yuen\documents\6250\homework\hw1\political.csv' dsd; input state $ Party $ Age; title "Listing of Vote data set"; /* compute frequencies for

More information

PRXChange: Accept No Substitutions Kenneth W. Borowiak, PPD, Inc.

PRXChange: Accept No Substitutions Kenneth W. Borowiak, PPD, Inc. CT-03 PRXChange: Accept No Substitutions Kenneth W. Borowiak, PPD, Inc. Abstract SAS provides a variety of functions for removing and replacing text, such as COMPRESS, TRANSLATE & TRANWRD. However, when

More information

ssh tap sas913 sas

ssh tap sas913 sas Fall 2010, STAT 430 SAS Examples SAS9 ===================== ssh abc@glue.umd.edu tap sas913 sas https://www.statlab.umd.edu/sasdoc/sashtml/onldoc.htm a. Reading external files using INFILE and INPUT (Ch

More information

INTRODUCTION SAS Prepared by A. B. Billings West Virginia University May 1999 (updated August 2006)

INTRODUCTION SAS Prepared by A. B. Billings West Virginia University May 1999 (updated August 2006) INTRODUCTION To SAS Prepared by A. B. Billings West Virginia University May 1999 (updated August 2006) 1 Getting Started with SAS SAS stands for Statistical Analysis System. SAS is a computer software

More information

Multiple Facts about Multilabel Formats

Multiple Facts about Multilabel Formats Multiple Facts about Multilabel Formats Gwen D. Babcock, ew York State Department of Health, Troy, Y ABSTRACT PROC FORMAT is a powerful procedure which allows the viewing and summarizing of data in various

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

Procedure for Stamping Source File Information on SAS Output Elizabeth Molloy & Breda O'Connor, ICON Clinical Research

Procedure for Stamping Source File Information on SAS Output Elizabeth Molloy & Breda O'Connor, ICON Clinical Research Procedure for Stamping Source File Information on SAS Output Elizabeth Molloy & Breda O'Connor, ICON Clinical Research ABSTRACT In the course of producing a report for a clinical trial numerous drafts

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

Overview of Data Management Tasks (command file=datamgt.sas)

Overview of Data Management Tasks (command file=datamgt.sas) Overview of Data Management Tasks (command file=datamgt.sas) Create the March data set: To create the March data set, you can read it from the MARCH.DAT raw data file, using a data step, as shown below.

More information

SAS Training Spring 2006

SAS Training Spring 2006 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

More information

ABSTRACT INTRODUCTION PROBLEM: TOO MUCH INFORMATION? math nrt scr. ID School Grade Gender Ethnicity read nrt scr

ABSTRACT INTRODUCTION PROBLEM: TOO MUCH INFORMATION? math nrt scr. ID School Grade Gender Ethnicity read nrt scr ABSTRACT A strategy for understanding your data: Binary Flags and PROC MEANS Glen Masuda, SRI International, Menlo Park, CA Tejaswini Tiruke, SRI International, Menlo Park, CA Many times projects 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

Setting the Percentage in PROC TABULATE

Setting the Percentage in PROC TABULATE SESUG Paper 193-2017 Setting the Percentage in PROC TABULATE David Franklin, QuintilesIMS, Cambridge, MA ABSTRACT PROC TABULATE is a very powerful procedure which can do statistics and frequency counts

More information

libname learn "C:\sas\STAT6250\Examples"; /*Identifies library of data*/

libname learn C:\sas\STAT6250\Examples; /*Identifies library of data*/ CHAPTER 7 libname learn "C:\sas\STAT6250\Examples"; /*Identifies library of data*/ /*Problem 7.2*/ proc print data=learn.hosp; where Subject eq 5 or Subject eq 100 or Subject eq 150 or Subject eq 200;

More information

BASUG 2017 An Animated Guide: Learning The PDV via the SAS Debugger

BASUG 2017 An Animated Guide: Learning The PDV via the SAS Debugger BASUG 2017 An Animated Guide: Learning The PDV via the SAS Debugger Russ Lavery, Contractor, Bryn Mawr, PA ABSTRACT The program data vector can be a little bit difficult to understand because it is, normally,

More information

Introduction to SAS Procedures SAS Basics III. Susan J. Slaughter, Avocet Solutions

Introduction to SAS Procedures SAS Basics III. Susan J. Slaughter, Avocet Solutions Introduction to SAS Procedures SAS Basics III Susan J. Slaughter, Avocet Solutions DATA versus PROC steps Two basic parts of SAS programs DATA step PROC step Begin with DATA statement Begin with PROC statement

More information

Biostatistics 600 SAS Lab Supplement 1 Fall 2012

Biostatistics 600 SAS Lab Supplement 1 Fall 2012 Biostatistics 600 SAS Lab Supplement 1 Fall 2012 p 2. How to Enter Data in the Program Editor Window: Instream Data p 5. How to Create a SAS Data Set from Raw Data Files p 16. Using Dates in SAS 1 How

More information

Exam Questions A00-281

Exam Questions A00-281 Exam Questions A00-281 SAS Certified Clinical Trials Programmer Using SAS 9 Accelerated Version https://www.2passeasy.com/dumps/a00-281/ 1.Given the following data at WORK DEMO: Which SAS program prints

More information

Data With the Dataset

Data With the Dataset Generating Data With the SAS@ Dataset Andrew J. L. Cary Cary Consulting Services, Newark CA Abstract It is often necessary to create data to test a program or methodology. The SAS software system s data

More information

Introduction to SAS Mike Zdeb ( , #61

Introduction to SAS Mike Zdeb ( , #61 Mike Zdeb (402-6479, msz03@albany.edu) #61 FORMAT, you can design informats for reading and interpreting non-standard data, and you can design formats for displaying data in non-standard ways....example

More information

Introduction to SAS Procedures SAS Basics III. Susan J. Slaughter, Avocet Solutions

Introduction to SAS Procedures SAS Basics III. Susan J. Slaughter, Avocet Solutions Introduction to SAS Procedures SAS Basics III Susan J. Slaughter, Avocet Solutions SAS Essentials Section for people new to SAS Core presentations 1. How SAS Thinks 2. Introduction to DATA Step Programming

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

Paper This paper reviews these techniques and demonstrates them through a series of examples.

Paper This paper reviews these techniques and demonstrates them through a series of examples. Paper 2220-2015 Are You a Control Freak? Control Your Programs Don t Let Them Control You! Mary F. O. Rosenbloom, Edwards Lifesciences LLC, Irvine, CA Art Carpenter, California Occidental Consultants,

More information

Why & How To Use SAS Macro Language: Easy Ways To Get More Value & Power from Your SAS Software Tools

Why & How To Use SAS Macro Language: Easy Ways To Get More Value & Power from Your SAS Software Tools Why & How To Use SAS Macro Language: Easy Ways To Get More Value & Power from Your SAS Software Tools LeRoy Bessler PhD Bessler Consulting and Research Strong Smart Systems Mequon, WI, USA Le_Roy_Bessler@wi.rr.com

More information

Cody s Collection of Popular SAS Programming Tasks and How to Tackle Them

Cody s Collection of Popular SAS Programming Tasks and How to Tackle Them Cody s Collection of Popular SAS Programming Tasks and How to Tackle Them Ron Cody Contents List of Programs... ix About This Book... xv About The Author... xix Acknowledgments... xxi Chapter 1 Tasks Involving

More information

Stat-340 Term Test Spring Term

Stat-340 Term Test Spring Term Stat-340 Term Test 1 2015 Spring Term Part 1 - Multiple Choice Enter your answers to the multiple choice questions on the provided bubble sheets. Each of the multiple choice question is worth 1 mark there

More information

SOFTWARE TOOLS FOR CLINICALTRIALS.GOV BASIC RESULTS REPORTING

SOFTWARE TOOLS FOR CLINICALTRIALS.GOV BASIC RESULTS REPORTING SOFTWARE TOOLS FOR CLINICALTRIALS.GOV BASIC RESULTS REPORTING Nancy F. Cheng, MS, MS Stuart A. Gansky, MS, DrPH Data Coordinating Center, Early Childhood Caries Collaborative Centers UCSF Center to Address

More information

TIPS FROM THE TRENCHES

TIPS FROM THE TRENCHES TIPS FROM THE TRENCHES Christopher Bost MDRC SAS Users Group October 1, 2008 Recent user questions 2 How can I print long character values? How can I EXPORT formatted values to Excel? How can I check for

More information

STAT 503 Fall Introduction to SAS

STAT 503 Fall Introduction to SAS Getting Started Introduction to SAS 1) Download all of the files, sas programs (.sas) and data files (.dat) into one of your directories. I would suggest using your H: drive if you are using a computer

More information

Using SYSTEM 2000 Data in SAS Programs

Using SYSTEM 2000 Data in SAS Programs 23 CHAPTER 4 Using SYSTEM 2000 Data in SAS Programs Introduction 23 Reviewing Variables 24 Printing Data 25 Charting Data 26 Calculating Statistics 27 Using the FREQ Procedure 27 Using the MEANS Procedure

More information

proc print data=account; <insert statement here> run;

proc print data=account; <insert statement here> run; Statistics 6250 Name: Fall 2012 (print: first last ) Prof. Fan NetID #: Midterm Three Instructions: This is an in-class and open book midterm. You must write your answers on the provide spaces. Give concise

More information

ERROR: ERROR: ERROR:

ERROR: ERROR: ERROR: ERROR: ERROR: ERROR: Formatting Variables: Back and forth between character and numeric Why should you care? DATA name1; SET name; if var = Three then delete; if var = 3 the en delete; if var = 3 then

More information

GET A GRIP ON MACROS IN JUST 50 MINUTES! Arthur Li, City of Hope Comprehensive Cancer Center, Duarte, CA

GET A GRIP ON MACROS IN JUST 50 MINUTES! Arthur Li, City of Hope Comprehensive Cancer Center, Duarte, CA GET A GRIP ON MACROS IN JUST 50 MINUTES! Arthur Li, City of Hope Comprehensive Cancer Center, Duarte, CA ABSTRACT The SAS macro facility, which includes macro variables and macro programs, is the most

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

ABSTRACT INTRODUCTION SIMPLE COMPOSITE VARIABLE REVIEW SESUG Paper IT-06

ABSTRACT INTRODUCTION SIMPLE COMPOSITE VARIABLE REVIEW SESUG Paper IT-06 SESUG 2012 Paper IT-06 Review That You Can Do: A Guide for Systematic Review of Complex Data Lesa Caves, RTI International, Durham, NC Nicole Williams, RTI International, Durham, NC ABSTRACT Quality control

More information

Final Stat 302, March 17, 2014

Final Stat 302, March 17, 2014 First Name Last Name Student ID Final Stat 302, March 17, 2014 Fritz Scholz Questions 1-15 count as 4 points each, the rest as 6 points each (180 total). 1. Could Y and y refer to different objects within

More information

25 Working with categorical data and factor variables

25 Working with categorical data and factor variables 25 Working with categorical data and factor variables Contents 25.1 Continuous, categorical, and indicator variables 25.1.1 Converting continuous variables to indicator variables 25.1.2 Converting continuous

More information

A Moment-Matching Approach for Generating Synthetic Data in SAS

A Moment-Matching Approach for Generating Synthetic Data in SAS Paper 1224-2017 A Moment-Matching Approach for Generating Synthetic Data in SAS Brittany Bogle, The University of North Carolina at Chapel Hill; Jared Erickson, SAS Institute Inc. ABSTRACT Disseminating

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

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

Making a SYLK file from SAS data. Another way to Excel using SAS

Making a SYLK file from SAS data. Another way to Excel using SAS Making a SYLK file from SAS data or Another way to Excel using SAS Cynthia A. Stetz, Acceletech, Bound Brook, NJ ABSTRACT Transferring data between SAS and other applications engages most of us at least

More information

Creating LaTeX and HTML documents from within Stata using texdoc and webdoc. Example 2

Creating LaTeX and HTML documents from within Stata using texdoc and webdoc. Example 2 Creating LaTeX and HTML documents from within Stata using texdoc and webdoc Contents Example 2 Ben Jann University of Bern, benjann@sozunibech Nordic and Baltic Stata Users Group meeting Oslo, September

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

Introduction to SAS Mike Zdeb ( , #1

Introduction to SAS Mike Zdeb ( , #1 Mike Zdeb (402-6479, msz03@albany.edu) #1 (10) REARRANGING DATA If you want to conduct an analysis across observations in a data set, you can use SAS procedures. If you want to conduct an analysis within

More information

SAS Programs SAS Lecture 4 Procedures. Aidan McDermott, April 18, Outline. Internal SAS formats. SAS Formats

SAS Programs SAS Lecture 4 Procedures. Aidan McDermott, April 18, Outline. Internal SAS formats. SAS Formats SAS Programs SAS Lecture 4 Procedures Aidan McDermott, April 18, 2006 A SAS program is in an imperative language consisting of statements. Each statement ends in a semi-colon. Programs consist of (at least)

More information

Measures of Dispersion

Measures of Dispersion Lesson 7.6 Objectives Find the variance of a set of data. Calculate standard deviation for a set of data. Read data from a normal curve. Estimate the area under a curve. Variance Measures of Dispersion

More information

RRFSS 2012: Cell Phone Use and Texting While Driving

RRFSS 2012: Cell Phone Use and Texting While Driving Figure 1 Table 1.The percent of adult drivers (18 years +) who talk on a cell phone, Smartphone, tablet or any other mobile or wireless device while driving, HKPR District, 2012 Response Percent Lower

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

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

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

DSCI 325 Practice Midterm Questions Spring In SAS, a statement must end

DSCI 325 Practice Midterm Questions Spring In SAS, a statement must end DSCI 325 Practice Midterm Questions Spring 2016 1. In SAS, a statement must end a. with a colon b. with a semicolon c. in a new line d. with the command RUN 2. Which of the following is a valid variable

More information

MISSING DATA AND MULTIPLE IMPUTATION

MISSING DATA AND MULTIPLE IMPUTATION Paper 21-2010 An Introduction to Multiple Imputation of Complex Sample Data using SAS v9.2 Patricia A. Berglund, Institute For Social Research-University of Michigan, Ann Arbor, Michigan ABSTRACT This

More information

Stat 302 Statistical Software and Its Applications SAS: Data I/O

Stat 302 Statistical Software and Its Applications SAS: Data I/O Stat 302 Statistical Software and Its Applications SAS: Data I/O Yen-Chi Chen Department of Statistics, University of Washington Autumn 2016 1 / 33 Getting Data Files Get the following data sets from the

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

What you learned so far. Loops & Arrays efficiency for statements while statements. Assignment Plan. Required Reading. Objective 2/3/2018

What you learned so far. Loops & Arrays efficiency for statements while statements. Assignment Plan. Required Reading. Objective 2/3/2018 Loops & Arrays efficiency for statements while statements Hye-Chung Kum Population Informatics Research Group http://pinformatics.org/ License: Data Science in the Health Domain by Hye-Chung Kum is licensed

More information

Handling missing values in Analysis

Handling missing values in Analysis Handling missing values in Analysis Before we analyze the data, which includes missing values, we should make sure that all the missing values have been coded as SAS missing values. There are many ways

More information

Format-o-matic: Using Formats To Merge Data From Multiple Sources

Format-o-matic: Using Formats To Merge Data From Multiple Sources SESUG Paper 134-2017 Format-o-matic: Using Formats To Merge Data From Multiple Sources Marcus Maher, Ipsos Public Affairs; Joe Matise, NORC at the University of Chicago ABSTRACT User-defined formats are

More information

A GREATER GOODS BRAND

A GREATER GOODS BRAND A GREATER GOODS BRAND 1 Symbol for THE OPERATION GUIDE MUST BE READ Symbol for TYPE BF APPLIED PARTS Symbol for MANUFACTURE DATE Symbol for SERIAL NUMBER Symbol for MANUFACTURER Symbol for DIRECT CURRENT

More information

Lab 1: Introduction to Data

Lab 1: Introduction to Data 1 Lab 1: Introduction to Data Some define Statistics as the field that focuses on turning information into knowledge. The first step in that process is to summarize and describe the raw information the

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

Paper S Data Presentation 101: An Analyst s Perspective

Paper S Data Presentation 101: An Analyst s Perspective Paper S1-12-2013 Data Presentation 101: An Analyst s Perspective Deanna Chyn, University of Michigan, Ann Arbor, MI Anca Tilea, University of Michigan, Ann Arbor, MI ABSTRACT You are done with the tedious

More information

The EXPORT Procedure. Overview. Procedure Syntax CHAPTER 18

The EXPORT Procedure. Overview. Procedure Syntax CHAPTER 18 423 CHAPTER 18 The EXPORT Procedure Overview 423 Procedure Syntax 423 PROC EXPORT Statement 424 Data Source Statements 425 Examples 427 Example 1: Exporting a Delimited External File 427 Example 2: Exporting

More information

SC-15. An Annotated Guide: Using Proc Tabulate And Proc Summary to Validate SAS Code Russ Lavery, Contractor, Ardmore, PA

SC-15. An Annotated Guide: Using Proc Tabulate And Proc Summary to Validate SAS Code Russ Lavery, Contractor, Ardmore, PA SC-15 An Annotated Guide: Using Proc Tabulate And Proc Summary to Validate SAS Code Russ Lavery, Contractor, Ardmore, PA ABSTRACT This paper discusses how Proc Tabulate and Proc Summary can be used to

More information

SAS Example A10. Output Delivery System (ODS) Sample Data Set sales.txt. Examples of currently available ODS destinations: Mervyn Marasinghe

SAS Example A10. Output Delivery System (ODS) Sample Data Set sales.txt. Examples of currently available ODS destinations: Mervyn Marasinghe SAS Example A10 data sales infile U:\Documents\...\sales.txt input Region : $8. State $2. +1 Month monyy5. Headcnt Revenue Expenses format Month monyy5. Revenue dollar12.2 proc sort by Region State Month

More information

Introduction to Computers and Programming. Structured data types

Introduction to Computers and Programming. Structured data types Introduction to Computers and Programming Prof. I. K. Lundqvist Lecture 16 Reading: FK pp. 367-384, 415-420, 214-217 Oct 8 2003 Structured data types So far: scalar (single value) data types structured

More information

CMU MSP : SAS FORMATs and INFORMATs Howard Seltman Nov. 7+12, 2018

CMU MSP : SAS FORMATs and INFORMATs Howard Seltman Nov. 7+12, 2018 CMU MSP 36-601: SAS FORMATs and INFORMATs Howard Seltman Nov. 7+12, 2018 1) Formats and informats flexibly re-represent data in a data set on input or output. Common uses include reading and writing dates,

More information

texdoc 2.0 An update on creating LaTeX documents from within Stata Example 2

texdoc 2.0 An update on creating LaTeX documents from within Stata Example 2 texdoc 20 An update on creating LaTeX documents from within Stata Contents Example 2 Ben Jann University of Bern, benjann@sozunibech 2016 German Stata Users Group Meeting GESIS, Cologne, June 10, 2016

More information

Lecture 10: Boolean Expressions

Lecture 10: Boolean Expressions Lecture 10: Boolean Expressions CS1068+ Introductory Programming in Python Dr Kieran T. Herley Department of Computer Science University College Cork 2017-2018 KH (12/10/17) Lecture 10: Boolean Expressions

More information

McLean BASIS plus TM. Sample Hospital. Report for April thru June 2012 BASIS-24 APR-JUN. McLean Hospital

McLean BASIS plus TM. Sample Hospital. Report for April thru June 2012 BASIS-24 APR-JUN. McLean Hospital APR-JUN 212 McLean BASIS plus TM Sample Hospital Report for April thru June 212 BASIS-24 McLean Hospital 115 Mill Street Belmont, MA 2478 Department of Mental Health Services Evaluation Tel: 617-855-2424

More information

PROC FORMAT. CMS SAS User Group Conference October 31, 2007 Dan Waldo

PROC FORMAT. CMS SAS User Group Conference October 31, 2007 Dan Waldo PROC FORMAT CMS SAS User Group Conference October 31, 2007 Dan Waldo 1 Today s topic: Three uses of formats 1. To improve the user-friendliness of printed results 2. To group like data values without affecting

More information

Why & How To Use SAS Macro Language: Easy Ways To Get More Value & Power from Your SAS Software Tools

Why & How To Use SAS Macro Language: Easy Ways To Get More Value & Power from Your SAS Software Tools Why & How To Use SAS Macro Language: Easy Ways To Get More Value & Power from Your SAS Software Tools Le_Roy_Bessler@wi.rr.com Bessler Consulting and Research Strong Smart Systems Visual Data Insights

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

EXST SAS Lab Lab #8: More data step and t-tests

EXST SAS Lab Lab #8: More data step and t-tests EXST SAS Lab Lab #8: More data step and t-tests Objectives 1. Input a text file in column input 2. Output two data files from a single input 3. Modify datasets with a KEEP statement or option 4. Prepare

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

Mapping Clinical Data to a Standard Structure: A Table Driven Approach

Mapping Clinical Data to a Standard Structure: A Table Driven Approach ABSTRACT Paper AD15 Mapping Clinical Data to a Standard Structure: A Table Driven Approach Nancy Brucken, i3 Statprobe, Ann Arbor, MI Paul Slagle, i3 Statprobe, Ann Arbor, MI Clinical Research Organizations

More information

A GREATER GOODS BRAND

A GREATER GOODS BRAND A GREATER GOODS BRAND 1 2 3 Physical Features Measuring Units lb. kg pound kilogram Setting The Measuring Unit By pressing the UNIT button on the back of the scale, you can switch between lb. (pound) and

More information

A SAS Macro for Producing Benchmarks for Interpreting School Effect Sizes

A SAS Macro for Producing Benchmarks for Interpreting School Effect Sizes A SAS Macro for Producing Benchmarks for Interpreting School Effect Sizes Brian E. Lawton Curriculum Research & Development Group University of Hawaii at Manoa Honolulu, HI December 2012 Copyright 2012

More information

EXST3201 Mousefeed01 Page 1

EXST3201 Mousefeed01 Page 1 EXST3201 Mousefeed01 Page 1 3 /* 4 Examine differences among the following 6 treatments 5 N/N85 fed normally before weaning and 85 kcal/wk after 6 N/R40 fed normally before weaning and 40 kcal/wk after

More information

PhUSE Paper CC03. Fun with Formats. Sarah Berenbrinck, Independent, UK

PhUSE Paper CC03. Fun with Formats. Sarah Berenbrinck, Independent, UK Paper CC03 Fun with Formats Sarah Berenbrinck, Independent, UK ABSTRACT The paper will show some ways of using formats to support programming, covering the basics of using formats to change the appearance

More information

Querying a Relational Database COMPANY database For Lab4, you use the Company database that you built in Lab2 and used for Lab3

Querying a Relational Database COMPANY database For Lab4, you use the Company database that you built in Lab2 and used for Lab3 CIS30/530 Lab Assignment SS Chung Querying a Relational Database COMPANY database For Lab, you use the Company database that you built in Lab2 and used for Lab3 1. Update the following new changes into

More information

22S:166. Checking Values of Numeric Variables

22S:166. Checking Values of Numeric Variables 22S:1 Computing in Statistics Lecture 24 Nov. 2, 2016 1 Checking Values of Numeric Variables range checks when you know what the range of possible values is for a given quantitative variable internal consistency

More information

An Easy Route to a Missing Data Report with ODS+PROC FREQ+A Data Step Mike Zdeb, FSL, University at Albany School of Public Health, Rensselaer, NY

An Easy Route to a Missing Data Report with ODS+PROC FREQ+A Data Step Mike Zdeb, FSL, University at Albany School of Public Health, Rensselaer, NY SESUG 2016 Paper BB-170 An Easy Route to a Missing Data Report with ODS+PROC FREQ+A Data Step Mike Zdeb, FSL, University at Albany School of Public Health, Rensselaer, NY ABSTRACT A first step in analyzing

More information

STAT:5400 Computing in Statistics. Other software packages. Microsoft Excel spreadsheet very convenient for entering data in flatfile

STAT:5400 Computing in Statistics. Other software packages. Microsoft Excel spreadsheet very convenient for entering data in flatfile STAT:5400 Computing in Statistics Other Software Packages Proc import A bit on SAS macro language Lecture 26 ov 2, 2016 Kate Cowles 374 SH, 335-0727 kate-cowles@uiowaedu Other software packages Microsoft

More information

Applications Design and Development, a case study of the EDA Summarize-Each-Variable Suite

Applications Design and Development, a case study of the EDA Summarize-Each-Variable Suite Paper HOW96 Applications Design and Development, a case study of the EDA Summarize-Each-Variable Suite Ronald J. Fehd Theoretical Programmer Senior Maverick Stakana Analytics Abstract Description : This

More information

SUAVe Open Problem (May 8 th 2018 meeting)

SUAVe Open Problem (May 8 th 2018 meeting) SUAVe Open Problem (May 8 th 2018 meeting) For this Open Problem, you are given a list of people and the set of (ICD9) diagnoses coded for each person by one or more physicians within a 12 month period.

More information

DATA Step Debugger APPENDIX 3

DATA Step Debugger APPENDIX 3 1193 APPENDIX 3 DATA Step Debugger Introduction 1194 Definition: What is Debugging? 1194 Definition: The DATA Step Debugger 1194 Basic Usage 1195 How a Debugger Session Works 1195 Using the Windows 1195

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

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

Introduction to STATA 6.0 ECONOMICS 626

Introduction to STATA 6.0 ECONOMICS 626 Introduction to STATA 6.0 ECONOMICS 626 Bill Evans Fall 2001 This handout gives a very brief introduction to STATA 6.0 on the Economics Department Network. In a few short years, STATA has become one of

More information

Level I: Getting comfortable with my data in SAS. Descriptive Statistics

Level I: Getting comfortable with my data in SAS. Descriptive Statistics Level I: Getting comfortable with my data in SAS. Descriptive Statistics Quick Review of reading Data into SAS Preparing Data 1. Variable names in the first row make sure they are appropriate for the statistical

More information

THIS IS NOT REPRESNTATIVE OF CURRENT CLASS MATERIAL. STOR 455 Midterm 1 September 28, 2010

THIS IS NOT REPRESNTATIVE OF CURRENT CLASS MATERIAL. STOR 455 Midterm 1 September 28, 2010 THIS IS NOT REPRESNTATIVE OF CURRENT CLASS MATERIAL STOR 455 Midterm September 8, INSTRUCTIONS: BOTH THE EXAM AND THE BUBBLE SHEET WILL BE COLLECTED. YOU MUST PRINT YOUR NAME AND SIGN THE HONOR PLEDGE

More information

Using SAS to Analyze CYP-C Data: Introduction to Procedures. Overview

Using SAS to Analyze CYP-C Data: Introduction to Procedures. Overview Using SAS to Analyze CYP-C Data: Introduction to Procedures CYP-C Research Champion Webinar July 14, 2017 Jason D. Pole, PhD Overview SAS overview revisited Introduction to SAS Procedures PROC FREQ PROC

More information