Graphical Excellence CMSC 120: Visualizing Information 2/7/08 Lecture Part II.

Slides:



Advertisements
Similar presentations
BCOR 1020 Business Statistics Lecture 4 – January 29, 2008.
Advertisements

1 1 Slide © 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole.
Introduction to Summary Statistics
Graphical Data Displays and Interpretation 2009 October 9.
Graphical Data Displays and Interpretation Wednesday, October 9.
Structured programming
Operating Systems Simulator Jessica Craddock Kelvin Whyms CPSC 410.
Python November 18, Unit 7. So Far We can get user input We can create variables We can convert values from one type to another using functions We can.
Review of Basic Statistics. Parameters and Statistics Parameters are characteristics of populations, and are knowable only by taking a census. Statistics.
T T07-01 Sample Size Effect – Normal Distribution Purpose Allows the analyst to analyze the effect that sample size has on a sampling distribution.
Information Visualization in Data Mining S.T. Balke Department of Chemical Engineering and Applied Chemistry University of Toronto.
Information Graphics Joyeeta Dutta-Moscato July 9, 2013.
Review of Measures of Central Tendency, Dispersion & Association
Economics 173 Business Statistics Lecture 2 Fall, 2001 Professor J. Petry
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 2 NUMERICAL DATA REPRESENTATION.
Chapter 2 Describing Data with Numerical Measurements General Objectives: Graphs are extremely useful for the visual description of a data set. However,
LECTURE 12 Tuesday, 6 October STA291 Fall Five-Number Summary (Review) 2 Maximum, Upper Quartile, Median, Lower Quartile, Minimum Statistical Software.
1 1 Slide © 2014 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole.
STATISTICS: BASICS Aswath Damodaran 1. 2 The role of statistics Aswath Damodaran 2  When you are given lots of data, and especially when that data is.
6.1 What is Statistics? Definition: Statistics – science of collecting, analyzing, and interpreting data in such a way that the conclusions can be objectively.
UNLOCKING THE SECRETS HIDDEN IN YOUR DATA
McGraw-Hill/IrwinCopyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved. Chapter 3 Descriptive Statistics: Numerical Methods.
Builtins, namespaces, functions. There are objects that are predefined in Python Python built-ins When you use something without defining it, it means.
McGraw-Hill/IrwinCopyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved. Chapter 3 Descriptive Statistics: Numerical Methods.
COMPSCI 101 Principles of Programming Lecture 28 – Docstrings & Doctests.
UNLOCKING THE SECRETS HIDDEN IN YOUR DATA Data Analysis.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
1 1 Slide Descriptive Statistics: Numerical Measures Location and Variability Chapter 3 BA 201.
Chapter 3 Descriptive Statistics: Numerical Methods Copyright © 2014 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
1 MATB344 Applied Statistics Chapter 2 Describing Data with Numerical Measures.
Descriptive Statistics: Numerical Methods
Review of Measures of Central Tendency, Dispersion & Association
1 1 Slide © 2007 Thomson South-Western. All Rights Reserved.
Mean, Median, Mode & Range. Mean A number that represents the centre, or average, of a set of numbers; to find the mean, add the numbers in the set, then.
Worked examples and exercises are in the text STROUD PROGRAMME 27 STATISTICS (contd)
CMSC 104: Peter Olsen, Fall 99Lecture 9:1 Algorithms III Representing Algorithms with pseudo-code.
1 1 Slide IS 310 – Business Statistics IS 310 Business Statistics CSU Long Beach.
1 1 Slide © 2006 Thomson/South-Western Slides Prepared by JOHN S. LOUCKS St. Edward’s University Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Four types Data maps (17-19, Tufte, also History of the World in 100 Seconds)History of the World in 100 Seconds Time series Narrative graphics of space.
Chapter 3, Part A Descriptive Statistics: Numerical Measures n Measures of Location n Measures of Variability.
Useful IDLE Alt-ENTER Commenting-out. Writing a Program CMSC 120: Visualizing Information 2/14/08.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
Describing Data Descriptive Statistics: Central Tendency and Variation.
RESEARCH & DATA ANALYSIS
BIA 2610 – Statistical Methods Chapter 3 – Descriptive Statistics: Numerical Measures.
Measure of Central Tendency and Spread of Data Notes.
Copyright © 2015 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
The following data represent marks of three students’ groups and each group with different teacher, find the mean of each group: A: 59, 61, 62, 58, 60.
Descriptive Statistics for one variable. Statistics has two major chapters: Descriptive Statistics Inferential statistics.
Function and Function call Functions name programs Functions can be defined: def myFunction( ): function body (indented) Functions can be called: myFunction(
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
Economics 111Lecture 7.2 Quantitative Analysis of Data.
STATISICAL ANALYSIS HLIB BIOLOGY TOPIC 1:. Why statistics? __________________ “Statistics refers to methods and rules for organizing and interpreting.
CHAPTER 3 COMPLETING THE PROBLEM- SOLVING PROCESS AND GETTING STARTED WITH C++ An Introduction to Programming with C++ Fifth Edition.
BUSINESS MATHEMATICS & STATISTICS. Module 6 Correlation ( Lecture 28-29) Line Fitting ( Lectures 30-31) Time Series and Exponential Smoothing ( Lectures.
Statistics -Descriptive statistics 2013/09/30. Descriptive statistics Numerical measures of location, dispersion, shape, and association are also used.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
Measures of Central Tendency
Functions CIS 40 – Introduction to Programming in Python
Central Tendency and Variability
Shoe Sizes.
Conditionals (if-then-else)
Python Primer 2: Functions and Control Flow
Graphical Data Displays and Interpretation
Statistical power is….
St. Edward’s University
Statistical power is….
General Computer Science for Engineers CISC 106 Lecture 03
Mean.
Presentation transcript:

Graphical Excellence CMSC 120: Visualizing Information 2/7/08 Lecture Part II

Graphical displays should: Show the data Induce the viewer to think about substance, not ◦ Methodology ◦ Design ◦ Technology Tell the truth Make the complex simple Serve a clear purpose Reveal the data

Data

Visualization

Fate of Napoleon’s Army

Principles of Graphics Excellence Matter of substance, statistics, and design Communicate complex ideas with clarity, precision, and efficiency Give viewer the greatest number of ideas in the shortest time, with the least ink, in the smallest space

A Matter of Substance and Statistics CMSC 120: Visualizing Information 2/7/08 Lecture: Part II

Data

Samples and Populations Law of Large Numbers: ◦ The more observations we have, the greater the understanding we have of the true behavior of a system Sample: set of observations Population: all possible observations

Distribution Arrangement of the set of possible solutions along a number line

Statistical Properties of Data Mean: average of all the values (expected value) Median: middle value Mode: value that occurs most often Variance: spread away from the mean Standard Deviation: square root of the variance MaxMin

Relational Statistics Covariance: spread of values in multiple dimensions Correlation: how well one measure predicts another

Pylab and Python Statistics mean( ) median( ) var( ) std( ) correlate( ) corrcoeff( ) cov( )

Sprechen de Python? CMSC 120: Visualizing Information 2/7/08: Lecture Part III

Blocks of code >>> def plotData(): plot(Year, Marijuana) show() xlabel('Year') ylabel('Percentage') title('Marijuana Drug Use') >>> def plotData(): plot(Year, Marijuana) show() xlabel('Year') ylabel('Percentage') title('Marijuana Drug Use') Function: a block of related code that performs a single task def plotData: a user-defined “keyword”

Running a Function >>> plotData()

Parameters >>> def plotData(): plot(Year, Marijuana) show() xlabel('Year') ylabel('Percentage') title('Marijuana Drug Use') >>> def plotData(): plot(Year, Marijuana) show() xlabel('Year') ylabel('Percentage') title('Marijuana Drug Use') >>> def plotData2(): plot(Year, Heroin) show() xlabel('Year') ylabel('Percentage') title('Heroin Drug Use') >>> def plotData2(): plot(Year, Heroin) show() xlabel('Year') ylabel('Percentage') title('Heroin Drug Use')

>>> def plotData(): plot(Year, Marijuana) show() xlabel('Year') ylabel('Percentage') title('Marijuana Drug Use') >>> def plotData(): plot(Year, Marijuana) show() xlabel('Year') ylabel('Percentage') title('Marijuana Drug Use') Parameters Input Flexibility >>> def plotData(data, name): plot(Year, data) show() xlabel('Year') ylabel('Percentage') title(name + ' Drug Use') >>> def plotData(data, name): plot(Year, data) show() xlabel('Year') ylabel('Percentage') title(name + ' Drug Use')

Parameters >>> plotData(Marijuana, 'Marijuana')

Parameters >>> plotData(Heroin, 'Heroin')

Functions def ( ): :

Running a Function >>> plotData() Traceback (most recent call last): File " ", line 1, in plotData() NameError: name 'plotData' is not defined

Modules Type the function definition in a text file Save  SOURCE CODE

Modules Type the function definition in a text file Save  SOURCE CODE # File: plotdata.py # Purpose: A useful plotting function # Author: Me # Import Pylab from pylab import * # Import Data from DrugData import * # Define the function def plotData(data, name): plot(Year, data) show() xlabel('Year') ylabel('Percentage') title(name + ' Drug Use') # File: plotdata.py # Purpose: A useful plotting function # Author: Me # Import Pylab from pylab import * # Import Data from DrugData import * # Define the function def plotData(data, name): plot(Year, data) show() xlabel('Year') ylabel('Percentage') title(name + ' Drug Use')

Comments Annotate Explain Identify # File: plotdata.py # Purpose: A useful plotting function # Author: Me # File: plotdata.py # Purpose: A useful plotting function # Author: Me

Import Statement Load modules into interpreter memory from import from DrugData import Marijuana # Import Pylab from pylab import * # Import Data from DrugData import * # Import Pylab from pylab import * # Import Data from DrugData import *

Strings A list of characters Indicated by ' ' String concatenation: 'a' + 'b'  'ab' title(name + ' Drug Use')

Function Definition # Define the function def plotData(data, name): plot(Year, data) show() xlabel('Year') ylabel('Percentage') title(name + ' Drug Use') # Define the function def plotData(data, name): plot(Year, data) show() xlabel('Year') ylabel('Percentage') title(name + ' Drug Use') You can define more than function in a module

Running a Function from a Module >>> from plotData import * >>> plotData(Heroin, 'Heroin') >>> from plotData import * >>> plotData(Heroin, 'Heroin')

Return Values Output return Function exits immediately after executing >>> def average(data): # function uses “average” # instead of “mean” return mean(data) >>> def average(data): # function uses “average” # instead of “mean” return mean(data)

Module Syntax: Indentation >>> def plotData(): plot(Year, Marijuana) show() xlabel('Year') ylabel('Percentage') title('Marijuana Drug Use') >>> def plotData(): plot(Year, Marijuana) show() xlabel('Year') ylabel('Percentage') title('Marijuana Drug Use') File " ", line 3 show() ^ IndentationError: unexpected indent