01/20151 EPI 5344: Survival Analysis in Epidemiology SAS code and output February 24, 2015 Dr. N. Birkett, School of Epidemiology, Public Health & Preventive.

Slides:



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

* 1 Common Dialog Control. * 2 You want your user to set property or provide your application with some information easily? How do you do it? The Common.
The INFILE Statement Reading files into SAS from an outside source: A Very Useful Tool!
© 2007 by Prentice Hall10-1 Introduction to Oracle 10g Chapter 10 Creating and Modifying Reports James Perry and Gerald Post.
How to Create a Custom Style Sonia Extremera / Antonio Nieto / Javier Gómez PhUSE Annual Conference, 9th-12th Oct 2011, Brighton UK.
MATLAB’s extensive, device-independent plotting capabilities are one of its most powerful features. They make it very easy to plot any data at any time.
Today: Run SAS programs on Saturn (UNIX tutorial) Runs SAS programs on the PC.
SAS Output Delivery System. Find heart in the sashelp library Double click.
What is New in SAS 9.2? Graphics and More. A Brief History of SAS Graphics 6.x 7.x = had the Output Delivery System (ODS) but it was not widely available.
Chapter 11 Survival Analysis Part 3. 2 Considering Interactions Adapted from "Anderson" leukemia data as presented in Survival Analysis: A Self-Learning.
Introduction to Survival Analysis PROC LIFETEST and Survival Curves.
Customize your SAS® Output with the Template Procedure: A Beginning Tutorial Carol Gosselin North Carolina State University, Raleigh, NC Joy Munk Smith.
EPLS Lab Software Orientation SAS. Orientation Overview Background Getting Started SAS Windows.
Understanding HTML Style Sheets. What is a style?  A style is a rule that defines the appearance and position of text and graphics. It may define the.
Copyright © 2010, Meta-Xceed, Inc. All rights reserved. BI Flash and all other Meta-Xceed Inc. product or service names are registered trademarks or trademarks.
STT : BIOSTATISTICS ANALYSIS Dr. Cuixian Chen Chapter 8: Fitting Parametric Regression Models STT
Drill-down Graphs By Heather Hoffman. Family Practice Department Project  Create drill-down graphs that depict % of patients for each CCS* over a given.
Bay Area SUG June SAS ® 9.2 Implications for Biotech SAS ® 9.2 Implications for Biotech Bay Area SAS User’s Group June 7 th 2010 Sarmad Pirzada,
LATTICE TECHNOLOGY, INC. For Version 10.0 and later XVL Web Master Advanced Tutorial For Version 10.0 and later.
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.
Topic 2: An Example. Leaning Tower of Pisa Construction began in 1173 and by 1178 (2 nd floor), it began to sink Construction resumed in To compensate.
Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010.
My ODS: Real-World Uses of Modifying Table Templates Steve James Centers for Disease Control and Prevention Atlanta, Ga.
ODS Statistical Graphics in SAS 9.2 January 17, 2010.
Chapter 1: Introduction to SAS  SAS programs: A sequence of statements in a particular order  Rules for SAS statements: –Every SAS statement ends in.
SAS Software Version 8 The Output Delivery System.
Introduction to SAS/Graph 9.2 Ken Barz Colorado Prevention Center 22Oct2009 Ken Barz Colorado Prevention Center.
01/20151 EPI 5344: Survival Analysis in Epidemiology Survival curve comparison (non-regression methods) March 3, 2015 Dr. N. Birkett, School of Epidemiology,
Using the new Version 8 Template Procedure for Complete Control of SAS Output Style and Format David Ghan Technical Training Specialist SAS, Canada.
Introduction to Enterprise Guide Jennifer Schmidt Rhonda Ellis Cassandra Hall.
Applied Epidemiologic Analysis - P8400 Fall 2002 Lab 9 Survival Analysis Henian Chen, M.D., Ph.D.
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.
01/20141 EPI 5344: Survival Analysis in Epidemiology SAS code and output March 4, 2014 Dr. N. Birkett, Department of Epidemiology & Community Medicine,
Priya Ramaswami Janssen R&D US. Advantages of PROC REPORT -Very powerful -Perform lists, subsets, statistics, computations, formatting within one procedure.
Lecture 3 Topic - Descriptive Procedures Programs 3-4 LSB 4:1-4.4; 4:9:4:11; 8:1-8:5; 5:1-5.2.
1 Guide to Oracle10G CHAPTER 7: Creating Database Reports 7.
SAS Basics. Windows Program Editor Write/edit all your statements here. Log Watch this for any errors in program as it runs. Output Will automatically.
Chapter 1: Overview of SAS System Basic Concepts of SAS System.
Controlling Input and Output
SAS Basics. Windows Program Editor Write/edit all your statement here.
©Dofasco Inc., 2004 All rights reserved 1 Using the Output Delivery System October 22, 2004 Presentation to: The Toronto Area SAS Society.
01/20151 EPI 5344: Survival Analysis in Epidemiology Estimating S(t) from Cox models March 24, 2015 Dr. N. Birkett, School of Epidemiology, Public Health.
01/20151 EPI 5344: Survival Analysis in Epidemiology Quick Review from Session #1 March 3, 2015 Dr. N. Birkett, School of Epidemiology, Public Health &
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.
Customize SAS Output Using ODS Joan Dong. The Output Delivery System (ODS) gives you greater flexibility in generating, storing, and reproducing SAS procedure.
01/20151 EPI 5344: Survival Analysis in Epidemiology SAS Code for Cox models March 17, 2015 Dr. N. Birkett, School of Epidemiology, Public Health & Preventive.
01/20141 EPI 5344: Survival Analysis in Epidemiology Estimating S(t) from Cox models April 1, 2014 Dr. N. Birkett, Department of Epidemiology & Community.
1 Data Manipulation (with SQL) HRP223 – 2009 October 12, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
ODS TAGSETS - a Powerful Reporting Method Derek. 2 Agenda Understanding the tagset How to use tagsets Conclusion.
Based on Learning SAS by Example: A Programmer’s Guide Chapters 1 & 2
Basic HTML Page 1. First Open Windows Notepad to type your HTML code 2.
1 SAS ® ODS Technology for Today’s Decision Makers Sunil Gupta Quintiles.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 14 & 19 By Tasha Chapman, Oregon Health Authority.
03/20161 EPI 5344: Survival Analysis in Epidemiology Estimating S(t) from Cox models March 29, 2016 Dr. N. Birkett, School of Epidemiology, Public Health.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 16 & 17 By Tasha Chapman, Oregon Health Authority.
03/20161 EPI 5344: Survival Analysis in Epidemiology Testing the Proportional Hazard Assumption April 5, 2016 Dr. N. Birkett, School of Epidemiology, Public.
Kaplan-Meier Survival Plotting Macro %NEWSURV Jeffrey Meyers Mayo Clinic, Rochester, MN.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 3 & 4 By Tasha Chapman, Oregon Health Authority.
Chapter 5: Enhancing Your Output with ODS
Applied Business Forecasting and Regression Analysis
SAS Output Delivery System
Chapters 5 and 7 supplement
Embedding Graphics in Web Pages
Beautiful PROC CONTENTS Output Using the ODS Excel Destination
Presentation transcript:

