HRP223 2008 Copyright © 1999-2008 Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.

Slides:



Advertisements
Similar presentations
A complete citation, notecard, and outlining tool
Advertisements

Tutorial 8: Developing an Excel Application
Student Manager Catalog Builder An ACEware Webinar.
Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation.
Advanced Microsoft Word Hosted by Jared Hoffman Topics Keyboard Shortcuts Customizing Toolbars and Menus Auto Format & Auto Correct Tabs Inserting Pictures.
Working with Data in Windows HRP223 – 2010 October 4 th, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
1 SAS Formats and SAS Macro Language HRP223 – 2011 November 9 th, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning:
SAS Output Delivery System. Find heart in the sashelp library Double click.
Beginning Data Manipulation HRP Topic 4 Oct 19 th 2011.
1 Merging with SQL HRP223 – 2011 October 31, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation.
1 Lab 2 HRP223 – 2010 October 18, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
1 Processing Grouped Data HRP223 – 2011 November 14 th, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
1 Combining (with SQL) HRP223 – 2010 October 27, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation.
1 Creating and Tweaking Data HRP223 – 2010 October 24, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
1 Lab 1 HRP223 – 2010 October 6, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
1 Database Theory and Normalization HRP223 – 2010 November 14 th, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning:
1 Lab 1 HRP223 – 2011 Oct 10, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
Automating Tasks With Macros
TRACK 3™ The ultimate process management software.
PowerPoint: Tables Computer Information Technology Section 5-11 Some text and examples used with permission from: Note: We are.
1 Windows and Beginning Data Manipulation HRP223 – 2013 Oct 9, 2012 Copyright © Leland Stanford Junior University. All rights reserved. Warning:
With Alex Conger – President of Webmajik.com FrontPage 2002 Level I (Intro & Training) FrontPage 2002 Level I (Intro & Training)
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
Word Tutorial 3 Creating a Multiple-Page Report
Google Training By: Amy Shannon and Dave Auwerda.
Copyright 2007, Paradigm Publishing Inc. EXCEL 2007 Chapter 7 BACKNEXTEND 7-1 LINKS TO OBJECTIVES Record & run a macro Record & run a macro Save as a macro-
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Introduction to SAS BIO 226 – Spring Outline Windows and common rules Getting the data –The PRINT and CONTENT Procedures Manipulating the data.
HPR Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
Working with Data in Windows HRP223 – 2009 Sept 28 th, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
XP New Perspectives on Microsoft Word 2002 Tutorial 31 Microsoft Word 2002 Tutorial 3 – Creating a Multiple-Page Report.
CREATING TEMPLATES CREATING CUSTOM CHARACTERS IMPORTING BATCH DATA SAVING DATA & TEMPLATES CREATING SERIES DATA PRINTING THE DATA.
Key Applications Module Lesson 21 — Access Essentials
McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies, Inc. All rights reserved. Office Word 2007 Lab 2 Revising and Refining a Document.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
1 Lab 2 and Merging Data (with SQL) HRP223 – 2009 October 19, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning:
Organizing a project, making a table Biostatistics 212 Lecture 7.
Introduction to Enterprise Guide Jennifer Schmidt Rhonda Ellis Cassandra Hall.
SAS ODS (Output Delivery System) Donald Miller 812 Oswald Tower ;
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Updated on: September 4, 2010 CIS67 Foundations for Creating Web Pages Professor Al Fichera.
1 Chapter 7: Customizing and Organizing Project Results 7.1 Combining Results 7.2 Updating Results 7.3 Customizing the Output Style (Self-Study)
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
1 Lab 1 HRP223 – 2011 Oct 10, 2011 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
Customize SAS Output Using ODS Joan Dong. The Output Delivery System (ODS) gives you greater flexibility in generating, storing, and reproducing SAS procedure.
1 Lab 1 HRP223 – 2009 October 5, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
1 Data Manipulation (with SQL) HRP223 – 2009 October 12, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
BMTRY 789 Lecture9: Proc Tabulate Readings – Chapter 11 & Selected SUGI Reading Lab Problems , 11.2 Homework Due Next Week– HW6.
1 EPIB 698C Lecture 1 Instructor: Raul Cruz-Cano
Beginning Data Manipulation HRP Topic 4 Oct 14 th 2012 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 14 & 19 By Tasha Chapman, Oregon Health Authority.
Made with OpenOffice.org 1 Beyond the Single Page Steve Oualline OpenOffice Writer.
Chapter 5: Enhancing Your Output with ODS
Jonathan W. Duggins; James Blum NC State University; UNC Wilmington
Working with Data in Windows
SAS Output Delivery System
Tutorial 3 – Creating a Multiple-Page Report
Combining (with SQL) HRP223 – 2013 October 30, 2013
Lab 3 and HRP259 Lab and Combining (with SQL)
Lab 2 and Merging Data (with SQL)
Combining (with SQL) HRP223 – 2012 November 05, 2011
Lab 2 HRP223 – 2010 October 18, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected.
File Sharing and Processing Grouped Data
Data Manipulation (with SQL)
Processing Grouped Data
Microsoft Excel 2007 – Level 2
Presentation transcript:

