PROC REPORT organizes the output in many ways, from the simple to highly complex… PROC REPORT NOWINDOWS HEADLINE HEADSKIP; COLUMN variable-list; DEFINE.

Slides:



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

The INFILE Statement Reading files into SAS from an outside source: A Very Useful Tool!
Statistical Methods Lynne Stokes Department of Statistical Science Lecture 7: Introduction to SAS Programming Language.
SAS Programming:File Merging and Manipulation. Reading External Files (review) data barf; * create the dataset BARF; infile ’s:\mysas\Table7.1'; * open.
© Paradigm Publishing, Inc Access 2010 Level 1 Unit 2Creating Forms and Reports Chapter 6Creating Reports and Mailing Labels.
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.
Outline Proc Report Tricks Kelley Weston. Outline Examples 1.Text that spans columnsText that spans columns 2.Patient-level detail in the titlesPatient-level.
Creating a Compact Columnar Output with PROC REPORT Walter R. Young Principal Clinical Programmer Analyst Wyeth.
Quick Data Summaries in SAS Start by bringing in data –Use permanent data set for these examples Proc Tabulate –Produces summaries very quickly and easily.
Introduction to SQL Session 1 Retrieving Data From a Single Table.
Basic And Advanced SAS Programming
1 SAS SAS is a statistics software package developed by SAS Institute Inc. in U.S.A. SAS products include SAS/STAT, SAS/IML, SAS/OR, etc. The most.
Introduction to SAS Essentials Mastering SAS for Data Analytics Alan Elliott and Wayne Woodward SAS Essentials - Elliott & Woodward1.
Topics in Data Management SAS Data Step. Combining Data Sets I - SET Statement Data available on common variables from different sources. Multiple datasets.
Welcome to SAS…Session..!. What is SAS..! A Complete programming language with report formatting with statistical and mathematical capabilities.
Chapter 8 Producing Summary Reports. Section 8.1 Introduction to Summary Reports.
SAS PROC REPORT PROC TABULATE
Lecture 5 Sorting, Printing, and Summarizing Your Data.
Chapter 9 Producing Descriptive Statistics PROC MEANS; Summarize descriptive statistics for continuous numeric variables. PROC FREQ; Summarize frequency.
Introduction to SAS Essentials Mastering SAS for Data Analytics Alan Elliott and Wayne Woodward SAS ESSENTIALS -- Elliott & Woodward1.
Introduction to SAS BIO 226 – Spring Outline Windows and common rules Getting the data –The PRINT and CONTENT Procedures Manipulating the data.
1 Experimental Statistics - week 4 Chapter 8: 1-factor ANOVA models Using SAS.
Introduction to SAS. What is SAS? SAS originally stood for “Statistical Analysis System”. SAS is a computer software system that provides all the tools.
Chapter 19 Managing Worksheet Lists. Creating Lists ► Microsoft Office Excel 2003 is inarguably the most powerful electronic spreadsheet available. ►
Advanced Reports Lesson 11. Objectives Defining Groups A group is a collection of records separated visually with any introductory or summary information.
Use the UPDATE statement to: –update a master dataset with new transactions (e.g. a bank account updated regularly with deposits and withdrawals…). Not.
EPIB 698C Lecture 2 Notes Instructor: Raul Cruz 2/14/11 1.
Lesson 2 Topic - Reading in data Chapter 2 (Little SAS Book)
Introduction to Enterprise Guide Jennifer Schmidt Rhonda Ellis Cassandra Hall.
Reports and Queries Chapter 3 – Access text Reports – Page Queries – Page
Introduction to SAS Essentials Mastering SAS for Data Analytics Alan Elliott and Wayne Woodward SAS ESSENTIALS -- Elliott & Woodward1.
Laboratory 1. Introduction to SAS u Statistical Analysis System u Package for –data entry –data manipulation –data storage –data analysis –reporting.
Priya Ramaswami Janssen R&D US. Advantages of PROC REPORT -Very powerful -Perform lists, subsets, statistics, computations, formatting within one procedure.
Chapter 5 Reading and Manipulating SAS ® Data Sets and Creating Detailed Reports Xiaogang Su Department of Statistics University of Central Florida.
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.
ENG College of Engineering Engineering Education Innovation Center 1 More Script Files in MATLAB Script File I/O : Chapter 4 1.Global Variables.
Here’s another problem (see section 2.13 on page 54). A file contains two different types of records (say A’s and B’s) and we only want to read in the.
Chapter 4 concerns various SAS procedures (PROCs). Every PROC operates on: –the most recently created dataset –all the observations –all the appropriate.
1 EPIB 698C Lecture 4 Raul Cruz-Cano Summer 2012.
Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.
Lesson 12 Spreadsheets Unit 2—Using the Computer.
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.
FORMAT statements can be used to change the look of your output –if FORMAT is in the DATA step, then the formats are permanent and stored with the dataset.
1 Chapter 3: Getting Started with Tasks 3.1 Introduction to Task Dialogs 3.2 Creating a Listing Report 3.3 Creating a Frequency Report 3.4 Creating a Two-Way.
Use the SET statement to: –create an exact copy of a SAS dataset –modify an existing SAS dataset by creating new variables, subsetting (using a subsetting.
Patrick Thornton SRI International.  Example of a Multiple Response Item ◦ Variable coding and example data  A Cross Tabulation using Proc REPORT 
Lesson 2 Topic - Reading in data Programs 1 and 2 in course notes –Chapter 2 (Little SAS Book)
BMTRY 789 Lecture9: Proc Tabulate Readings – Chapter 11 & Selected SUGI Reading Lab Problems , 11.2 Homework Due Next Week– HW6.
Chapter 6: Modifying and Combining Data Sets  The SET statement is a powerful statement in the DATA step DATA newdatasetname; SET olddatasetname;.. run;
SAS Programming Training Instructor:Greg Grandits TA: Textbooks:The Little SAS Book, 5th Edition Applied Statistics and the SAS Programming Language, 5.
Based on Learning SAS by Example: A Programmer’s Guide Chapters 1 & 2
The Urban Institute - SAS Training6/9/20161 SAS Training This SAS Training Course was designed to introduce users at The Urban Institute to SAS programming.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 14 & 19 By Tasha Chapman, Oregon Health Authority.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 16 & 17 By Tasha Chapman, Oregon Health Authority.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 5 & 6 By Ravi Mandal.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 3 & 4 By Tasha Chapman, Oregon Health Authority.
Applied Business Forecasting and Regression Analysis
Chapter 6: Modifying and Combining Data Sets
Chapter 2: Getting Data into SAS
Instructor: Raul Cruz-Cano
Chapter 4: Sorting, Printing, Summarizing
Assume as previously that we have k samples on as many treatments
Chapter 1 Minitab Recipe Card
Introduction to SAS A SAS program is a list of SAS statements executed in order Every SAS statement ends with a semicolon! SAS statements can be in caps.
Introduction to DATA Step Programming: SAS Basics II
Producing Descriptive Statistics
From and Report.
Introduction to SAS Essentials Mastering SAS for Data Analytics
Presentation transcript:

PROC REPORT organizes the output in many ways, from the simple to highly complex… PROC REPORT NOWINDOWS HEADLINE HEADSKIP; COLUMN variable-list; DEFINE variable / options ‘column heading’; By default, REPORT prints all variables in the columns and all observations in the rows if the COLUMN and DEFINE statements are omitted. If the NOWINDOWS statement is omitted then an interactive REPORT window appears… HEADLINE draws a line under the column names and HEADSKIP skips a line after the headline…

Let’s look at the example program on page 133… Here’s the data… Dinosaur NM West 2 6 Ellis Island NM East 1 0 Everglades NP East 5 2 Grand Canyon NP West 5 3 Great Smoky Mountains NP East 3 10 Hawaii Volcanoes NP West 2 2 Lava Beds NM West 1 1 Statue of Liberty NM East 1 0 Theodore Roosevelt NP. 2 2 Yellowstone NP West 9 11 Yosemite NP West 2 13

options ls=80; dm output ‘clear’; dm log ‘clear’; DATA natparks; INFILE ‘ ‘; INPUT Name $ 1-21 Type $ Region $ Museums Camping; PROC REPORT DATA = natparks NOWINDOWS HEADLINE; TITLE 'Report with Character and Numeric Variables'; RUN; PROC REPORT DATA = natparks NOWINDOWS HEADLINE; COLUMN Museums Camping; TITLE 'Report with Only Numeric Variables'; RUN; * PROC REPORT with ORDER variable, MISSING option, and column header; PROC REPORT DATA = natparks NOWINDOWS HEADLINE MISSING; COLUMN Region Name Museums Camping; DEFINE Region / ORDER; DEFINE Camping / ANALYSIS 'Camp/Grounds'; TITLE 'National Parks and Monuments Arranged by Region'; RUN;

The DEFINE statement specifies options for specific variables DEFINE variable / options ‘column heading’; Among the options available are: –ACROSS creates columns for each value of the variable –ANALYSIS calculates various statistics for the variable - default statistic is SUM –DISPLAY creates one row for each observation - this is the default –GROUP creates one row for each value of the variable –ORDER creates one row for each value of the variable with the rows sorted by the variable’s values You may also change the header of the column for the variable by putting the text you want in quotes after the options…a / inside the quotes means to start a new line in the header. See previous slide…

Summary reports are fairly simple with PROC REPORT –the GROUP option of DEFINE summarizes in the rows while the ACROSS option of DEFINE summarizes in the columns PROC REPORT DATA = natparks NOWINDOWS HEADLINE; COLUMN Region type Museums Camping; DEFINE Region / GROUP; DEFINE type / GROUP; title ‘Summary Report with two Group Variables’; RUN; PROC REPORT DATA = natparks NOWINDOWS HEADLINE; COLUMN Region type, (Museums Camping); DEFINE Region / GROUP; DEFINE type / ACROSS; title ‘Summary Report with both a GROUP and ACROSS’; RUN; *note the comma tells SAS to sum the analysis variables Museums and Camping;

If you want other statistics besides SUM, put the name of the statistic after a comma following the name of the variable in the COLUMN statement. PROC REPORT DATA = natparks NOWINDOWS HEADLINE; COLUMN Region type N (Museums Camping),MEAN; DEFINE Region / GROUP; DEFINE type / GROUP; title ‘Summary Report with two Group Variables & MEAN’; RUN; PROC REPORT DATA = natparks NOWINDOWS HEADLINE; COLUMN Region N type, (Museums Camping),MEAN; DEFINE Region / GROUP; DEFINE type / ACROSS; title ‘Summary Report with both a GROUP, ACROSS & MEAN’; RUN; *note the comma tells SAS to take MEANs of the analysis variables Museums and Camping;

You may also use the BREAK and RBREAK statements to place “breaks” between values of variables, draw lines, and then summarize over those values… PROC REPORT DATA = natparks NOWINDOWS HEADLINE; COLUMN Name Region Museums Camping; DEFINE Region / ORDER; BREAK AFTER Region/ SUMMARIZE OL SKIP; RBREAK AFTER / SUMMARIZE OL SKIP; TITLE “National Parks Summarized”; HW: Finish reading Chapter 4. Play around with TABULATE and REPORT… I will give out a take-home part of the midterm next time… Midterm exam will be on Wednesday March 21, 2007.