01/20151 EPI 5344: Survival Analysis in Epidemiology SAS code and output February 24, 2015 Dr. N. Birkett, School of Epidemiology, Public Health & Preventive Medicine, University of Ottawa

SAS Output Delivery System (ODS) Default method for getting output from SAS procedures Can produce: –printed results –graphics (hi-res) –Data tables for use in future procs 01/20152

SAS Output Delivery System (ODS) Output formats include: –HTML –RTF –PDF Provides extensive control of output format, colors, etc. –1500 page ‘basic manual’. –more manuals for graphics 01/20153

SAS Output Delivery System (ODS) Basic use is relatively simple –80/20 rule –add on features as you get better at it By default, ALL SAS output is prepared as HTML –Presented in the Results Window 01/20154

5 ODS produces output which has two components

01/20156 To change type of output: ODS HTML close; ODS PDF; To save output to a file: ODS HTML file = ‘file_name.html’; -Can define the filename in a ‘filename’ statement and put the reference here: filename f1 ‘C:/home/EPI5344.html’; ODS HTML file=f1;

01/20157 To change the style of output: ODS HTML style=beige; When ready to actually save your output file, place this statement at the end of your code: ODS HTML close; Place an ‘ODS HTML’ at the start of your file to re-open output stream.

ODS pdf style=Normal 01/20158 ODS pdf style=Torn ODS pdf style=Journal

01/20159 HTML Output

01/ RTF Output - displayed in Word

01/ PDF Output

01/ Graphics example

