Graphical User Interface for Modifying Structables and their Mosaic Plots

Similar documents
MATH& 146 Lesson 11. Section 1.6 Categorical Data

Chapter 5 Printing with Calc

UNIVERSITY OF MASSACHUSETTS Department of Biostatistics and Epidemiology BioEpi 540W - Introduction to Biostatistics Fall 2002

E X P E R I M E N T 1

MODFLOW - Grid Approach

v. 8.0 GMS 8.0 Tutorial MODFLOW Grid Approach Build a MODFLOW model on a 3D grid Prerequisite Tutorials None Time minutes

Using different reference quantities in ArtemiS SUITE

Introduction to IBM SPSS Statistics (v24)

Defining and Labeling Circuits and Electrical Phasing in PLS-CADD

Footnotes and Endnotes

EndNote Web. Quick Reference Card THOMSON SCIENTIFIC

2G Video Wall Guide Just Add Power HD over IP Page1 2G VIDEO WALL GUIDE. Revised

Data Acquisition Using LabVIEW

ENGR 1000, Introduction to Engineering Design

VISSIM TUTORIALS This document includes tutorials that provide help in using VISSIM to accomplish the six tasks listed in the table below.

Moving on from MSTAT. March The University of Reading Statistical Services Centre Biometrics Advisory and Support Service to DFID

Exercise #1: Create and Revise a Smart Group

Score Layout and Printing

Dektak Step by Step Instructions:

GS122-2L. About the speakers:

Statement SmartLCT User s Manual Welcome to use the product from Xi an NovaStar Tech Co., Ltd. (hereinafter referred to as NovaStar ). It is our great

The. finale. Projects. The New Approach to Learning. finale. Tom Carruth

Import and quantification of a micro titer plate image

Chapter 40: MIDI Tool

Kindle Add-In for Microsoft Word User Guide

Relationships Between Quantitative Variables

Escaping RGBland: Selecting Colors for Statistical Graphics

Table of Contents Introduction

Screen Shot User Guide Clinical Agency

KRAMER ELECTRONICS LTD. USER MANUAL

MATLAB Basics 6 plotting

Relationships. Between Quantitative Variables. Chapter 5. Copyright 2006 Brooks/Cole, a division of Thomson Learning, Inc.

Algebra I Module 2 Lessons 1 19

MICROSOFT WORD FEATURES FOR ARTS POSTGRADUATES

HUB CATS File Development Documentation

Fig. 1. The Front Panel (Graphical User Interface)

SIDRA INTERSECTION 8.0 UPDATE HISTORY

Reference Management using EndNote

Case study: how to create a 3D potential scan Nyquist plot?

Customization of Net Colors

SOUNDLIB: A MUSIC LIBRARY FOR A NOVICE JAVA PROGRAMMER

Sampler Overview. Statistical Demonstration Software Copyright 2007 by Clifford H. Wagner

Homework Packet Week #5 All problems with answers or work are examples.

A Handbook of Statistical Analyses Using R. Brian S. Everitt and Torsten Hothorn

iii Table of Contents

Blueline, Linefree, Accuracy Ratio, & Moving Absolute Mean Ratio Charts

Lab Determining the Screen Resolution of a Computer

Why visualize data? Advanced GDA and Software: Multivariate approaches, Interactive Graphics, Mondrian, iplots and R. German Bundestagswahl 2005

Using DICTION. Some Basics. Importing Files. Analyzing Texts

48 TV Caller ID TV CALLER ID

Basic LabVIEW Programming Amit J Nimunkar, Sara Karle, Michele Lorenz, Emily Maslonkowski

XDFilt 1r0 July 23, XDFilt 1r0. Instructions. Copyright 2007, Steven A. Harlow 1

Background. About automation subtracks

Quadro Plex D2. Mosaic Mode for windows XP Reference Guide

Lab experience 1: Introduction to LabView

ULTRA-Flex CLOUD. ULTRA-Flex Lite CLOUD Design $1495 $695

GBA 327: Module 7D AVP Transcript Title: The Monte Carlo Simulation Using Risk Solver. Title Slide

