Time Contour Plots. David J. Corliss Magnify Analytic Solutions, Detroit, MI

Similar documents
Paper Time Contour Plots. David J. Corliss, Wayne State University / Physics and Astronomy

SAS/GRAPH Introduction. Winfried Jakob, SAS Administrator Canadian Institute for Health Information

Tips to Customize SAS/GRAPH... for Reluctant Beginners et al. Claudine Lougee, Dualenic, LLC, Glen Allen, VA

Chapter 13 Introduction to Graphics Using SAS/GRAPH (Self-Study)

The Evolution of a SAS/GRAPH Application Jenine Eason, AutoTrader.com, Atlanta, GA

Plot Your Custom Regions on SAS Visual Analytics Geo Maps

CHAPTER 1 Introduction to SAS/GRAPH Software

ABC s of Graphs in Version 8 Caroline Bahler, Meridian Software, Inc.

Creating Population Tree Charts (Using SAS/GRAPH Software) Robert E. Allison, Jr. and Dr. Moon W. Suh College of Textiles, N. C.

The G3GRID Procedure. Overview CHAPTER 30

Something for Nothing! Converting Plots from SAS/GRAPH to ODS Graphics

Creating Regional Maps with Drill-Down Capabilities Deb Cassidy Cardinal Distribution, Dublin, OH

Picturing Statistics Diana Suhr, University of Northern Colorado

From Getting Started with the Graph Template Language in SAS. Full book available for purchase here.

A Juxtaposition of Tables and Graphs Using SAS /GRAPH Procedures

Figure 1. Paper Ring Charts. David Corliss, Marketing Associates, Bloomfield Hills, MI

The GREMOVE Procedure

Paper S Data Presentation 101: An Analyst s Perspective

Statistical Tables and Graphs

Graphical Techniques for Displaying Multivariate Data

Effective Forecast Visualization With SAS/GRAPH Samuel T. Croker, Lexington, SC

The GSLIDE Procedure. Overview. About Text Slides CHAPTER 27

SAS Graphs in Small Multiples Andrea Wainwright-Zimmerman, Capital One, Richmond, VA

Data Driven Annotations: An Introduction to SAS/GRAPH s Annotate Facility

Multiple Graphical and Tabular Reports on One Page, Multiple Ways to Do It Niraj J Pandya, CT, USA

SparkLines Using SAS and JMP

VERY LARGE TELESCOPE 3D Visualization Tool Cookbook

SAS Visual Analytics 8.2: Getting Started with Reports

Charts in Excel 2003

Tips on JMP ing into Mixture Experimentation

Working with Charts Stratum.Viewer 6

ODS for PRINT, REPORT and TABULATE

Know What You Are Missing: How to Catalogue and Manage Missing Pieces of Historical Data

Points Lines Connected points X-Y Scatter. X-Y Matrix Star Plot Histogram Box Plot. Bar Group Bar Stacked H-Bar Grouped H-Bar Stacked

Organisation and Presentation of Data in Medical Research Dr K Saji.MD(Hom)

Creating Graphs Using SAS ODS Graphics Designer

hvpcp.apr user s guide: set up and tour

The GANNO Procedure. Overview CHAPTER 12

Abstract. Introduction

SAMLab Tip Sheet #4 Creating a Histogram

Paper SIB-096. Richard A. DeVenezia, Independent Consultant, Remsen, NY

NOTES TO CONSIDER BEFORE ATTEMPTING EX 1A TYPES OF DATA

MATH 117 Statistical Methods for Management I Chapter Two

Six Cool Things You Can Do In Display Manager Jenine Milum, Charlotte, NC Wachovia Bank

To make sense of data, you can start by answering the following questions:

An Introduction to Data Analysis, Statistics, and Graphing

CREATING THE DISTRIBUTION ANALYSIS

WORD Creating Objects: Tables, Charts and More

Techdata Solution. SAS Analytics (Clinical/Finance/Banking)

Getting Started. What is SAS/SPECTRAVIEW Software? CHAPTER 1

INTRODUCTION TO THE SAS ANNOTATE FACILITY

Data Annotations in Clinical Trial Graphs Sudhir Singh, i3 Statprobe, Cary, NC

New Visualization in V8.2

Report Writing, SAS/GRAPH Creation, and Output Verification using SAS/ASSIST Matthew J. Becker, ST TPROBE, inc., Ann Arbor, MI

Elixir Ad-hoc Report. Release Elixir Technology Pte Ltd

