How to use the Turnip Graph Engine in STATA

Similar documents
Internet Technology Fundamentals. To use a passing score at the percentiles listed below:

North Point - Advance Placement Statistics Summer Assignment

Statistics Class 3. Jan 30, 2012

Organizing Quantitative Data

Phet Wave on a String Simulation!

Chapter 2: Modeling Distributions of Data

Descriptive Statistics Project Is there a home field advantage in major league baseball?

1wsSMAM 319 Some Examples of Graphical Display of Data

In this assignment, students will analyze statistics from the U.S. Department of Transportation to determine the safest means of travel.

Figure 1: Graphical definitions of superelevation in terms for a two lane roadway.

Descriptive Stats. Review

Full file at

Diameter in cm. Bubble Number. Bubble Number Diameter in cm

The pth percentile of a distribution is the value with p percent of the observations less than it.

STT 315 Section /19/2014

1. The data below gives the eye colors of 20 students in a Statistics class. Make a frequency table for the data.

Quantitative Literacy: Thinking Between the Lines

Histogram. Collection

AXIS. User Manual. American Weigh Scales. AXIS-100 (100g x 0.01g) AXIS-650 (650g x 0.01g)

AP Statistics Midterm Exam 2 hours

Navigate to the golf data folder and make it your working directory. Load the data by typing

Algebra I: A Fresh Approach. By Christy Walters

Cambridge International Examinations Cambridge Ordinary Level

Background Information. Project Instructions. Problem Statement. EXAM REVIEW PROJECT Microsoft Excel Review Baseball Hall of Fame Problem

Topic No January 2000 Manual on Uniform Traffic Studies Revised July Chapter 8 GAP STUDY

Where are you right now? How fast are you moving? To answer these questions precisely, you

Today s plan: Section 4.2: Normal Distribution

MATH 118 Chapter 5 Sample Exam By: Maan Omran

Question LCHL: Descriptive Statistics

NCSS Statistical Software

Algebra I: A Fresh Approach. By Christy Walters

CHAPTER 2 Modeling Distributions of Data

(Lab Interface BLM) Acceleration

Quality Assurance Charting for QC Data

SHIMADZU LC-10/20 PUMP

39 Hurricane Ida Wind Record

Lab 5: Descriptive Statistics

IHS AP Statistics Chapter 2 Modeling Distributions of Data MP1

Highway & Transportation (I) ECIV 4333 Chapter (4): Traffic Engineering Studies. Spot Speed

Scaled vs. Original Socre Mean = 77 Median = 77.1

(c) The hospital decided to collect the data from the first 50 patients admitted on July 4, 2010.

0-13 Representing Data

Courseware Sample F0

Figure SM1: Front panel of the multipatcher software graphic user interface (GUI) at the beginning of multipatcher operation.

MS-500. User Manual. MS-500 (500g x 0.1g) Copyright 2010 Fast Weigh Scales All rights reserved. Rev. 2.0

CONTROL VALVE WHAT YOU NEED TO LEARN?

Empirical Example II of Chapter 7

_01_EE394J_2_Spring12_Texas_Synchrophasor_Events.doc. Events automatically detected by our PMU_Waveform_Analyzer. Event 1. Jan. 03, 2012.

Chapter 2 - Displaying and Describing Categorical Data

Chapter 3 - Displaying and Describing Categorical Data

Descriptive Statistics

Vapor Pressure of Liquids

Basic Tryout Registration Set Up. Using the pre-loaded folder set up from US Soccer Connect

Note that all proportions are between 0 and 1. at risk. How to construct a sentence describing a. proportion:

REAL LIFE GRAPHS M.K. HOME TUITION. Mathematics Revision Guides Level: GCSE Higher Tier

EPSILON. User Manual. EP-5KG (5000g x 1g) Copyright 2011 American Weigh Scales, Inc. All rights reserved. Rev. 1.0

Exploring Measures of Central Tendency (mean, median and mode) Exploring range as a measure of dispersion

Operating Manual. BACVis. Manual BACVis. for. Sensors and MilliGascounter. Rev

RATE OF CHANGE AND INSTANTANEOUS VELOCITY

NUMB3RS Activity: Walkabout. Episode: Mind Games

Chapter 2: Visual Description of Data

4-3 Rate of Change and Slope. Warm Up. 1. Find the x- and y-intercepts of 2x 5y = 20. Describe the correlation shown by the scatter plot. 2.

ADDA Rules Revised Fall 2018

The ICC Duckworth-Lewis Calculator. Professional Edition 2008