Running leds from Pokeys

PCIe: EYE DIAGRAM ANALYSIS IN HYPERLYNX

Analyzing and Saving a Signal

Tutor Led Manual v1.7. Table of Contents PREFACE I.T. Skills Required Before Attempting this Course... 1 Copyright... 2 GETTING STARTED...

D-Lab & D-Lab Control Plan. Measure. Analyse. User Manual

With Export all setting information (preferences, user setttings) can be exported into a text file.

Setting up the app. Press the Setting button (gear symbol) on the upper screen to go setup app. Before you

Cisco Spectrum Expert Software Overview

Single cable multiswich programmer PC102W

Customization of Net Colors Related Video PCB Highlighting. Contents

BioGraph Infiniti Physiology Suite

Editing Reference Types & Styles: Macintosh. EndNote Support & Training October 2017

WindData Explorer User Manual

AP Statistics Sec 5.1: An Exercise in Sampling: The Corn Field

Creating Licks Using Virtual Trumpet

PS User Guide Series Seismic-Data Display

ENGR 1000, Introduction to Engineering Design

(Skip to step 11 if you are already familiar with connecting to the Tribot)

ivw-fd133 Video Wall Controller MODEL: ivw-fd133 Video Wall Controller Supports 3 x 3 and 2 x 2 Video Wall Array User Manual Page i Rev. 1.

Overview. Shipped in the Venue Vizion Package: Simplified Integration Process. Installation consists of 6 easy steps:

Table of content. Table of content Introduction Concepts Hardware setup...4

CORIOmax Resolution Editor Programming Guide 2015/03/04

IP LIVE PRODUCTION UNIT NXL-IP55 USO RESTRITO. OPERATION MANUAL 1st Edition (Revised 2) [English]

Common Spatial Patterns 3 class BCI V Copyright 2012 g.tec medical engineering GmbH

Biopac Student Lab Lesson 9 ELECTRODERMAL ACTIVITY & POLYGRAPH Analysis Procedure. Rev

cs281: Introduction to Computer Systems Lab07 - Sequential Circuits II: Ant Brain

Table of Contents. 2 Select camera-lens configuration Select camera and lens type Listbox: Select source image... 8

Common Spatial Patterns 2 class BCI V Copyright 2012 g.tec medical engineering GmbH

Mortara XScribe Versions 3.xx and 5.xx Tango M2 Interface Notes

INTRODUCTION TO ENDNOTE. NTNU University Library, Medicine and Health Library January 2017

XJTAG DFT Assistant for

Tutorial 3 Normalize step-cycles, average waveform amplitude and the Layout program

Computer Graphics: Overview of Graphics Systems

MestReNova A quick Guide. Adjust signal intensity Use scroll wheel. Zoomen Z

Modbus for SKF IMx and Analyst

Log viewer and analyser for switchboard and downhole sensor

TL-2900 AMMONIA & NITRATE ANALYZER DUAL CHANNEL

Permutations of the Octagon: An Aesthetic-Mathematical Dialectic

A Step-by-Step Guide to the CableEye Software

HD-SDI Express User Training. J.Egri 4/09 1

Capstone Experiment Setups & Procedures PHYS 1111L/2211L

Melody Sauce is an AU / VST / MIDI FX device that creates melodies as MIDI.

Using EndNote X7 to Manage Bibliographies on a Mac!