HRP Copyright © Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and international treaties. Unauthorized reproduction of this presentation, or any portion of it, may result in severe civil and criminal penalties and will be prosecuted to maximum extent possible under the law. HRP Topic 7 – How Reports Work

HRP When do I do what?  If you need to produce summaries of data down columns, use the Describe menu.  If you need to summarize data across the rows (change the values in cells), use the Filter and Query tool.

HRP Data Steps  You can do anything in data step but don’t.  Use the menu drive summaries.  There are three cases where you will want to do dataset processing because the menu options are too limited or missing and SQL is impossible or ridiculously hard for these tasks: – outputting to multiple data sets – doing the same task to a set of variables – tracking complex patterns across records (for example, you may want to keep a complex total as you process records for a person) or remembering what was on a previous record

HRP Retain  It is a horrible way to organize data but some people use blanks to indicate you are on the same subject.  This causes issues for SAS because SAS erases the PDV whenever it loads in new data. You need to tell it to remember values across records.  You can tell SAS to retain (remember) variables.

HRP Retain  The PDV wants to work like this:

HRP Retain  You want to give the retained variable the subject ID when you have one.

HRP Retain  If the ID is not missing, you want to copy the retained ID into the blank.  You don’t need to copy lastDude into the new data set.

HRP Retain Both

HRP After Slicing and Dicing  After you build tables with the correct data, you will want to print reports. – Simple Tables – Complex Summaries – Numeric Summaries – Graphics  The Graphical User Interface in EG is excellent for these tasks but you will want to make some tweaks which I will show you.

HRP A Simple Printed Report  Say you have a dataset with band names and album names and you want to print it in a report:  Use the List Data… menu option from the Describe menu:

HRP Basic reports are easy.

HRP Looking Better

HRP Changing Code  As you tweak checkboxes or other options, EG is rewriting code:

HRP How it Works  The code that is generated for visualization tasks does these things: – Cleans up old files before it tries to reuse the names – Sorts the data if needed (and drops extra variables if you don’t tell it otherwise) – Does the visualization – Deletes old files

HRP The code will look something like this:

HRP If your code looks different… I recommend setting this to never.

HRP Titles  The titles look lousy. I want the title to say “Ray plays 5f_55 too loud” and “Ray plays Assemblage 23 too loud”, etc..  Use #byval(theVariable) to show the group as the title at the top of the page.

HRP Almost…. Closer….

HRP

Niceties  You can justify titles or footnotes to the left or right or add hyperlinks.  Right click on the node that has the report and choose Open Last Submitted Code. Then type anything to have it make a copy for you to edit. Add the code to left justify

HRP Adding hyperlinks is easy also.

HRP File Names  It is convenient to add the name of the project to titles or footnotes.  There is an automatic macro variable called _clientprojectname which has the path to the project.

HRP %scan(&_clientprojectname, -1, \)  This is a macro function that says parse the path into words by dividing only at \ and select the first word starting on the right.

HRP Macro Parameters in EG  You have seen a few examples of using macros and macro parameters in SAS code. – Macro is extremely useful to customize EG code. You can add in lists for drop down menus that appear when your project runs. – This is extremely useful for changing what happens when you run your projects.  More on this later.

HRP Looking at Data  There is a dataset in the Walker book where he looks to see if two categorical predictors impact the mean hemoglobin scores. – Cancer type – Active vs. placebo  I want to visualize the data first and use the formal statistics to confirm what I have seen.

HRP Summaries  I want good looking boxplots, histograms and numeric summaries. The Box Plot menu choice is an embarrassment.

