Picturing Statistics Diana Suhr, University of Northern Colorado

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

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

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

The Plot Thickens from PLOT to GPLOT

Chapter 25 PROC PARETO Statement. Chapter Table of Contents. OVERVIEW SYNTAX SummaryofOptions DictionaryofOptions...

The GANNO Procedure. Overview CHAPTER 12

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

CHAPTER 1 Introduction to SAS/GRAPH Software

Archer R. Gravely, UNC Asheville, Asheville, NC

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

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

Interactive Graphs from the SAS System

Creating Maps in SAS/GRAPH

The GSLIDE Procedure. Overview. About Text Slides CHAPTER 27

A Juxtaposition of Tables and Graphs Using SAS /GRAPH Procedures

ODS The output delivery system

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

Chapter 1 Introduction. Chapter Contents

SAS/GRAPH Blues? SAS/FRAME to the Rescue Kathy Shelley, Iowa State University, Ames, Iowa

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

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

Intermediate SAS: Statistics

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

The GTESTIT Procedure

INTRODUCTION TO THE SAS ANNOTATE FACILITY

New Visualization in V8.2

SAS: Proc GPLOT. Computing for Research I. 01/26/2011 N. Baker

Modifying Graphics in SAS

Coders' Corner. Paper ABSTRACT GLOBAL STATEMENTS INTRODUCTION

SUGI 29 Posters. Paper A Group Scatter Plot with Clustering Xiaoli Hu, Wyeth Consumer Healthcare., Madison, NJ

The GREMOVE Procedure

IMPROVING A GRAPH USING PROC GPLOT AND THE GOPTIONS STATEMENT

Making Presentations More Fun with DATA Step Graphics Interface (DSGI) Hui-Ping Chen, Eli Lilly and Company, Indianapolis, Indiana

Using MACRO and SAS/GRAPH to Efficiently Assess Distributions. Paul Walker, Capital One

Section 2-2 Frequency Distributions. Copyright 2010, 2007, 2004 Pearson Education, Inc

Coders' Corner. Scaling Mount GCHART: Using a MACRO to Dynamically Reset the Scale Nina L. Werner, Dean Health Plan, Inc., Madison, WI.

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

Chapter 27 HBAR Statement. Chapter Table of Contents

SAS Training Spring 2006

Introduction to ODS Graphics for the Non-Statistician

A SAS Macro to Generate Caterpillar Plots. Guochen Song, i3 Statprobe, Cary, NC

SAS CLINICAL SYLLABUS. DURATION: - 60 Hours

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

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

Converting Annotate to ODS Graphics. Is It Possible?

SAS Visual Analytics 8.2: Getting Started with Reports

Getting Started with the SGPLOT Procedure

Math 227 EXCEL / MEGASTAT Guide

The G3GRID Procedure. Overview CHAPTER 30

Usinq the VBAR and BBAR statements and the TEMPLATE Facility to Create side-by-side, Horizontal Bar Charts with Shared Vertical Axes Labels

The GIMPORT Procedure

Is your picture worth a thousand words? Creating Effective Presentations with SAS/GRAPH

Choosing the Right Procedure

Arthur L. Carpenter California Occidental Consultants

PART I: USING SAS FOR THE PC AN OVERVIEW 1.0 INTRODUCTION

Introduction to SAS/GRAPH Statistical Graphics Procedures

Using SAS/GRAPH Software to Create Graphs on The Web Himesh Patel, SAS Institute Inc., Cary, NC

Lab #3. Viewing Data in SAS. Tables in SAS. 171:161: Introduction to Biostatistics Breheny

Multiple Forest Plots and the SAS System

PharmaSUG 2012 Paper CC13

Annotate Dictionary CHAPTER 11

Applied Regression Modeling: A Business Approach

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

SparkLines Using SAS and JMP

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

MATH 117 Statistical Methods for Management I Chapter Two

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

Top Award and First Place Best Presentation of Data Lan Tran-La. Scios Nova, Inc. BLOOD PRESSURE AND HEART RATE vs TIME

New SAS/GRAPH Features. Jack Bulkley, SAS Institute Inc. GPLOT INTRODUCTION