Transcription:

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 1 Graphical User Interface for Modifying Structables and their Mosaic Plots Richard M. Heiberger and Temple University Erich Neuwirth University of Vienna A structable object is a representation in R of a k-dimensional contingency table. The structable object has two attributes: split vertical that carries information on assignment of the factors to row or columns, and dnames that carries information on sequencing of the factors. The printed display of a structable as a flat table in two dimensions shows the row and column assignment but is unable to illustrate the joint sequencing of the horizontal and vertical splits. The default plot of a structable is as a mosaic plot with recursive splits of the factors in the specified sequence and according to the orientation given in split vertical. Each split is along the vertical or horizontal direction associated with the column or row assignment of its factor.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 2 Germangrade Gender Mathgrade 1 2 3 4 female 1 44 15 13 9 2 14 19 23 15 3 15 19 20 10 4 3 13 18 14 male 1 67 31 38 10 2 35 52 56 25 3 17 53 58 45 4 11 24 41 33 Figure 1: In the left panel we show a three-factor contingency table displayed as a structable. In the right panel we show a mosaic plot of the same data. The mosaic uses the default configuration, conditioning first on the outer rows showing Gender, then on the columns showing Germangrade nested within Gender, and finally on the inner rows showing Mathgrade nested within Germangrade nested within Gender.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 3 1 Example StudentData and Pivot Table by RExcel The StudentData (Neuwirth, 2011) contains measurements on 1126 Austrian undergraduates collected over a ten year period. We will look at three of the factors here. Gender: Student s Gender: m for man and w for woman. Mathgrade: Discrete values (1, 2, 3, 4) with 1 as the best grade. Germangrade: Discrete values (1, 2, 3, 4) with 1 as the best grade. We can construct a contingency table for these factors as a pivot table in Excel and then export it directly to a structable in R (Figure 2), or we can construct the structable directly in R(Figure 3). Either way we have the same structable, called GGM here.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 4 Figure 2: Pivot table in Excel that was constructed from the original data (one observation per student) and then exported to R using the RExcel Put Pivottable context menu item.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 5 > GGM <- structable(~ Gender + Germangrade + Mathgrade, StudentData) > GGM Germangrade 1 2 3 4 Gender Mathgrade female 1 44 15 13 9 2 14 19 23 15 3 15 19 20 10 4 3 13 18 14 male 1 67 31 38 10 2 35 52 56 25 3 17 53 58 45 4 11 24 41 33 > Figure 3: Construction of structable in R with the structable function on the dataframe containing the original data (one observation per student).

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 6 > mosaicpermdialog(ggm) [1] "mosaic(ggm)" > a. R command line b. Rcmdr menu from Rcmdr window c. Rcmdr menu from Excel (all platforms) (all platforms) (Windows only) Figure 4: Three equivalent ways to start the mosaic dialog shown in Figure 5.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 7 Figure 5: Initial dialog box and mosaic display. The labeled rows of buttons in the dialog box show the sequence of splits illustrated in the mosaic plot. The columns of labels in the dialog box show the assignment of factors to the rows and columns of the structable and mosaic plot. The arrow buttons indicate the specification of split sequence and row/column assignment that are possible from the current display.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 8 The printed representation of a structable displays only the separate derived sequencing of the horizontal and vertical factors. As a consequence, multiple structables and their associated mosaic plots can yield the same printed flat table. We have developed a graphical user interface, and corresponding R functions, that simplify the specification of the alternate sequencing of splits hence associated mosaic plots consistent with a printed flat table. The user interface also permits rearrangement of the flat table, either by reassigning factors to rows or columns or by changing the order of the factors within the same row or column assignment. The primary R function is an aperm (array permutation) method designed for structables.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 9 Figure 6: For this and the remaining figures in the paper, we clicked the Colorize last variable checkbox. The coloring matches the last split, Mathgrade here. We click the German Down arrow to get Figure 7.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 10 Figure 7: Gender is still the first split. In this figure Mathgrade is the second split. The coloring matches the last split, Germangrade here. We click the Gender Down arrow to get Figure 8.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 11 Figure 8: The structable for this figure (Figure 8) is identical to the structable for Figures 6 and 7. The structable is displayed in Figure 11. In all three of these figures, the areas of the rectangles corresponding to each count in the structable are proportional to the count. The interpretation as conditional probabilities of this plot (distribution of Gender by MathGrade conditional on GermanGrade) doesn t make much sense, where the similar interpretation of the other two plots as distributions of the two grades conditional on Gender does make sense.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 12 44 15 13 9 14 19 23 15 15 19 20 10 3 13 18 14 67 31 38 10 35 52 56 25 17 53 58 45 11 24 41 33 Figure 9: All three mosaic plots that correspond to the same flat display of their structable. The conditioning of the splits differs. The relative position of each cell of the three-way table is the same.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 13 Figure 10: In this figure, we moved Gender from a row factor to a column factor. Now the flat structable has a different appearance.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 14 Figure 11: The dialog box can return either the structable object or the function call that generates the structable object.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 15 Salk Vaccine (Chin et al, 1961), also in(agresti, 1990) and in(heiberger and Holland, 2004), discuss174poliocasesclassifiedbyageofsubject,whetherornotthesubjectreceived the Salk polio vaccine, and whether the subject was ultimately paralyzed by polio. We wish to learn if symptom status (paralysis or not) is independent of vaccination status after controlling for age.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 16 0-4 5-9 10-14 15-19 20-39 40+ no vac no vac no vac no vac no vac no vac no.par 10 20 3 15 3 3 1 7 7 12 3 1 par 24 14 15 12 2 2 6 4 5 3 2 0 Figure 12: Mantel Haenszel Cochran test for the Salk polio example. It is easy to see from the mosaic plot that the upper right box in each age group is taller than the upper left box in its own age group. That is, the proportion of cases without paralysis in the vaccinated treatment is higher for all age groups.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 17 References Erich Neuwirth(2008), Student data collected in classes, 1998 2008, Distributed on CRAN as part of the RthroughExcelWorkbooksInstaller package (Heiberger and Neuwirth, 2011). Richard M. Heiberger (rmh@temple.edu) and Erich Neuwirth (erich.neuwirth@univie.ac.at) (2009). R Through Excel: Introductory and Advanced Statistics, Data Analysis, and Graphics with a Spreadsheet Interface and Spreadsheet Tools, Springer, Use R series, ISBN: 9787-1-4419-0051-7. Richard M. Heiberger (rmh@temple.edu) and Erich Neuwirth (erich.neuwirth@univie.ac.at) (2011). RthroughExcelWorkbooksInstaller: Excel Workbooks supporting Statistics courses using R through Excel. R package version 1.2-6. http://cran.r-project.org/package=rthroughexcelworkbooksinstaller Erich Neuwirth (erich.neuwirth@univie.ac.at) (2011). RExcelInstaller: Integration of R and Excel, (use R in Excel, read/write XLS files). R package version 3.2-2. http://rcom.univie.ac.at

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 18 David Meyer, Achim Zeileis, and Kurt Hornik (2011). vcd: Visualizing Categorical Data. R package version 1.2-11. David Meyer, Achim Zeileis, and Kurt Hornik (2006). The Strucplot Framework: Visualizing Multi-Way Contingency Tables with vcd. Journal of Statistical Software, 17(3), 1 48. http://www.jstatsoft.org/v17/i03/ Chin, T. W., Hall, E., Gravelle, C., and Speers, J. (1961). The influence of Salk vaccination on the epidemic pattern and spread of the virus in the community, American Journal of Hygiene, 73:67 94. Agresti, A. (1990). Categorical Data Analysis. Wiley. Heiberger, R. M. and Holland, B. (2004). Statistical Analysis and Data Display: An Intermediate Course with Examples in S-Plus, R, and SAS. Springer. http://springeronline.com/0-387-40270-5.

Graphical User Interface for Modifying Structables and their Mosaic Plots UseR 2011 Heiberger and Neuwirth 19 Table Classes R has 3 classes for tables: table, ftable, and structable. In table, all factors have a joint order and there is no horizontal-vertical orientation. In ftable, factors are divided into two sets, horizontal and vertical, and only ordered within these sets; there is no joint order. In structable, factors are ordered (as in table) and also assigned to either horizonal or vertical (as in ftable). The separate ordering of the horizontal and vertical factors is derived from the joint ordering. structable inherits from ftable, and not table. Since printing a structable and printing an ftable produces typographically equivalent results, this seems to make sense. But the print method hides the joint order. The joint order is important for mosaic plots. table and structable have mosaic plots as their default plot method. ftable does not have a plot method of its own. Plotting an ftable will produce a not very useful scatterplot. In the object hierarchy of R, structable inherits from ftable, and not from table. With respect to the default plotting method, this is a somewhat unfortunate class hierarchy.