In 2018 a total of 56,127 students received an ATAR, 934 fewer than in The gender balance was similar to 2017.

Rimage Everest 600 Thermal Retransfer Printer

PHASE 1 WIND STUDIES REPORT

RULES AND REGULATIONS

Instructions for using the PRECISION DIGITAL PITCH GAUGE 2008, Precision Analytical Instruments, Inc. Congratulations!

STAT 350 Exam 1 (Version 1) Spring Name (Print) :

March Madness Basketball Tournament

Design of Dynamic Work

POLICY FOR NEIGHBORHOOD TRAFFIC CALMING

BCM-Series. User Manual. American Weigh Scales. BCM-100 (100g x 0.01g) BCM-650 (650g x 0.1g)

An STPA Tool. Dajiang Suo, John Thomas

Complete Street Analysis of a Road Diet: Orange Grove Boulevard, Pasadena, CA

CHAPTER 1 Exploring Data

Equine Cannon Angle System

Math 227 Test 1 (Ch2 and 3) Name

RULES FOR FORTNITE DREAMHACK TOURS 2018

Chapter 6 The Standard Deviation as a Ruler and the Normal Model

GUIDE TO THE ARCTIC SHIPPING CALCULATION TOOL

Spring Soccer. Guidelines. Supporting Combined Soccer across AYSO Areas 11R, 11S & 11V. San Diego County AYSO

SC-888 Instructions. The following illustration provides the operation of pushbuttons and location of indicators for the Robic SC-888.

2.5. All games and sports have specific rules and regulations. There are rules about. Play Ball! Absolute Value Equations and Inequalities

Contents ... TEACHER GUIDE NCTM Content Standards Assessment Rubric... 6 How Is Our Resource Organized? The NCTM Principles & Standards...

QUARTERLY REPORT July - September Quarter SERIES NO. SDT:

March Madness Basketball Tournament

CHAPTER 2 Modeling Distributions of Data

Chapter 8 Chapter 8 VEHICLE GAP STUDY PURPOSE VEHICLE GAP STUDY (FIGURE 8-1)

windnavigator Site Analyst Report

CÜBE. User Manual. American Weigh Scales. CUBE-100 (100g x 0.01g) CUBE-650 (650g x 0.1g)

Lesson 14: Modeling Relationships with a Line

Name: Class: Date: (First Page) Name: Class: Date: (Subsequent Pages) 1. {Exercise 5.07}

Lab 3: Pumps in Series & Pumps in Parallel

National Curriculum Statement: Determine quartiles and interquartile range (ACMSP248).

UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS General Certificate of Education Ordinary Level

I. Model Problems. II. Choosing the Correct Formula III. Mixed Problems (using the formulas twice) III. Challenge questions IV.

Warm-up. Make a bar graph to display these data. What additional information do you need to make a pie chart?

City of Tamarac, Florida Traffic Calming Policy

Transcription:

How to use the Turnip Graph Engine in STATA WHAT YOU HAVE TO DO: 1. Download turnip.ado and put it in an ado file folder 2. Now whenever you open STATA you can run turnip as you would any.ado file: for example, if you have a data file open with a variable called, just type turnip 3. If you prefer, you can change the name of the file to turnip.do and run it as you would any.do file (i.e., open STATA, run turnip.do, then you can use turnip by typing turnip and the name of your variable). SYNTAX Description ----------- turnip varlist [if exp] [, RESolution() TRUev() GraphicsOptions] Creates a turnip-style graph. Turnip graphs display distributions like a boxplot; but, because they display the actual data points, they are much easier to understand. Plus, they look really cool. Options ------- All standard graphics options except for "BY" are allowed. If you want to align multiple turnips you can use the STATA function: ^gr combine^ (see @gr combine.hlp@). Options specific to TURNIP: 1. resolution - Default resolution of the graphic (i.e., how many categories varlist is divided into) is.4*(standard deviation of `varlist' ) variable. Alternatively, user can specify resolution. Since the resolution feature rounds the data, the graphic in essence displays the frequency of observations falling within in resolution unit. The user can avoid any such rounding (i.e., display frequency of each value in the data) by specifying a negative number in the resolution option. For example, turnip xxx, res(- 1) 2. xlabel - Default xlabel is twice the maximum number of observations in any ttt`varlist'category. User can reset xlabel to adjust width of the graphic. 3. ylabel - Default ylabel adds 25% of the range above and below min and max values. User can reset ylabel to adjust height of graphic.

4. truev - The program rounds values of the varlist variable into units defined by the resolution option. In some cases the user may want to prevent this from happening. For example, suppose you are trying to display change scores and want to show which observations are above or below zero. The truev (as in true value) option ensures that only zero values are graphed at zero; other values which would round to zero are set at the appropriate next most category of the varlist variable. 5. NOTE: In addition to the usual function of YLINE, turnip allows user to specify special values; specifically, mean or median. If either mean or median is specified, the corresponding value is added to ylabel so the value is displayed on the y-axis. ACKNOWLEDGEMENT Turnips are the graphic of choice in the Dartmouth Atlas of Healthcare (American Hospital Publishing Inc., Chicago, IL, 1996). The term "turnip" graph was coined by Jack Wennberg, MD, MPH and colleagues at the Center for Evaluative Clinical Sciences, Dartmouth Medical School.

EXAMPLES I. Plain use ":Macintosh HD:Applications:Stata 6.0:auto.dta" (1978 Automobile Data). turnip (39 real changes made) Freq. Percent Cum. 11.55 2 2.70 2.70 13.86 8 10.81 13.51 16.17 8 10.81 24.32 18.48 17 22.97 47.30 20.79 8 10.81 58.11 23.1 12 16.22 74.32 25.41 8 10.81 85.14 27.72 3 4.05 89.19 30.03 4 5.41 94.59 34.65 3 4.05 98.65 41.58 1 1.35 100.00 options: xlabel(-16 16) ylabel(9 45 ) resolution: 2.31 dflag = none 9 45

II. Suspend rounding turnip, res(-1) *specifying negative number for resolution turns off all rounding.. turnip, res(-1) (43 real changes made) Freq. Percent Cum. 12 2 2.70 2.70 14 6 8.11 10.81 15 2 2.70 13.51 16 4 5.41 18.92 17 4 5.41 24.32 18 9 12.16 36.49 19 8 10.81 47.30 20 3 4.05 51.35 21 5 6.76 58.11 22 5 6.76 64.86 23 3 4.05 68.92 24 4 5.41 74.32 25 5 6.76 81.08 26 3 4.05 85.14 28 3 4.05 89.19 29 1 1.35 90.54 30 2 2.70 93.24 31 1 1.35 94.59 34 1 1.35 95.95 35 2 2.70 98.65 41 1 1.35 100.00 options: xlabel(-8 8) ylabel(9 44 ) resolution: -1 dflag = none 9 44

III. Specify xlabel (controls turnip width) and add a yline turnip, xlabel(-10 10) yline(mean) *yline(mean) adds a line at the distribution's mean and automatically adds the value for the mean to the y-label. turnip, xlabel(-10 10) yline(mean) (39 real changes made) Freq. Percent Cum. 11.55 2 2.70 2.70 13.86 8 10.81 13.51 16.17 8 10.81 24.32 18.48 17 22.97 47.30 20.79 8 10.81 58.11 23.1 12 16.22 74.32 25.41 8 10.81 85.14 27.72 3 4.05 89.19 30.03 4 5.41 94.59 34.65 3 4.05 98.65 41.58 1 1.35 100.00 options: xlabel(-10 10) yline(21.2) ylabel( 21.2972972972973 9 45 ) resolution: 2.31 dflag = mean yline: 21.2972972972973 (mean) 9 21.297297 45

IV. Use xlabel to narrow the graph (compare width to graph III) turnip, xlabel(-30 30) yline(mean). turnip, xlabel(-30 30) yline(mean) (39 real changes made) Freq. Percent Cum. 11.55 2 2.70 2.70 13.86 8 10.81 13.51 16.17 8 10.81 24.32 18.48 17 22.97 47.30 20.79 8 10.81 58.11 23.1 12 16.22 74.32 25.41 8 10.81 85.14 27.72 3 4.05 89.19 30.03 4 5.41 94.59 34.65 3 4.05 98.65 41.58 1 1.35 100.00 options: xlabel(-30 30) yline(21.2) ylabel( 21.2972972972973 9 45 ) resolution: 2.31 dflag = mean yline: 21.2972972972973 (mean) 9 21.297297 45

V. Use "if" command turnip if foreign==1, xlabel(-10 10) yline(mean) *IF command restricts graphic to only a those observations with foreign==1 turnip if foreign==1, xlabel(-10 10) yline(mean) (22 real changes made) (13 real changes made) Freq. Percent Cum. 13.86 1 4.55 4.55 16.17 2 9.09 13.64 18.48 2 9.09 22.73 20.79 2 9.09 31.82 23.1 4 18.18 50.00 25.41 5 22.73 72.73 27.72 1 4.55 77.27 30.03 2 9.09 86.36 34.65 2 9.09 95.45 41.58 1 4.55 100.00 Total 22 100.00 options: xlabel(-10 10) yline(24.7) ylabel( 24.77272727272727 11 44 ) resolution: 2.31 dflag = mean yline: 24.77272727272727 (mean) 11 24.772727 44

VI. Use ylabel to narrow the graph to control height of graph (compare height to graph III) turnip, xlabel(-10 10) yline(mean) ylabel(10 100) (39 real changes made) Freq. Percent Cum. 11.55 2 2.70 2.70 13.86 8 10.81 13.51 16.17 8 10.81 24.32 18.48 17 22.97 47.30 20.79 8 10.81 58.11 23.1 12 16.22 74.32 25.41 8 10.81 85.14 27.72 3 4.05 89.19 30.03 4 5.41 94.59 34.65 3 4.05 98.65 41.58 1 1.35 100.00 options: xlabel(-10 10) yline(21.2) ylabel( 21.2972972972973 10 100) resolution: 2.31 dflag = mean yline: 21.2972972972973 (mean) 10 21.297297 100

VII. Round y values turnip, xlabel(-10 10) yline(mean) ylabel(10 50) res(2) *rounds y'values to the nearest 2 (eg, in table below with table in ex. VI). (41 real changes made) Freq. Percent Cum. 12 2 2.70 2.70 14 6 8.11 10.81 16 6 8.11 18.92 18 13 17.57 36.49 20 11 14.86 51.35 22 10 13.51 64.86 24 7 9.46 74.32 26 8 10.81 85.14 28 3 4.05 89.19 30 3 4.05 93.24 32 1 1.35 94.59 34 1 1.35 95.95 36 2 2.70 98.65 42 1 1.35 100.00 options: xlabel(-10 10) yline(21.2) ylabel( 21.2972972972973 10 50) resolution: 2 dflag = mean yline: 21.2972972972973 (mean) 10 21.297297 50

VIII. Draw yline at the median turnip, xlabel(-10 10) yline(median) ylabel(10 50) res(1) *same thing, but now draw a line at the median. Freq. Percent Cum. 12 2 2.70 2.70 14 6 8.11 10.81 15 2 2.70 13.51 16 4 5.41 18.92 17 4 5.41 24.32 18 9 12.16 36.49 19 8 10.81 47.30 20 3 4.05 51.35 21 5 6.76 58.11 22 5 6.76 64.86 23 3 4.05 68.92 24 4 5.41 74.32 25 5 6.76 81.08 26 3 4.05 85.14 28 3 4.05 89.19 29 1 1.35 90.54 30 2 2.70 93.24 31 1 1.35 94.59 34 1 1.35 95.95 35 2 2.70 98.65 41 1 1.35 100.00 options: xlabel(-10 10) yline(20) ylabel( 20 10 50) resolution: 1 dflag = median yline: 20 (median) 10 20 50

IX. Use the true value function (compare to graph VIII) turnip, xlabel(-10 10) yline(median) ylabel(10 50) t(20) *now repeat the graph. In this case, however, specify that only values truely = 20 get represented as a y=20 on the graph (ie, suspend any rounding at 20). Here, 3 observations are really at an of 20. These had been rounded to 20.79 (see example VIII).. turnip, xlabel(-10 10) yline(median) ylabel(10 50) t(20) (40 real changes made) Freq. Percent Cum. 11.55 2 2.70 2.70 13.86 8 10.81 13.51 16.17 8 10.81 24.32 18.48 17 22.97 47.30 20 3 4.05 51.35 20.79 5 6.76 58.11 23.1 12 16.22 74.32 25.41 8 10.81 85.14 27.72 3 4.05 89.19 30.03 4 5.41 94.59 34.65 3 4.05 98.65 41.58 1 1.35 100.00 options: xlabel(-10 10) yline(20) ylabel( 20 10 50) resolution: 2.31 truev: 20 dflag = median yline: 20 (median) 10 20 50

X. Combine turnip graphs *for details/options about cr graph see help @gr combine@ turnip, ylabel(0(10)60) graph save.gph" turnip turn, ylabel(0(10)60) graph save turn.gph" turnip trunk, ylabel(0(10)60) graph save turn.gph" gr combine.gph turn.gph trunk.gph, row(1) 0 10 20 30 40 50 60 turn 0 10 20 30 40 50 60 trunk 0 10 20 30 40 50 60