Chapter 25 Editing Windows. Chapter Table of Contents

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

OS/390 DASD I/O Drill Down Computer Performance Chart Using ODS SAS/GRAPH & MXG Software

Analysis of Complex Survey Data with SAS

Information Visualization

Applications Development. Paper 24-27

Week 05 Class Activities

Creating a Basic Chart in Excel 2007

a. divided by the. 1) Always round!! a) Even if class width comes out to a, go up one.

2.1: Frequency Distributions and Their Graphs

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

ABC Macro and Performance Chart with Benchmarks Annotation

SAS/GRAPH 9.4: Java Applets and ActiveX Control User s Guide

2.1: Frequency Distributions

Creating Forest Plots Using SAS/GRAPH and the Annotate Facility

Chapters 18, 19, 20 Solutions. Page 1 of 14. Demographics from COLLEGE Data Set

Elementary Statistics

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

Chapter 3. Determining Effective Data Display with Charts

Introduction to SAS. I. Understanding the basics In this section, we introduce a few basic but very helpful commands.

Data Explore Matrix Quality Control by Exploring and Mining Data in Clinical Study

SPSS. (Statistical Packages for the Social Sciences)

Making Science Graphs and Interpreting Data

Graphical Presentation for Statistical Data (Relevant to AAT Examination Paper 4: Business Economics and Financial Mathematics) Introduction

Appendix A: Graph Types Available in OBIEE

INTRODUCTION TO SAS/GRAPH

+ Statistical Methods in

The basic arrangement of numeric data is called an ARRAY. Array is the derived data from fundamental data Example :- To store marks of 50 student

How to annotate graphics

Using SAS/GRAPH Software to Analyze Student Study Habits. Bill Wallace Computing Services University of Saskatchewan

Innovative Graph for Comparing Central Tendencies and Spread at a Glance

Transcription:

Picturing Statistics Diana Suhr, University of Northern Colorado Abstract Statistical results could be easier to understand if you visualize them. This Hands On Workshop will give you an opportunity to program SAS statistical procedures (e.g., PROC FREQ, PROC MEANS, PROC CORR) and learn to illustrate the results with PROC GCHART/PROC GPLOT. Comparisons will be shown between PROC GCHART, PROC CHART, PROC PLOT, and PROC GPLOT. Introduction Understanding statistics can be difficult. Visual representations (graphs, plots) sometimes make statistical results easier to understand. This hands on workshop will give you an opportunity to learn ways to picture statistics. Syntax for PROC CHART, PROC GCHART, PROC PLOT, and PROC GCHART is shown. Examples illustrate frequencies, correlations, and means. PROC CHART PROC CHART produces vertical and horizontal bar charts (histograms), block charts, pie charts, and star charts (SAS Procedures, 1990). PROC CHART produces charts for both numeric and character variables. PROC CHART automatically selects intervals. However, interval midpoints can be explicitly defined. PROC CHART syntax is PROC CHART <options>; <options are DATA= FORMCHAR <list> formchar LIP= > BY variable(s); VBAR variable(s) <options>; HBAR variable(s) <options>; BLOCK variable(s) <options>; PIE variable(s) <options>; STAR variable(s) <options>; See SAS Procedures Guide and SAS Online Docs for explanations of statement specific options. Standard and statement-specific options include ASCENDING AXIS= CFREQ CPERCENT DESCENDING DISCRETE FREQ FREQ=variable GROUP=variable G100 LEVELS=# of midpoints MEAN MIDPOINTS=midpoint list MISSING NOHEADER NOSPACE NOSTATS NOSYMBOL NOLEGEND NOZEROS PERCENT REF=value SUBGROUP=variable SUM SUMVAR=variable SYMBOL= character-list TYPE=(CFREQ CPERCENT FREQ MEAN) PERCENT SUM. The types of charts are VBAR for vertical bar chart HBAR for horizontal bar chart BLOCK for block chart PIE for pie chart STAR for star chart. The appearance of the chart can be changed by specifying The type of chart Summary measures Grouping variables Line-size, page-size, form-character options. Types of statistics that can be presented are TYPE=FREQ for frequency counts TYPE=PCT for percentages TYPE=CFREQ for cumulative percentages TYPE=CPCT for cumulative percentages TYPE=SUM for totals TYPE=MEANS for averages. Options to control grouping are DISCRETE groups numeric variables as categorical variables GROUP= groups variable values SUBGROUP= determines subgroups MIDPOINTS= uses interval midpoints SUMVAR= names the variables to collect summaries for means, sums, or frequencies. PROC GCHART The GCHART procedure produces vertical and horizontal bar charts (also called histograms), block charts, pie and donut charts, and star charts. You can use these charts to represent pictorially a given variable value or the relationship between two or more variables or the value of a statistic calculated for one or more variables (SAS Online Doc, 1999). Syntax for PROC GCHART is PROC GCHART <options>; <options are DATA= ANNOTATE= GOUT= IMPAGEMAP= > BLOCK chart-variable(s) </options>; HBAR HBAR3D VBAR VBAR3D chart-variables </options>; PIE PIE3D DONUT chart-varible(s) </options>; STAR chart-varible(s) </options>; PROC PLOT PROC PLOT plots the values of two variables for each observation. To produce a plot, specify which variables to plot. PROC PLOT syntax is PROC PLOT <options> <options are DATA= UNIFORM NOMISS NOLEGEND VTOH= FORMCHAR= HPERCENT= VPERCENT= >; BY variable(s); PLOT vertical variable horizontal variable <options>; <options are HAXIS= VAXIS= HZERO VZERO HREVERSE VREVERSE HEXPAND VEXPAND HSPACE= VSPACE= HREF= VREF= HREFCHAR= VREFCHAR= BOX HPOS= VPOS= OVERLAY CONTOUR S<level>= SLIST= > PROC GPLOT The GPLOT procedure produces two-dimensional graphs that plot one variable against another within a set of coordinate axes. The coordinates of each point on the plot correspond to two variable values in an observation of the input data set. PROC GPLOT produces plots for character variables, as well as numeric variables. Graphs are automatically scaled to the values of the data, although scaling can be controlled with options or with AXIS statements. The GPLOT procedure can produce