Desktop Studio: Charts. Version: 7.3

Fathom Dynamic Data TM Version 2 Specifications

Elixir Ad-hoc Report. Release Elixir Technology Pte Ltd

Using SAS/GRAPH Software to Create Graphs on the Web Himesh Patel, SAS Institute Inc., Cary, NC Revised by David Caira, SAS Institute Inc.

In this assignment, students will analyze commuter statistics for counties across the United States from 2006 to 2010.

Want Quick Results? An Introduction to SAS/GRAPH Software. Arthur L. Carpenter California Occidental Consultants

SAS Visual Analytics 8.2: Working with Report Content

SAS Web Report Studio 3.1

Interactive Graphs from the SAS System

The foundations of building Tableau visualizations and Dashboards

BUSINESS ANALYTICS. 96 HOURS Practical Learning. DexLab Certified. Training Module. Gurgaon (Head Office)

Week 2: Frequency distributions

Desktop Studio: Charts

Easing into Data Exploration, Reporting, and Analytics Using SAS Enterprise Guide

Effective Use of Column Charts

Introduction to Data Visualization Techniques Using Microsoft Excel 2016

Paper CC-016. METHODOLOGY Suppose the data structure with m missing values for the row indices i=n-m+1,,n can be re-expressed by

Web Communication Effectiveness: Design and Methods To Get the Best Out Of ODS, SAS, and SAS/ GRAPH

Excel 2010 Charts and Graphs

The Basics of Map Creation with SAS/GRAPH. Mike Zdeb School of Public Health Rensselaer, NY

Creating Forest Plots Using SAS/GRAPH and the Annotate Facility

Chapter 25 Editing Windows. Chapter Table of Contents

Clinical Data Visualization using TIBCO Spotfire and SAS

Need a Scientific Journal Ready Graphic? No Problem!

Arthur L. Carpenter California Occidental Consultants

INTERPOLATED GRADIENT FOR DATA MAPS

Elementary Statistics

Using the Health Indicators database to help students research Canadian health issues

Raw Data is data before it has been arranged in a useful manner or analyzed using statistical techniques.

Alpy 600 Mixed Mode Calibration

Error-Bar Charts from Summary Data

Principal Component Image Interpretation A Logical and Statistical Approach

Loading Data. Introduction. Understanding the Volume Grid CHAPTER 2

AODstats. Guide to using the Victorian data maps. Powered by StatPlanet

JMP Clinical. Getting Started with. JMP Clinical. Version 3.1

Getting Started with the SGPLOT Procedure

Econ 2148, spring 2019 Data visualization

Euroopa Liit Euroopa Sotsiaalfond. Eesti tuleviku heaks. PC-Axis User Instructions

ODS The output delivery system

Decimals should be spoken digit by digit eg 0.34 is Zero (or nought) point three four (NOT thirty four).

Purpose: This chapter demonstrates how to create pie charts, and discusses some of the issues to consider when deciding whether to use a pie chart.

Innovative Graph for Comparing Central Tendencies and Spread at a Glance

It s Not All Relative: SAS/Graph Annotate Coordinate Systems

Preparing for Data Analysis

Effects of PROC EXPAND Data Interpolation on Time Series Modeling When the Data are Volatile or Complex

Transcription:

Time Contour Plots David J. Corliss Magnify Analytic Solutions, Detroit, MI ABSTRACT This new SAS tool is two-dimensional color chart for visualizing changes in a population or system over time. Data for one point in time appear as a thin horizontal band of color. Bands for successive periods are stacked up to make a twodimensional, with the vertical direction showing changes over time. As a system evolves over time, different kinds of events have different characteristic patterns. Creation of Time Contour Plots is explained step by step. Examples are given in astrostatistics, biostatistics, econometrics and demographics. Keywords: Data Visualization, PROC CONTOUR, Time Series Analysis INTRODUCTION Time Contour Plots, as described in this paper, were first developed in the field of statistical astrophysics (Kaufer et al., 1996). Known as Dynamical Spectra, they are used to graphically display physical characteristics of stars that vary with across different wavelengths of light and by time. In these plots, it is conventional to place the wavelength on the horizontal axis with time of the vertical axis with the values of the physical characteristic to be plotted represented by a color value. Astrophysicists often create these plots using IDL, a data visualization software package from Excelis VIS that is little known outside the astrophysics community. Also, the usual presentation format in these journals plots time on the vertical axis while some may prefer time on the horizontal axis. In this paper, Time Contour Plots appear in SAS or the first time. A general presentation is given, applicable to many sciences, with an option for placing time on the either the vertical or horizontal axis. AN EXAMPLE OF TIME CONTOUR PLOT (km/s) DATE COUNTER 1

