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

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

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

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

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

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

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

Plot Your Custom Regions on SAS Visual Analytics Geo Maps

CHAPTER 1 Introduction to SAS/GRAPH Software

The G3GRID Procedure. Overview CHAPTER 30

SAS Visual Analytics 8.2: Getting Started with Reports

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.

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

The GSLIDE Procedure. Overview. About Text Slides CHAPTER 27

A Juxtaposition of Tables and Graphs Using SAS /GRAPH Procedures

Picturing Statistics Diana Suhr, University of Northern Colorado

The GREMOVE Procedure

MATH 117 Statistical Methods for Management I Chapter Two

Graphical Techniques for Displaying Multivariate Data

INTRODUCTION TO THE SAS ANNOTATE FACILITY

SAS Web Report Studio 3.1

The GANNO Procedure. Overview CHAPTER 12

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

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

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

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

Working with Charts Stratum.Viewer 6

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

SAMLab Tip Sheet #4 Creating a Histogram

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

Statistical Tables and Graphs

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

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

VERY LARGE TELESCOPE 3D Visualization Tool Cookbook

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

Abstract. Introduction

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

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

CREATING THE DISTRIBUTION ANALYSIS

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

Desktop Studio: Charts. Version: 7.3

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

Elixir Ad-hoc Report. Release Elixir Technology Pte Ltd

ODS for PRINT, REPORT and TABULATE

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

Creating Forest Plots Using SAS/GRAPH and the Annotate Facility

The foundations of building Tableau visualizations and Dashboards

Paper S Data Presentation 101: An Analyst s Perspective

Elixir Ad-hoc Report. Release Elixir Technology Pte Ltd

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

SAS Visual Analytics 8.2: Working with Report Content

Desktop Studio: Charts

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

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

Week 2: Frequency distributions

NOTES TO CONSIDER BEFORE ATTEMPTING EX 1A TYPES OF DATA

SparkLines Using SAS and JMP

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

Engineering Geology. Engineering Geology is backbone of civil engineering. Topographic Maps. Eng. Iqbal Marie

Elementary Statistics

INTERPOLATED GRADIENT FOR DATA MAPS

Effective Use of Column Charts

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

Super boost data transpose puzzle

Interactive Graphs from the SAS System

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

PharmaSUG Paper TT10 Creating a Customized Graph for Adverse Event Incidence and Duration Sanjiv Ramalingam, Octagon Research Solutions Inc.

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

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

An Introduction to Data Analysis, Statistics, and Graphing

Introduction to Statistical Graphics Procedures

Creating a Basic Chart in Excel 2007

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

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

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

Choosing the Right Procedure

Need a Scientific Journal Ready Graphic? No Problem!

Econ 2148, spring 2019 Data visualization

Using American FactFinder

Charts in Excel 2003

Principal Component Image Interpretation A Logical and Statistical Approach

Fathom Dynamic Data TM Version 2 Specifications

Arthur L. Carpenter California Occidental Consultants

SAVI Advanced The Basics

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

How to extract suicide statistics by country from the. WHO Mortality Database Online Tool

A Summary of the Types of Graphs Compiled by Mr. A. Caruso

Geography 281 Map Making with GIS Project Three: Viewing Data Spatially

Creating Graphs Using SAS ODS Graphics Designer

The IWSROnline User Guide 2014

hvpcp.apr user s guide: set up and tour

The Plot Thickens from PLOT to GPLOT

Select Cases. Select Cases GRAPHS. The Select Cases command excludes from further. selection criteria. Select Use filter variables

Exercise 13. Accessing Census 2000 PUMS Data

Internet/Intranet, the Web & SAS

Introduction to Data Visualization Techniques Using Microsoft Excel 2016

Innovative Graph for Comparing Central Tendencies and Spread at a Glance

SAS CLINICAL SYLLABUS. DURATION: - 60 Hours

Lab 1: Introduction to Data

Ontario Cancer Profiles User Help File

Transcription:

ABSTRACT Paper 1311-2014 Time Contour Plots David J. Corliss, Wayne State University / Physics and Astronomy 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 two-dimensional plot, 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. on the either the vertical or horizontal axis. AN EXAMPLE OF TIME CONTOUR PLOT (km/s) Figure 1. An example of time contour plot in astrophysics DATE COUNTER 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. 1

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. time. Figure 2. Mortality risk by age, birth year ccohorts. US Census Bureau data. COST OF LOSS BY RISK SCORE 1960 1970 1980 1990 2000 2010 COST INCURRED AT LOSS (x$100,000) Figure 3. In this example from risk analysis, the amount of credit loss over time is plotted against risk. 2

S&P 500 RANK CLOSING STOCK PRICE DAILY PERCENT CHANGE S&P 500 INDEX 3/1 3/8 3/15 3/22 3/29 4/5 4/12 4/19 4/23 Figure 4. In this example 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 the stocks at the top. A GEOGRAPHIC EXAMPLE New England New Jersey NY PA Mid-Atlantic Southeast Great Lakes North Central Central Plains South Central Mountain Pacific % of Population Figure 5. This is a dynamical map, showing changes in time of a demographic variable across the US. The horizontal axis plots the first two digits of the zip code, as recorded by the Census Bureau. PRESENTATION OPTIONS 3

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 10/1/94 11/1/94 12/1/94 1/1/95 2/1/95 3/1/95 4/1/95 Figure 6. An illustration of some presentation options, with a vertical, evenly-spaced time scale on the left and a horizontal, naturally (i.e., unevenly-spaced) time scale on the right. BINNING Contour plots are actually heat maps, consisting 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; 4

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; STEP-BY-STEP CREATION OF A TIME 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: goptions reset=all border; quit; Figure 7. At 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: 5

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'); / haxis = axis1 vaxis = axis2 ; quit; MORTALITY RATE BY AGE AND YEAR OF BIRTH Figure 8. A basic contour plot, with standard SAS code for the title, footnote, axes and selection of colors. 6

SPECIFYING THE CONTOUR LEVELS AND REPLACING LINES WITH SOLID COLORS 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'); / levels = 0.00 to 0.15 by 0.015 haxis = axis1 vaxis = axis2 ; quit; MORTALITY RATE BY AGE AND YEAR OF BIRTH Figure 9. A contour plot with user-defined contour levels instead of system-selected default values. 7

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'); / pattern join levels = 0.00 to 0.15 by 0.015 haxis = axis1 vaxis = axis2 ; quit; MORTALITY RATE BY AGE AND YEAR OF BIRTH Figure 10. PATTERN and JOIN statements complete the time contour plot as a mosaic of solid rectangles. 8

An ODS statement is used in creating 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 */ 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'); / pattern join quit; ods html close; ods listing; CONCLUSION levels = 0.00 to 0.15 by 0.015 haxis = axis1 vaxis = axis2; 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 CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: David J Corliss Wayne State University / Physics and Astronomy 666 Hancock St. Detroit, MI 48202 Phone: 734.837.9323 Email: david.corliss@wayne.edu, davidjcorlis@gmail.com sascommunity.org: dcorliss 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. Other brand and product names are trademarks of their respective companies. 9