several kinds of graphs: overlays plots; plots against one or two vertical axes; bubble plots in which circles of varying proportions representing the values of a third variable are plotted on the vertical and horizontal axes; plots with a legend; scatter graphs, needle plots, and plots with simple or spline-interpolated lines (SAS Online Doc, 1999). The syntax for PROC GPLOT is PROC GPLOT <options > <options are DATA= ANNOTATE= GOUT= UNIFORM IMAGEMAP= > BUBBLE plot-request(s) </options>; BUBBLE2 plot-request(s) </options >; PLOT plot-request(s) </options >; PLOT2 plot-request(s) </options >; Graphics Options A few graphics options can be set for PROC GCHART AND PROC GPLOT so that your results match the graphics shown in the examples (SAS/GRAPH Software, 1990). gooptions gunit=pct cback=white htitle=6 htext=3 ftext=swissb ctext=blue; gunit= sets the character height units measurement to percentage of display height cback= sets monitor background color to white htitle= sets the first title text height to 6 (in units of display height percent) htext= sets graph text height to 3 (in unites of display height percent) ftext= sets graph text font to swissb ctext= sets graph text color to blue Options for PROC GCHART AND PROC GPLOT may be reset to default values by using goptions reset = all. +++ +++++++++++! #"!#"#!# ++++++++$$%!" %&!!!!,----- %!!!$!!! proc chart data = rawsub; vbar deg; +++++!!-+++++ +++++ $!-++++++++++!-++++++++++!-++++++++++ %!-++++++++++ +++++ +++++ +++++, hbar deg; Examples Frequencies count the values of a variable. The PROC FREQ procedure produces a frequency table. A visual representation produced with PROC CHART or PROC GCHART can illustrate frequencies. proc freq data = rawsub; tables deg;! "!##"#!# $$ %&%!"!!!! '(() vbar deg; proc chart data = rawsub; hbar deg; Hbar produces a histogram with frequencies.