In this example, the date of an observation is shown on the horizontal axis. The velocity of a stream of gas flowing outward from a star is plotted on the vertical axis, with the amount of gas displayed by a color value. (Properly speaking, the color is the fraction of light absorbed by the gas at each wavelength this is proportional to the mass volume.) A darker color indicates a larger amount of gas flowing. So, the dark area on the left side of the plot indicates a large amount of gas erupting from the surface of the star between dates 2449630 and 2449650 and moving at a very high velocity more than 100 km/s. To astronomers, this pattern is diagnostic of specific type of stellar eruption known as a High Velocity Absorption event. The same plots may be employed in others areas of research to identify events in time by their signature patterns. The following plot presents an example in biometrics, where US census bureau data is used to plot age at time of death, with the color value giving the mortality rate for a given age for each year (horizontal scale) from 1860 through 1910. The high mortality of the aged is plainly visible but careful examination will reveal more information. The infant mortality rate is given by the thin line of color at the bottom of the chart. In general, the color gradually gets lighter over time, reflecting a reduction in the infant mortality rate. However, the dark red points from 1905 1907 indicate an epidemic increasing the mortality of children at the time. 2

In this example from risk analysis, the amount of loss over time due to credit loss is plotted against risk. COST OF LOSS BY RISK SCORE 1960 1970 1980 1990 2000 2010 COST INCURRED AT LOSS ($100,000) In the next example, from econometrics, trends in stock prices are plotted. The sharp color changes at the bottom reflect the greater volatility near the bottom of the S&P 500 index compared to those stocks at the top. 3

Despite the unconventional appearance, this example is actually a map. The horizontal axis plots the first two digits of the zip code, as recorded by the Census Bureau. This is a dynamical map, showing changes in time of a demographic variable. New England New Jersey NY PA Mid-Atlantic Southeast Great Lakes North Central Central Plains South Central Mountain Pacific % of Population PRESENTATION OPTIONS Time Contour Plots are contour plots produced in SAS Graph with PROC GCONTOUR. As such, the values of three independent continuous variables are plotted. The user may choose which axis to use for the time value. In the example below, time is vertical on the left with a proportional data scale. On the right, the time is on the horizontal with a natural time scale. The user will need to select which options best serve the situation at hand. km/s 4 10/1/94 11/1/94 12/1/94 1/1/95 2/1/95 3/1/95 4/1/95

BINNING Contour plots consist of a mosaic of small rectangles, each of which is assigned a color value. The data used to create the plot, while many-valued, is actually discrete rather than continuous. As a result, it may be necessary to bin continuous variables on the horizontal and vertical axes before creating the plot: /* Binning on the vertical (non-temporal axis) */; data work.flux; set hr_1040.flux_h_alpha_cc_flat; wavelength = round(wavelength,0.1); proc sort data=work.flux; by obs_date wavelength; proc univariate data=work.flux noprint; var flux; by obs_date wavelength; output mean=flux out=work.flux; /* Binning on the temporal axis */; proc sort data=work.flux; by wavelength period; proc univariate data=work.flux noprint; var flux; by wavelength period; output mean=flux out=work.flux; data work.flux; set work.flux; obs_date = mdy(9,18,1994) + (2 * period) - 1; julian_date = obs_date + 2436935; jd_minus_24e5 = julian_date - 2400000; CREATION OF A BASIC CONTOUR PLOT Contour plots are created in SAS Graph using PROC GCONTOUR. Three variables are plotted, with the vertical axis first, the horizontal axis second and the contour value listed last: 5

goptions reset=all border; proc gcontour data=work.plot_data; plot age_at_death * birth_year = risk; quit; Here is the result. As this point, the plot looks like an ordinary contour plots, such as are used to represent physical geography, with lines denoting the contour profiles: The title, legend, description of the axes and other details are coded in the usual way in SAS graph: goptions reset=all border; title1 'MORTALITY RATE BY AGE AND YEAR OF BIRTH'; legend1 label=none value=(justify=left 'TEXT 1' 'TEXT 2' 'TEXT 3' 'TEXT 4') footnote j=r height=1.0 font=swiss 'David Corliss 5/17/2011'; goptions colors=(black grey cx700000 cxa50021 cxcc0000 cxff0000 cxff5050 cxff7c80 cxff9999 cxffcccc cxffffff); axis1 order=(1860 to 1910 by 10) label=('birth YEAR'); axis2 order=(0 to 100 by 10) label=('age AT DEATH'); proc gcontour data=work.plot_data; plot age_at_death * birth_year = risk; / haxis = axis1 vaxis = axis2 ; quit; 6

