A leading global CRO Systematically Reordering Axis in SAS Graph Brian Shen Web: www.ppdi.comwww.ppdi.com.

Slides:



Advertisements
Similar presentations
Better SAS Graphs or I can’t believe it’s not PowerPoint Jeff Marchand Non-Insured Health Benefits Health Canada.
Advertisements

Lesson 3 Working with Formulas.
FORMULAS & FUNCTIONS EXCEL 2. Excel Input – a collection of informational data typed into the spreadsheet Output – worksheet results Information to be.
FORMULAS & FUNCTIONS EXCEL. Input A collection of information Data typed into the spreadsheet Output Worksheet Results.
Experiments and Variables
Maths & Trig, Statistical functions. ABS Returns the absolute value of a number The absolute value of a number is the number without its sign Syntax ◦
Introduction to Excel Formulas, Functions and References.
Microsoft Office XP Microsoft Excel
Introduction to Spreadsheets. What are Uses of Spreadsheets?  Prepare budgets  Maintain student grades  Prepare financial statements  Analyze numbers.
Recursive Definitions and Structural Induction
Please turn in your Home-learning, get your notebook and Springboard book, and begin the bell-ringer! Test on Activity 6, 7 and 8 Wednesday (A day) and.
Chapter 4: Image Enhancement
1) Data Review 2) Anonymous Data Items 3) Renaming 4) Overloading 5) Introduction to Data Types 6) Basic types 7) Range and precision 8) Ada/Pascal “attributes”
Natural Numbers The Natural or counting numbers are denoted by N and are defined by:
Percentiles Def: The kth percentile is the value such that at least k% of the measurements are less than or equal to the value. I.E. k% of the measurements.
Solving One-step Inequalities. Inequalities Inequalities are similar to equations when solving. You can add, subtract, multiply or divide any amount to.
Objective: Learn to multiply and divide integers.
 Solving inequalities follows the same procedures as solving equations.  There are a few special things to consider with inequalities: ◦ We need to.
Real Numbers and Algebra
Targeted Review of Major Concepts
STAT02 - Descriptive statistics (cont.) 1 Descriptive statistics (cont.) Lecturer: Smilen Dimitrov Applied statistics for testing and evaluation – MED4.
Numeric precision in SAS. Two aspects of numeric data in SAS The first is how numeric data are stored (how a number is represented in the computer). –
Tips & Tricks MASUG02/18/2005. Multiple Graphs on One Page.
Algebra I Chapter 8/9 Notes. Section 8-1: Adding and Subtracting Polynomials, Day 1 Polynomial – Binomial – Trinomial – Degree of a monomial – Degree.
Introduction to SAS/Graph 9.2 Ken Barz Colorado Prevention Center 22Oct2009 Ken Barz Colorado Prevention Center.
Sampling Error Estimation – SORS practice Rudi Seljak, Petra Blažič Statistical Office of the Republic of Slovenia.
Introduction to SAS Macros Center for Statistical Consulting Short Course April 15, 2004.
Effective SAS greplay’ing and how to avoid stretching By David Mottershead Senior Programmer, Quanticate.
Spreadsheets 1.01  Tell me in your own words: What is a spreadsheet? What is a spreadsheet? What is their purpose? What is their purpose? Who uses them?
Significant Figure Rules RulesExamples The following are always significant Non zero digits Zeros between non zero digits Zero to the right of a non zero.
Greatest Integer/Absolute Value Functions
GUJARAT KNOWLEDGE VILLAGE Faculty Name:- Prof H.M.Patel Students Name:- SONI VISHAL THAKKER BHAVIN ZALA JAYDIP ZALA.
Data Analysis, Presentation, and Statistics
Thinking Mathematically Algebra: Equations and Inequalities 6.4 Linear Inequalities in One Variable.
Scientific Notation What is scientific Notation? Scientific notation is a way of expressing really big numbers or really small numbers. It.
SAS/GRAPH The Basics. Today’s Topics GOPTIONS GPLOT GCHART GCONTOUR G3D.
Introduction to Spreadsheets. What are Uses of Spreadsheets?  Prepare budgets  Maintain student grades  Prepare financial statements  Analyze numbers.
Resource Review Excel formula basics Demonstrate how to enter manual formulas Examine some of the available functions and their usage Discuss the.
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 16 & 17 By Tasha Chapman, Oregon Health Authority.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Statistics Descriptive Statistics. Statistics Introduction Descriptive Statistics Collections, organizations, summary and presentation of data Inferential.
CHAPTER 5: Representing Numerical Data
Solving Absolute Value Inequalities
> greater than or equal
Tell me in your own words:
Introduction to Spreadsheets
Algebra I Chapter 8/9 Notes.
Box and Whisker Plots and the 5 number summary
1.6 Solving Inequalities.
IB Mark Schemes Analysis (formerly Data Collection and Processing)
Understanding Spreadsheets
Introduction to science
Introduction to Spreadsheets
Introduction to Spreadsheets 5.00
Introduction to Spreadsheets
Graphing with Uncertainties
4.01 Spreadsheet Formulas & Functions
Physics 1 – Aug 25, 2017 P3 Challenge – Do Now (on slips of paper today) ACT Practice papers for “ACT Friday” REAL ACT questions for two passages. It will.
4.01 Spreadsheet Formulas & Functions
Introduction to Spreadsheets
Chapter 3: Selection Structures: Making Decisions
Boolean Expressions to Make Comparisons
Chapter 3: Selection Structures: Making Decisions
Introduction to Spreadsheet Terminology
Is it OK to write down all digits on your calculator?
SAS/Graph to help data Dose/Concentration consistency review
Introduction to Spreadsheets
Mathematical Formulas and Excel
Physics 1 – Aug 22, 2019 P3 Challenge – Do Now (on slips of paper)
Presentation transcript:

A leading global CRO Systematically Reordering Axis in SAS Graph Brian Shen Web:

A leading global CRO SAS default ordering for Major axis tick values is sometimes not desirable for procedures like GPLOT, GCHART, etc., as examples provided. Reordering the major axis values often takes significant amount of time for programmers, especially for generating big number of graphs for different parameters, or for data changing on daily basis, like marketing data. Introduction

A leading global CRO SAS Default: Too Many (18) Tick Numbers

A leading global CRO SAS Default: Font Size Change causes order changed

A leading global CRO SAS Default: Tick values look strange

A leading global CRO SAS Default: Only non-negative order was generated for Data with negative values

A leading global CRO SAS Default: Plot shrinks into a line if “label =none” AXIS option is specified

A leading global CRO SAS Default: No plot generated for missing data WARNING: ALL VALUES MISSING or out of range for ( y * x ). Check to see if VAXIS= or HAXIS= list is incorrect.

A leading global CRO MATHEMATICAL LOGICS TO RECALCULATE AXIS ORDERING To resolve the issues mentioned above, new mathematical logics are presented to calculate axis order, using SAS macro languages (%ORDER). Seven major steps are included for the new ordering mechanisms. For more details, please refer to the macro.

A leading global CRO For Example: Min = - 301, Max = 401  Range = 702; Min = , Max =  Range = ; Special case for range equal to 0: If Min = Max = 0, reset Min = - 0.5, Max = 0.5; If Min = Max and not equal to 0, extend Min/Max to half of their absolute value on both direction. For example, if Min=Max=50, Reset Min = 25, Max =75. STEP 1: Get the data RANGE either from the dataset variable or by user defined MIN or MAX.

A leading global CRO For Example: 702/10 = 70.2  RESULT1 = 70; /10 =  RESULT1 = ; STEP 2: Divide range by 10 to get interim result, called RESULT1, if RESULT1 > 1, round it to single digit.

A leading global CRO For Example: 70 / 10 = 7  RESULT2 = 7, DIVIDER = 10; / = 1.1  RESULT2 = 1.1, DIVIDER = ; STEP 3: Divide RESULT1 by a DIVIDER to make the new result, called RESULT2, in a range between 0 to 10, and DIVIDER [10 n, n=must be integers], which must be exponents with base 10, like …, 0.01, 0.1, 1, 10, 100, …, etc.