HRP By default you do NOT see outliers. Fix that.

HRP A lovely plot of white space…. With no mean symbols….

HRP

Histograms  The histograms you get from the Distribution Analysis tool are not too bad but I would not try to publish them.

HRP Cancer Type  It looks like there are some subtle differences.

HRP SAS 9.2  SAS did major work to graphics in 9.2. I have not seen EG 4.2 yet but I am hopeful.

HRP Pretty Summary Tables  Proc Tabulate is arguably the most user-hostile part of SAS. It is hidden nicely by the Summary Tables item under the Describe menu.

HRP Drag the classification variables into the table. Drag and drop the analysis variable.

HRP Drag and drop useful statistics.

HRP Drag All to the margins. Drag the analysis variable to the line below All.

HRP Drag in the statistics of interest.

HRP Set format and right click on areas to set properties like colors.

HRP This is what I got after a bunch of right clicking and tweaking the “Heading Properties” and one change to the Box Area.

HRP General Appearance I don’t like the general color scheme and I want this to go to a PDF file.

HRP Instant PDF Visit the Style Manager on the Tools menu to browse the different style templates.

HRP ODS  The Output Delivery System is the subsystem of SAS that controls output, including file types created and the appearance of the content. You can take any block of code and surround it with instructions to use ODS to send the output from an analysis to different output “pipes.”  There is no easy way to redirect output from several nodes in the flowchart into a single PDF.  Right click and choose “Open Last Submitted Code” and copy it (the blocks of code you want) to combine them into a single new code node.

HRP Pipes  You open the ODS pipe by typing: ods html body="path"; ods pdf body ="path";  You close it with the corresponding close statement: ods html close; ods pdf close;

HRP HTLM  My code to produce HTML looks like this: ods html file=‘blah-body.htm' contents="blah-contents.htm" frame="blah-frame.htm" page="blah-page.htm" path ="c:\projects\blah\" (url=none) gpath="c:\projects\blah\" (url=none); Store the HTLM files and graphics here. Do not specify the exact location of the files. or body

HRP ODS Example ods html body="blah-body.htm" contents="blah-contents.htm" frame="blah-frame.htm" page="blah-page.htm" path ="c:\blah\" (url=none) gpath="c:\blah\" (url=none); proc print data=blah;run; proc print data=blah2;run; ods html close; Call it index.html if going to a webpage.

HRP

HTML Style Templates  You can add this to the ods html line to change the appearance of the output: /style= SomeStyle  Where SomeStyle includes lots of already made choices like: BarrettsBlue, Beige, Brick, D3d,Default, FancyPrinter, Minimal, NoFontDefault, Printer, RTF, SansPrinter, SASWeb, SerifPrinter, StatDoc  I usually use default, minimal, journal or printer.

HRP ODS for Word Processing  If you want good looking output to go into a word processor, tell ODS to output into RTF (rich text format): ods rtf file = "c:\SomeName.rtf" bodytitle ;  At the end of the program include this: ods rtf close; SAS wants to put titles into the document’s header. If you use “bodytitle” it will put the titles into the body of the text document.

HRP ODS Example  To get SAS to produce a subset of the output, you use the ods select subsectionName statement. ods select BasicMeasures; proc univariate data = repver.f_repver3; var age_st; run;  The trick is to figure out the name of the subsection you want. To find the subsection name, you can dig through the SAS documentation or just use the ODS trace statement.

HRP ods trace on; proc univariate data=repver.f_repver3; var age_st; run; ods trace off;  After you have the names of the subsections you want, remember to remove or comment out the ods trace statements.

HRP ODS Output to Tables  You can also send specific parts of output directly to a table like this: ods output TestsForLocation = work.blah; proc univariate data = repver.f_repver3; var age_st; run;

HRP Exclude  Specify the name of the table you want to exclude: ods pdf; ods exclude statistics; proc ttest data=graze; class GrazeType; var WtGain; run; ods pdf close;  The exclude will impact the next procedure only.

HRP Stopping Flow  You can stop the output from a procedure from going to a destination. I do this when I am creating a web summary of data and I have diagnostic procedures in the code. ods html select none; proc datasets library = thom04; modify rrcardnd (label = "thom04.rrcardnd: RRisk Phone Screening Form"); run; modify dphel (label = "People they think had full information"); quit; ods html select all;