Unformatted text preview:

Slide 1RobbinsWhy Do Data Visualization?Fisher’s Plot Data Reported in ClevelandScatter Plot for CorrelationsBad ThingsGeneralTufte is a God to many.Example Bar ChartInk-to-Information RatioClevelandPie is bad.Don’t Explode!Forbidden Donut….Stacking is BadWow, a cinnamon roll plot!What is a good graphic?Avoid ThinkingBivariate Comparisons with LinesPlot TypesBar ChartsSAS Bar ChartsHow to do it?Slide 24The GUI is SolidSaving the Graphic for PublicationSlide 27Default Output and GraphicsTypes of ImagesI Typically Use HTMLUseful ods graphics OptionsWhat is ODS?Slide 33ODS GraphicsOld vs. New ProceduresSlide 36New Graphics Statistical Graphics ProcsPlot TypesSlide 39Slide 40If you want to use RIf you use a PC, also get PERL and Tinn-RR HelpBrowseAdditional LibrariesWaffle PlotsContinuous OutcomesSlide 48Slide 49Slide 50ViolinGrouped Categorical DataFourfold PlotsSlide 54Slide 55Mosaic PlotsSlide 57Slide 58Grouped Continuous VariablesSlide 60Slide 61Slide 62Slide 63Slide 64Slide 65Slide 66Side by Side Violin PlotsScatter PlotJittered PlotJitter vs. SunflowersOrdinary Least Squares RegressionBisquareLoess and SplinesSlide 74Specialized PlotsSlide 76Deviance PlotODS Graphics EditorSlide 79WYSIWYG EditingSlide 81Slide 82Slide 83Too Many GraphicsSlide 85Slide 86Slide 87Splitting a GridSlide 89Beyond the Basic Univariate plotsNew Graphics Statistical Graphics Procsproc sgPlotSlide 93Slide 94Slide 95Slide 96GridsSlide 98Spaghetti PlotsSlide 100Slide 101Slide 102Slide 103Slide 1041Graphics in EG and RHRP223 – 2009November 16th, 2009 Copyright © 1999-2009 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.2Robbins•Creating More Effective Graphics by Naomi Robbins is a wonder ful book showing the right and wrong ways to visualize scientific data. Read it when you have an afternoon off. It is an ideal read on a transcontinental flight.3Why Do Data Visualization?•Well designed pictures will show you the details and the whole pattern in your data.•Numeric descriptions can easily hide important patterns.•Some patterns are hard to detect in tables.–Whenever data is reported over time or locations, you need art.YOU CAN LEARN A LOT BY JUST LOOKING.-Yogi Berra4Fisher’s Plot Data Reported in ClevelandBased on code written by Robert Allison at SAS InstituteYear 1 Year 250510150 5 10 15 200510150 5 10 15 200510150 5 10 15 200510150 5 10 15 20Scatter Plot for CorrelationsAll have r2 = .67Anscombe 1973, Graphs in Statistical Analysis6Bad Things•First, I want to talk about bad graphics that I frequently see.–3d–Pie–Donuts–Stacked graphics7General•3D graphics–Don’t, Don’t, Don’tWhile the SAS implementation of 3D graphics is relatively good, don’t use 3D effects, unless you are measuring something in 3D. Even then, don’t.8Tufte is a God to many.•The empiricist in me is very nervous about the amount of pontificating in his books…–I want to have evidence-based advice.•His best advice is to put no extra ink on the page.–Think about the ink-to-information ratio.–Remove all chart junk.Note: the irony of the chart junk on this slide….9Example Bar ChartSerum Samples in Each TrimesterYou can remove ink rather than adding .10Ink-to-Information Ratio•How much ink for seven numbers?Based on Soukup & Davidson, 2002 Visual Data Mining11Cleveland•If you want to know how to do scientific visualization, you must read William Cleveland’s work.–He attempted to quantify what makes a good graphic good.•His early work on graphics is one of the reasons why R/S-plus is taking over the statistical world.12Pie is bad.•Work by Cleveland (and experimental psychologists) suggests that:–people are bad at judging the relative magnitude of angles –if you twist the rotation of the pie you can cause people to systematically misjudge the size of the angles–a 3rd dimension makes judgment worse•If you get a glossy handout with a 3D pie, assume someone is lying to you.•Don’t use them.13Don’t Explode!•This exploded 3D pie (brought to you by Excel) is nearly useless for judging amounts.Totaltweakedtwistedwrecked14Forbidden Donut….•Donut plots have the same problems as pies (if not worse) ….15Stacking is Bad•Cleveland also quantified the fact that people are bad at judging the relative height of stacked data.16Wow, a cinnamon roll plot!•Good luck making rapid judgments using this stacked 3D pie.17What is a good graphic?•Don’t make your audience think unnecessarily!•Minimize the amount of ink on the page.–This needs to be studied.•Show the central tendency and the var iability.•Plot the quantity (inference) that you want people to notice.•Be sure colorblind people can understand it.–Use a black and white photocopier and make sure you can distinguish all groups.18Avoid Thinking•But labels on the graphic directly instead of using a key.•If you want people to compare the difference between two lines, plot the difference, not the two lines.19Bivariate Comparisons with Lines•People are extremely bad at judging the distance between two curves. Never ask people to judge up and down (vertical) distances between curves.Based on: Robbins Creating More Effective Graphs, 2005The distance between the two curves is the same at all points.20Plot Types•Univariate (one variable)–Categorical variables•Bar charts•Dot plots•Waffle plots–Continuous variables•Histogram•Box plot•Violin plots21Bar Charts•The ink-to-information ratio is lousy.•A one dimensional quantity is being “expanded” into two dimensions. –Doubling of the amount corresponds to how much of an increase in area?22SAS Bar Charts•SAS makes the reader do extra work by rotating the axis labels in ActiveX images. •They pointlessly include variable labels by default.23How to do it?Notice you can Edit the data and apply filters.You can right click on variables and apply user-defined formats off the Properties dialog.24First create the format.In the Data windowpane of the Bar Chart GUI, right click on the variable and change the format to the User Defined format you had created.25The GUI is Solid•My only complaints are that the rotate grouping values text does not work (position in


View Full Document

Stanford HRP 223 - Graphics in EG and R

Download Graphics in EG and R
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Graphics in EG and R and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Graphics in EG and R 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?