MORTALITY RATE BY AGE AND YEAR OF BIRTH Specifying the contour levels in PROC GCONTOUR: goptions reset=all border; title1 'MORTALITY RATE BY AGE AND YEAR OF BIRTH'; legend1 label=none value=(justify=left 'TEXT 1' 'TEXT 2' 'TEXT 3' 'TEXT 4') footnote j=r height=1.0 font=swiss 'David Corliss 5/17/2011'; goptions device = png /* device = png active-x ignores the levels statement */ colors=(black grey cx700000 cxa50021 cxcc0000 cxff0000 cxff5050 cxff7c80 cxff9999 cxffcccc cxffffff); axis1 order=(1860 to 1910 by 10) label=('birth YEAR'); axis2 order=(0 to 100 by 10) label=('age AT DEATH'); proc gcontour data=work.plot_data; plot age_at_death * birth_year = risk; / levels = 0.00 to 0.15 by 0.015 haxis = axis1 vaxis = axis2 ; 7

quit; MORTALITY RATE BY AGE AND YEAR OF BIRTH The most important step in creating a time contour plot are the pattern and join options, changing the representation of contours from lines to a mosaic of solidly-colored rectangles: title1 'MORTALITY RATE BY AGE AND YEAR OF BIRTH'; legend1 label=none value=(justify=left 'TEXT 1' 'TEXT 2' 'TEXT 3' 'TEXT 4') footnote j=r height=1.0 font=swiss 'David Corliss 5/17/2011'; goptions device = png /* device = png active-x ignores the levels statement */ colors=(black grey cx700000 cxa50021 cxcc0000 cxff0000 cxff5050 cxff7c80 cxff9999 cxffcccc cxffffff); axis1 order=(1860 to 1910 by 10) label=('birth YEAR'); axis2 order=(0 to 100 by 10) label=('age AT DEATH'); proc gcontour data=work.plot_data; plot age_at_death * birth_year = risk; 8

quit; / pattern join levels = 0.00 to 0.15 by 0.015 haxis = axis1 vaxis = axis2 ; MORTALITY RATE BY AGE AND YEAR OF BIRTH A SAS ODS statement is used to create the final plot: title1 'MORTALITY RATE BY AGE AND YEAR OF BIRTH'; legend1 label=none value=(j=left 'TEXT 1' 'TEXT 2' 'TEXT 3' 'TEXT 4') footnote j=r height=1.0 font=swiss 'David Corliss 5/17/2011'; ods listing close; ods html path='/home/sas/permanent/djc/sas' file='test.html'; goptions device = png /* active-x ignores the levels statement */ 9

colors=(black grey cx700000 cxa50021 cxcc0000 cxff0000 cxff5050 cxff7c80 cxff9999 cxffcccc cxffffff); axis1 order=(1860 to 1910 by 10) label=('birth YEAR'); axis2 order=(0 to 100 by 10) label=('age AT DEATH'); proc gcontour data=work.plot_data; plot age_at_death * birth_year = risk; / pattern join levels = 0.00 to 0.15 by 0.015 haxis = axis1 vaxis = axis2; quit; ods html close; ods listing; MORTALITY RATE BY AGE AND YEAR OF BIRTH 10

CONCLUSION The GCONTOUR in SAS Graph can be modified to produce contour plots for data visualization in time series analysis. A time value is plotted with two other continuous variables. The JOIN and PATTERN statements convert the usual contour plot into a mosaic of solidly-colored rectangles. Using these plots, different types of events may identified by the distinctive pattern made in the diagram. In addition to the original applications in astrostatistics, these plots find use in many areas, including biostatistics, econometrics, demographics and other applications. REFERENCES Kaufer, A., et al., 1996, Astronomy and Astrophysics, 305, 887K ACKNOWLEDGMENTS SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: David J Corliss Magnify Analytic Solutions 1 Kennedy Square, Suite 500 Detroit, MI 48224 Phone: 313.202.6323 Email: dcorliss@magnifyas.com 11