Using Lattice to Plot Grouped Data Richard Pugh 4 th December 2012.

Slides:



Advertisements
Similar presentations
LINEAR Y=MX + B Part I A graph is not a function unless all the ____ values are different. It must pass the __________ Line Test. 1 2 y depends on x.
Advertisements

Copyright © 2003 Pearson Education, Inc. Slide 1.
Parts of graphs, and How to set up graphs
Introduction to Lattice Graphics Richard Pugh 4th December 2012.
Rich Pugh Andy Nicholls Head to Head: Lattice vs ggplot2 Rich Pugh
TITLE Group Member Names SLIDE 1- – Verbal greeting and introduction is required. Ensure the audience knows who you are – All slides should have a common.
DO NOW  Pick up your notebooks!! And Pick up the Slides!!  Complete the four problems on the Speed worksheet (PAGE 16) highlight  THEN….highlight the.
Observer Method 1. References Gamma Erich, Helm Richard, “Design Patterns: Elements of Reusable Object- Oriented Software” 2.
Stat-JR: eBooks Richard Parker. Quick overview To recap… Stat-JR uses templates to perform specific functions on datasets, e.g.: – 1LevelMod fits 1-level.
Macro-Fiscal Forecasting Sami Yläoutinen Fiscal Affairs Department (IMF) & METAC Workshop on MTFF December 16 th –19 th, 2014, Beirut, Lebanon.
Operational Information Service Procedural Statement.
Slope and Rate of Change Equations of Lines
Title goes in here Subtitle here. Example Bullet Point Slide Bullet point –Sub Bullet.
Enhancing the Platform Independence of the Real-Time Specification for Java Andy Wellings, Yang Chang and Tom Richardson University of York.
R for Research Data Analysis using R Day2: Advanced R Baburao Kamble University of Nebraska-Lincoln.
D1: Linear Programming.
PSCI PHARMACEUTICAL SUPPLY CHAIN INITIATIVE The Pharmaceutical Supply Chain Initiative – An Overview Presented by [Add name] [Add role title] [Add company.
+ Informatics 122 Software Design II Lecture 8 Emily Navarro Duplication of course material for any commercial purpose without the explicit written permission.
Greg Kelly, Hanford High School, Richland, Washington.
Graph an equation in standard form
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
Overview of Previous Lesson(s) Over View  OOP  A class is a data type that you define to suit customized application requirements.  A class can be.
Baburao Kamble (Ph.D) University of Nebraska-Lincoln
WHAT IS SCIENCE FAIR? HOW CAN I (SHOULD I) HELP MY CHILD?
Accounting 3020 Chapter 5 – Cost Behavior: Analysis and Use.
Business 2 Template World Map Presenter Name. Example Bullet Point Slide Bullet point Sub Bullet.
Reversing Normal Calculations Statistics 2. Reversing Normal Calculations In the previous presentation there was an example where a claim was made that.
Strengthening parliamentary involvement in the Budget Process World Bank Institute’s Parliamentary Staff Training Program.
Modeling Motion CPO Physics Taken from a presentation original by Patsy Decoaster.
Insert Nonprofit Logo Project Name Discovery Presentation.
PROJECT TITLE Name Date Etc. PROJECT OVERVIEW & PROGRESS: SLIDE 1 Bullet.
Poster Title – Should include your study subject, independent variable, dependent variable, and outcome. Your names, class hour, school, and date.
PowerPoint Ethernet cable template. Chart slide PowerPoint Ethernet cable template.
TQM Total Quality Management tools. Pareto Principle Most effects come from few causes. Most effects come from few causes. Pareto rule: 80% of the problems.
With love on Valentine’s Day Include your valentine message, wish or greeting here..
Take the pain out of Public Sector Budgeting Implementation Setups Richard Byrom Oracle Applications Consultant
Ggplot2 A cool way for creating plots in R Maria Novosolov.
Greg Kelly, Hanford High School, Richland, Washington.
Learning Outside of Class By Christopher Popp and Tim Thrune.
Great way to show your data!. * In your journal, draw a 4 square grid.
Lattice- xyplot Yufeng Lin Haipeng Yao. How to use xyplot Xyplot(formula, data = parent.frame(), panel = if (is.null(groups)) "panel.xyplot" else "panel.superpose",
Scatter Plots. Scatter plots are used when data from an experiment or test have a wide range of values. You do not connect the points in a scatter plot,
Scatter Plots. Definitions  Scatter Plot: A graph in which the values of two variables are plotted along two axes, the pattern of the resulting points.
Identify bottlenecks Facilitators’ Workshop on District Health Performance Improvement Lilongwe, 25 th – 27 th March 2015.
Name of Presenter(s) Project Members.  Introduce the problem, the areas or services affected, who was involved on the team, and how it came together.
1 Insert image of project technology if applicable Name of Project.
Student Notes Experimental Design/Scientific Method Name:Class:
Sample Graph Bullet Slide Bullet point –Sub Bullet.
Bullet 1 Bullet 2 Bullet 3 Bullet 1 Bullet 2 Bullet 3 Bullet 1 Bullet 2 Bullet 3 Bullet 1 Bullet 2 Bullet 3 Bullet 1 Bullet 2 Bullet 3 Plan Design Build.
The USAID Agency-wide Climate Change Evaluation Agenda: Unpacking Overarching Concepts Nancy Peek, Research Associate, Development and Training Services,
Green Grass Template Presenter Name. Example Bullet Point Slide Bullet point –Sub Bullet.
Module 11: Polymorhism #1 2000/01Scientific Computing in OOCourse code 3C59 Module 11: Polymorphism and virtual methods In this module we will cover Polymorphism.
PowerPoint Demonstration Topics of Discussion n Using PowerPoint n Creating Your Own Presentation.
Cleaning Reforms Area Based Cleaning Model.
Animate objects and threads
Rules for Graphing.
Linear Equations in Two Variables
TITLE This study was funded by
TITLE This study was funded by
R Programming For Sql Developers ETL USING R
Code is on the Website Outline Comparison of Excel and R
London template Your name.
Installing Packages Introduction to R, Part II
Equations of Lines in Another Format
How to Make and Use a DNA Fragment Standard Curve
Informational/Explanatory Writing
You may insert your company logo.
Students will be able to graph equations of lines.
TITLE This study was funded by
The Grammar of Graphics
Presentation transcript:

Using Lattice to Plot Grouped Data Richard Pugh 4 th December 2012

Agenda What are Lattice Graphics? Panel Functions Grouped data The mechanics of grouped plots Plotting more than 1 group Summary

The Data We Will Use Something relevant and sector independent London Tube Performance Data from the TFL website Excess Travel Hours by Line tube-network-performance-data

What are Lattice Graphics?

Overview of Lattice Graphics One of the graphic systems of R (others include “Traditional” and “GGPlot”) An implementation of the S+ “Trellis” Graphics Written by Deepayan Sarkar, Fred Hutchinson Cancer Research Center

Panel Functions

For each lattice graph, R performs the following actions: Partitions the data Draws the graph “outline” (i.e. the “panels”) Passes the data for each panel into the “panel” function We can overwrite this panel function and supply our own …

Panel Functions The default “panel” function for a lattice function is “panel.NameOfFunction” Let’s look at panel.xyplot …

Arguments for styling Jitter & other less used bits Let’s write our own panel function …….

Now what? Now we can insert other functions into a panel function which will then impact each individual plot panel We can call: Lattice “low level functions” ( lpoints, ltext, llines, lpolygon etc) Existing “panel.” functions that exist for this purpose

Grouped Data

Many datasets will have inherit groupings Examples may include: “Stock” for finance data “Subject” for pharma data We *always* want to take this into account when working with graphics

Grouped Data We can specify groupings within our data in order to plot these groupings separately By default, lattice will vary styling of the groups specified The key argument is the “groups” argument

The Mechanics of Grouped Data

Plotting more than 1 group of data

Something I want to a do a lot Examples: Group by sector when plotting stock data Group by dose group when plotting subject data Grouping Variable “Base” Grouping Variable

Summary

Lattice is a great framework to use when your data is highly structured We can use the “panel.groups” structure in order to ensure a “base” grouping variable is always taken into account Slides, Data and Scripts will be at LondonR.org soon

Questions?