01/ Graphics example

Some ODS code ODS HTML file ‘C:/mysas.html’; ods pdf file=‘C:/mysas.pdf’; ods rtf file=‘C:/mysas.rtf’; ods ps file=‘C:/mysas.ps’; proc print data=employee_data (obs=12); id idnumber; title ‘Personnel data’; run; ods _all_ close; ods listing; 01/201514

2 other ODS commands Get a list of the tables created by a Proc. Use to link data into subsequent Procs. Result is placed in ‘LOG FILE’. ODS trace on; proc freq data=t1; run; ODS trace off; 01/201515

2280 ods trace on; 2281 proc lifetest data=njb1; 2282 time ftime*vstatus(0); 2283 run; Output Added: Name: ProductLimitEstimates Label: Product-Limit Estimates Template: Stat.Lifetest.ProductLimitEstimates Path: Lifetest.Stratum1.ProductLimitEstimates Output Added: Name: Quartiles Label: Quartiles of the Survival Distribution Template: Stat.Lifetest.Quartiles Path: Lifetest.Stratum1.TimeSummary.Quartiles /201516

Output Added: Name: Means Label: Mean Template: Stat.Lifetest.Means Path: Lifetest.Stratum1.TimeSummary.Means Output Added: Name: SurvivalPlot Label: Survival Curve Template: Stat.Lifetest.Graphics.ProductLimitSurvival Path: Lifetest.Stratum1.SurvivalPlot Output Added: Name: CensoredSummary Label: Censored Summary Template: Stat.Lifetest.CensoredSummary Path: Lifetest.CensoredSummary /201517

2 other ODS commands Produce graphical output. Output varies depending the Proc. ODS GRAPHICS ON; PROC LIFETEST DATA=allison.myel PLOTS=S; TIME dur*status(0); RUN; ODS GRAPHICS OFF; 01/201518

01/ Data for the Myelomatous data set, Allison

01/ DATA myel; INPUT dur status treat renal; DATALINES; ; run; SAS programme to read the Data for the Myelomatous data set, Allison

01/ PROC LIFETEST DATA=myel; TIME dur*status(0); RUN; Proc Lifetest ; Some Important Options DATA = SAS-data-set OUTSURV = data set containing survival estimates METHOD = KM/PL (Kaplan-Meier); LIFE (actuarial) PLOTS = S (survival); LS (log-survival); LLS (log-log survival); H (hazard)

01/201522

01/201523

01/ libname allison 'C:/allison_2010/data_sets'; ODS GRAPHICS ON; ODS HTML style=statistical; PROC LIFETEST DATA=allison.myel PLOTS=S; TIME dur*status(0); RUN; ODS HTML close; ODS GRAPHICS OFF;

Aside re: ‘plots’ To get more than one plot, place the request in brackets: proc lifetest data=allison.myel plots=(s,h,lls) 01/201525

01/201526

01/ libname allison 'C:/allison_2010/data_sets'; ODS GRAPHICS ON; ODS HTML style=statistical; PROC LIFETEST DATA=allison.myel PLOTS=S(NOCENSOR ATRISK CL); TIME dur*status(0); RUN; ODS HTML close; ODS GRAPHICS OFF;

01/201528

01/ libname allison 'C:/allison_2010/data_sets'; ODS GRAPHICS ON; ODS HTML style=statistical; PROC LIFETEST DATA=allison.myel PLOTS=S(NOCENSOR ATRISK CL CB=EP); TIME dur*status(0); RUN; ODS HTML close; ODS GRAPHICS OFF;

01/201530

01/ libname allison 'C:/allison_2010/data_sets'; PROC LIFETEST DATA=allison.myel OUTSURV=a; TIME dur*status(0); RUN; Proc Print data=a; Run;

01/201532

01/ libname allison 'C:/allison_2010/data_sets'; ODS OUTPUT ProductLimitEstimates=a; PROC LIFETEST DATA=allison.myel; TIME dur*status(0); RUN; Proc Print data=a; Run;

01/201534

Reading data from a text file into SAS 01/201535

01/ Sample Data (as given in file to be read)

01/ Sample Data (showing columns) Formats for data Col 1, F2.0 Col 4, F2.0 Col 7, F1.0

01/ Code to read in data. filename in ‘C:\data\sample1.txt’; data njb1; infile in; ID survtime status 1. ; run; proc print data=njb1 (obs=20); run;

01/201539