hbar3d deg; vbar deg/subgroup=gend; block deg; vbar deg/group=gend; proc freq; tables gender deg;. / ----.# &#% %&$%&%&!"% $%$! """"$ ---- #$#& % &!% $$ "%" %&% "$"$" % ----! $$%!" "!# %&!!!! '(() Title height=5 pct Research Study#95 ; Title2 font=simplex group by gender ; Pattern1 value=right color=blue; Pattern2 value=x3 color=red; vbar deg / subgroup=gend;

vbar deg / group=gend; vbar3d deg / subgroup=gend; Correlations Correlation measures the strength of the linear relationship between two variables. If one variable can be expressed exactly as a linear relationship of another variable, then the correlation is 1 (directly related) or 1 (inversely related). A correlation of 0 indicates no relationship. PROC CORR computes correlation coefficients. proc corr; var s5 s7; 0 (..(12)%!$ 3445!6)! ("(# ("!!!!!!$ 7!!! (#!$!!!!! 7!!! proc plot; plot s5s7; vbar deg3d / group=gend; plot s5s7; proc corr; var yrstch yrscoach;

0 (..( 3445!6)! 2.0(( proc sort data = rawsub; (( (!!!!!8!%!!!! &$& (8!%!!!!!!!!! &%! Graphing mean values Means (averages) may be calculated and graphed for groups with the following code. by grp; proc means noprint; by grp; var s2 s3 s7 s9; output out=mnfl mean=m2 m3 m7 m9; proc gplot data = mnfl; plot m2grp; plot yrstchyrscoach; symbol1 interpol=join; proc gplot data=mnfl; plot m2grp; proc plot; plot yrstchyrscoach; plot m2grp m3grp; The code above produces two plots. If you want one plot, an overlay plot, use the code below. plot m2grp m3grp/overlay; Options haxis and vaxis can be used to change the horizontal axis and vertical axis. Try the following code and see what happens. Did the axis change? Did the axis default to a maximum value? pattern1 color=red value=solid; pattern2 color=blue value=solid; plot m2grp m3grp/overlay area=2; proc plot; plot yrstchyrscoach /haxis=0 to 50 by 2 vaxis=0 10 20 30 40 50; plot yrstchyrscoach /haxis=0 to 50 by 2 vaxis=0 10 20 30 40 50;

plot m2grp m3grp m7grp m9grp /overlay; Analysis of Variance PROC GLM can be used to determine significant differences between the means of two or more groups. The overlay plot above illustrates means of the four groups on four items. proc glm; class grp; model s2 s3 s7 s9 = grp; means grp; What now? You ve run plots or graphs and want to get the pictures into a document or a presentation. Adobe PhotoShop or Microsoft Paint will assist you. Copy from SAS and paste to PhotoShop or Paint and resize your picture. Then copy and paste into Word or Powerpoint. Conclusion Try picturing statistics with PROC PLOT, PROC GPLOT, PROC CHART, or PROC GCHART. The results will provide you with an easier way to explain your statistical results. References SAS Applications Guide, 1980 Edition, Cary, N.C.: SAS Institute. SAS/Graph Software, Version 6, First Edition. Cary, N.C.: SAS Institute, 1990. SAS Language, Version 6. Cary, N.C.: SAS Institute, 1990. SAS Language and Procedures, Version 6, First Edition. Cary, N.C.: SAS Institute, 1989 SAS OnlineDoc, Version 8, SAS/STAT User s Guide, Chapter 63. Cary, N.C.: SAS Institute, 1999. SAS Procedures, Version 6, Third Edition. Cary, N.C.: SAS Institute, 1990. About the author Diana Suhr is a Statistical Analyst in the Office of Institutional Research at the University of Northern Colorado. She earned a Ph.D. in Educational Psychology at UNC in 1999. The first programming language she learned was Fortran in 1970. She has been a SAS programmer since 1984. Contact Diana Suhr, Statistical Analyst Institutional Research University of Northern Colorado Greeley, CO 80639 970-351-2193, diana.suhr@unco.edu SAS and all other SAS Institute product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration.