HRP 223 2008 HRP 223 2008 Topic 7
- Slides: 53
HRP 223 - 2008 HRP 223 2008 Topic 7 – How Reports Work Copyright © 1999 -2008 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.
When do I do what? HRP 223 2008 § 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.
Data Steps HRP 223 2008 § 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
Retain HRP 223 2008 § 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.
Retain § The PDV wants to work like this: HRP 223 2008
Retain HRP 223 2008 § You want to give the retained variable the subject ID when you have one.
Retain HRP 223 2008 § If the ID is not missing, you want to copy the retained ID into the blank. § You don’t need to copy last. Dude into the new data set.
Retain Both HRP 223 2008
After Slicing and Dicing HRP 223 2008 § 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.
A Simple Printed Report HRP 223 2008 § 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:
Basic reports are easy. HRP 223 2008
Looking Better HRP 223 2008
Changing Code HRP 223 2008 § As you tweak checkboxes or other options, EG is rewriting code:
How it Works HRP 223 2008 § 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 223 The code will look something like this: 2008
If your code looks different… HRP 223 2008 I recommend setting this to never.
Titles § The titles look lousy. I want the title to say “Ray plays 5 f_55 too loud” and “Ray plays Assemblage 23 too loud”, etc. . § Use #byval(the. Variable) to show the group as the title at the top of the page. HRP 223 2008
HRP 223 2008 Almost…. Closer….
HRP 223 2008
Niceties HRP 223 2008 § 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
Adding hyperlinks is easy also. HRP 223 2008
File Names HRP 223 2008 § 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.
%scan(&_clientprojectname, -1, ) HRP 223 2008 § 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.
Macro Parameters in EG HRP 223 2008 § 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.
Looking at Data HRP 223 2008 § 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.
Summaries HRP 223 2008 § I want good looking boxplots, histograms and numeric summaries. The Box Plot menu choice is an embarrassment.
HRP 223 2008 By default you do NOT see outliers. Fix that.
A lovely plot of white space…. With no mean symbols…. HRP 223 2008
HRP 223 2008
Histograms HRP 223 2008 § The histograms you get from the Distribution Analysis tool are not too bad but I would not try to publish them.
Cancer Type HRP 223 2008 § It looks like there are some subtle differences.
SAS 9. 2 HRP 223 2008 § SAS did major work to graphics in 9. 2. I have not seen EG 4. 2 yet but I am hopeful.
Pretty Summary Tables HRP 223 2008 § Proc Tabulate is arguably the most user-hostile part of SAS. It is hidden nicely by the Summary Tables item under the Describe menu.
Drag the classification variables into the table. Drag and drop the analysis variable. HRP 223 2008
Drag and drop useful statistics. HRP 223 2008
Drag All to the margins. HRP 223 2008 Drag the analysis variable to the line below All.
Drag in the statistics of HRP 223 interest. 2008
Set format and right click on areas to set properties like colors. HRP 223 2008
HRP 223 2008 This is what I got after a bunch of right clicking and tweaking the “Heading Properties” and one change to the Box Area.
General Appearance HRP 223 2008 I don’t like the general color scheme and I want this to go to a PDF file.
Instant PDF HRP 223 2008 Visit the Style Manager on the Tools menu to browse the different style templates.
ODS HRP 223 2008 § 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.
Pipes HRP 223 2008 § 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;
HTLM HRP 223 2008 § My code to produce HTML looks like this: or body ods html file=‘blah-body. htm' contents="blah-contents. htm" frame="blah-frame. htm" page="blah-page. htm" path ="c: projectsblah" (url=none) gpath="c: projectsblah" (url=none); Store the HTLM files and graphics here. Do not specify the exact location of the files.
ODS Example HRP 223 2008 ods html body="blah-body. htm" contents="blah-contents. htm" frame="blah-frame. htm" Call it index. html if going to page="blah-page. htm" a webpage. path ="c: blah" (url=none) gpath="c: blah" (url=none); proc print data=blah; run; proc print data=blah 2; run; ods html close;
HRP 223 2008
HTML Style Templates HRP 223 2008 § You can add this to the ods html line to change the appearance of the output: /style= Some. Style § Where Some. Style includes lots of already made choices like: Barretts. Blue, Beige, Brick, D 3 d, Default, Fancy. Printer, Minimal, No. Font. Default, Printer, RTF, Sans. Printer, SASWeb, Serif. Printer, Stat. Doc § I usually use default, minimal, journal or printer.
ODS for Word Processing HRP 223 2008 § 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: Some. Name. rtf" bodytitle ; 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. § At the end of the program include this: ods rtf close;
ODS Example HRP 223 2008 § To get SAS to produce a subset of the output, you use the ods select subsection. Name statement. ods select Basic. Measures; proc univariate data = repver. f_repver 3; 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.
ods trace on; proc univariate data=repver. f_repver 3; 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 223 2008
ODS Output to Tables HRP 223 2008 § You can also send specific parts of output directly to a table like this: ods output Tests. For. Location = work. blah; proc univariate data = repver. f_repver 3; var age_st; run;
Exclude § Specify the name of the table you want to exclude: ods pdf; ods exclude statistics; proc ttest data=graze; class Graze. Type; var Wt. Gain; run; ods pdf close; § The exclude will impact the next procedure only. HRP 223 2008
Stopping Flow HRP 223 2008 § 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 = thom 04; modify rrcardnd (label = "thom 04. rrcardnd: RRisk Phone Screening Form"); run; modify dphel (label = "People they think had full information"); quit; ods html select all;
- Dl11cd
- Resolución 223 sma
- Hqda exord 081-17
- Ics 223-12
- 2008 2008
- Broad topic and narrow topic examples
- Narrowing down a topic exercises
- Western blot 원리
- Human resource forecasting definition
- Supply forecasting techniques in hrp
- Requisites for successful hrp
- Hrp ecl 원리
- Hpc project module
- Skyward hrp
- Greg nickless hcd
- What is human resource planning definition
- Hrp gyneco
- Wastage analysis in hrp
- Definition of hrp
- Project based hrp consists of
- Hrp cream
- Hrp graphics
- 25 march 2008
- Iso 9001:2008 certification in mumbai
- Cpa 2008
- Health and safety care act 2008
- Medina 2008
- Sql server 2008 certification
- 2008 pearson education inc
- Adaaa 2008
- Nasa 2008
- 18/2008 orfk utasítás
- Stamp duty(amendment) proclamation no. 612/2008
- Which statement best describes this part of the story?
- Nbr 5410/2008
- Iso 9004:2008
- Ssis 2008 training
- 2008 pearson education inc
- Alage lee
- What is line item budget
- Iso/iec 24762:2008
- 2008
- Windows server ipam
- Ohsas 18001:2008
- Lei nº11.788/08
- Rmc 13-82
- Copyright 2008
- 2008
- Pengantar manajemen sdm
- Pearson education inc publishing as pearson prentice hall
- Melanie nind
- Decret 181
- 22 mei 2008
- C++ mvp