A leading global CRO For Example: RESULT2 = 7  STEP1 = 10 RESULT2 = 1.1  STEP1 = 2.5 STEP 4: Get the initial step, called STEP1, based on the following logics: If. < RESULT2 < =2.5, STEP1 = 2.5; If 2.5 < RESULT2 < =6.2, STEP1 = 5; If 6.2 < RESULT2 < 10, STEP1 = 10;

A leading global CRO For Example: Step1 =10, divider= 10  STEP = 10 * 10 * 2 = 200; Step1 =2.5, divider=  STEP = 2.5 * * 2 = STEP 5: Get the STEP for axis order by multiplying STEP1 by DIVIDER by 2, i.e., STEP = STEP1*DIVIDER*2. :

A leading global CRO For Example: Min = - 301, Max = 401  ORDER= -400 TO 600 by 200 Min = 0.001, Max =  ORDER = to by STEP 6: Get the LOW and HIGH value for ORDER using the following formula: LOW = Floor(MIN/STEP)*STEP HIGH = Ceil(MAX/STEP)*STEP ORDER = LOW to HIGH by STEP

A leading global CRO STEP 7: If both Min and Max are non- negative or non-positive, the LOW and HIGH must both be non-negative or non- positive [Except for Min = Max = 0]. If Min and Max are in different signs, LOW and HIGH must also be in different signs.

A leading global CRO %order( Dsn = sashelp.cars, var = mpg_city, max = 50.7, order_name = y_order, valuelist_name = y_tickvaluelist) This call will use Min of MPG_CITY from dataset SASHELP.CARS and max = 50.7 to calculate axis order. %order(var = -0.7, max = 50.7); This call will use Min of -0.7 and max = 50.7 to calculate axis order. Sample Calls

A leading global CRO This is for GPLOT/GCHART/SGPLOT, etc. Y_ORDER: =10 to 60 by 10 Those three are designed for GTL Y_TICKVALUELIST: VIEWMIN: 10 VIEWMAX: 60 Macro Variables Generated for AXIS ordering

A leading global CRO For GPLOT, etc: AXIS1 Label = none order = (&y_order.) offset=(0, 3)pct; For GTL: yaxisopts=( linearopts =(viewmin = &viewmin viewmax=&viewmax tickvaluelist= (&y_tickvaluelist.))); Apply results for your graph programming:

A leading global CRO Min | Max GPLOT DEFAULT (Tick Numbers) GTL DEFAULT (Tick Numbers) %ORDER (Tick Numbers) Missing | Missing WARNING: ALL VALUES MISSING or out of range. No plot will be Generated WARNING: Y=Y is invalid. The option expects at least one non-missing value in the column. Graph is Generated with empty AXIS WARNING: ALL VALUES MISSING or out of range. Graph will be Generated with AXIS = 999 to 9999 by Can make revision to be consistent with GTL 0 | 0 0 to 0 by 0 (1) plot shrinks into a line Label = none is specified in AXIS statement 0 to 0 by 0 (1)-1 to 1 by 0.5 (5) 1 | 41 to 4 by 1 (4)1 to 4 by 0.5 (7)1 to 4 by 1 (4) 1.1 | 61 to 6 by 1 (6) 100 | to 700 by 100 (7) 777 | to 777 by 0 (1),777 to 777 by 0 (1)200 to 1200 by 200 (6) | to by (4)0 to by 5000 (5)-5000 to by 5000 (6) -1.36E-7 | 2.68E E-7 to 2.74E-7 by 0.5E-7 (10)-2E-7 to 3E-7 by 1E-7 (6) | to 0 by (18) to 0 by (5) Compared Result with SAS Default

A leading global CRO Compared Result with SAS Default

A leading global CRO Compared Result with SAS Default

A leading global CRO Compared Result with SAS Default

A leading global CRO Conclusion This macro significantly enhance SAS axis ordering mechanism, especially for procedures like GPLOT, GCHART. In generally cases, it will generate axis order better than SAS default for procedures like GPLOT/GCHART, and comparable or better than axis ordering mechanism in SAS9.3 STAT graph package and SAS9.3 GTL graph package.