Announcements. Lecture 1 - Data and Data Summaries. Data. Numerical Data. all variables. continuous discrete. Homework 1 - Out 1/15, due 1/22

Similar documents
Stat Lecture Slides Exploring Numerical Data. Yibi Huang Department of Statistics University of Chicago

Nicole Dalzell. July 2, 2014

Chapter 2: Tools for Exploring Univariate Data

Stat 101 Exam 1 Important Formulas and Concepts 1

STAT 200 Chapter 1 Looking at Data - Distributions

Describing distributions with numbers

Describing distributions with numbers

MATH 1150 Chapter 2 Notation and Terminology

Describing Distributions

Math 140 Introductory Statistics

Math 140 Introductory Statistics

TOPIC: Descriptive Statistics Single Variable

Descriptive statistics

Performance of fourth-grade students on an agility test

Chapter 4. Displaying and Summarizing. Quantitative Data

Describing Distributions with Numbers

AP Final Review II Exploring Data (20% 30%)

A is one of the categories into which qualitative data can be classified.

Math 223 Lecture Notes 3/15/04 From The Basic Practice of Statistics, bymoore

Lecture 1: Description of Data. Readings: Sections 1.2,

What is statistics? Statistics is the science of: Collecting information. Organizing and summarizing the information collected

M 140 Test 1 B Name (1 point) SHOW YOUR WORK FOR FULL CREDIT! Problem Max. Points Your Points Total 75

F78SC2 Notes 2 RJRC. If the interest rate is 5%, we substitute x = 0.05 in the formula. This gives

Descriptive Statistics-I. Dr Mahmoud Alhussami

Histograms allow a visual interpretation

Topic 3: Introduction to Statistics. Algebra 1. Collecting Data. Table of Contents. Categorical or Quantitative? What is the Study of Statistics?!

Lecture 1 : Basic Statistical Measures

Describing Distributions With Numbers

Averages How difficult is QM1? What is the average mark? Week 1b, Lecture 2

STP 420 INTRODUCTION TO APPLIED STATISTICS NOTES

Preliminary Statistics course. Lecture 1: Descriptive Statistics

Determining the Spread of a Distribution

Practice problems from chapters 2 and 3

Introduction to Statistics

Determining the Spread of a Distribution

STT 315 This lecture is based on Chapter 2 of the textbook.

Determining the Spread of a Distribution Variance & Standard Deviation

Descriptive Univariate Statistics and Bivariate Correlation

Lecture Notes 2: Variables and graphics

1-1. Chapter 1. Sampling and Descriptive Statistics by The McGraw-Hill Companies, Inc. All rights reserved.

CHAPTER 2: Describing Distributions with Numbers

Lecture 2. Quantitative variables. There are three main graphical methods for describing, summarizing, and detecting patterns in quantitative data:

Slide 1. Slide 2. Slide 3. Pick a Brick. Daphne. 400 pts 200 pts 300 pts 500 pts 100 pts. 300 pts. 300 pts 400 pts 100 pts 400 pts.

Elementary Statistics

Chapter2 Description of samples and populations. 2.1 Introduction.

Chapter 1: Exploring Data

CHAPTER 1. Introduction

Units. Exploratory Data Analysis. Variables. Student Data

CIVL 7012/8012. Collection and Analysis of Information

Announcements. Final Review: Units 1-7

are the objects described by a set of data. They may be people, animals or things.

Chapter 2 Class Notes Sample & Population Descriptions Classifying variables

Unit Two Descriptive Biostatistics. Dr Mahmoud Alhussami

Tastitsticsss? What s that? Principles of Biostatistics and Informatics. Variables, outcomes. Tastitsticsss? What s that?

What is Statistics? Statistics is the science of understanding data and of making decisions in the face of variability and uncertainty.

P8130: Biostatistical Methods I

Further Mathematics 2018 CORE: Data analysis Chapter 2 Summarising numerical data

Example 2. Given the data below, complete the chart:

BNG 495 Capstone Design. Descriptive Statistics

Chapter 3. Data Description

Shape, Outliers, Center, Spread Frequency and Relative Histograms Related to other types of graphical displays

Chapter 3. Measuring data

Lecture 6: Chapter 4, Section 2 Quantitative Variables (Displays, Begin Summaries)

Summarising numerical data

(quantitative or categorical variables) Numerical descriptions of center, variability, position (quantitative variables)

Chapter 6 Group Activity - SOLUTIONS

STOR 155 Introductory Statistics. Lecture 4: Displaying Distributions with Numbers (II)

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

Announcements. Lecture 5: Probability. Dangling threads from last week: Mean vs. median. Dangling threads from last week: Sampling bias

3.1 Measure of Center

Lecture 3B: Chapter 4, Section 2 Quantitative Variables (Displays, Begin Summaries)

MATH 10 INTRODUCTORY STATISTICS

Chapter 4.notebook. August 30, 2017

Review for Exam #1. Chapter 1. The Nature of Data. Definitions. Population. Sample. Quantitative data. Qualitative (attribute) data

CS 361: Probability & Statistics

Describing Distributions With Numbers Chapter 12

Lecture 1: Descriptive Statistics

1. Descriptive stats methods for organizing and summarizing information

Lecture Slides. Elementary Statistics Twelfth Edition. by Mario F. Triola. and the Triola Statistics Series. Section 3.1- #

Perhaps the most important measure of location is the mean (average). Sample mean: where n = sample size. Arrange the values from smallest to largest:

Chapter 6. The Standard Deviation as a Ruler and the Normal Model 1 /67

Unit 2. Describing Data: Numerical

AP Statistics Cumulative AP Exam Study Guide

SESSION 5 Descriptive Statistics

Resistant Measure - A statistic that is not affected very much by extreme observations.

Exploring, summarizing and presenting data. Berghold, IMI, MUG

Statistics in medicine

Section 3. Measures of Variation

Clinical Research Module: Biostatistics

Measures of the Location of the Data

UCLA STAT 10 Statistical Reasoning - Midterm Review Solutions Observational Studies, Designed Experiments & Surveys

Statistics I Chapter 2: Univariate data analysis

Marquette University MATH 1700 Class 5 Copyright 2017 by D.B. Rowe

Descriptive Data Summarization

Chapter 1 - Lecture 3 Measures of Location

Honors Algebra 1 - Fall Final Review

Chapter 3 Examining Data

Sets and Set notation. Algebra 2 Unit 8 Notes

Unit Six Information. EOCT Domain & Weight: Algebra Connections to Statistics and Probability - 15%

Measures of center. The mean The mean of a distribution is the arithmetic average of the observations:

Transcription:

Announcements Announcements Lecture 1 - Data and Data Summaries Statistics 102 Colin Rundel January 13, 2013 Homework 1 - Out 1/15, due 1/22 Lab 1 - Tomorrow RStudio accounts created this evening Try logging in at http:// beta.rstudio.org Practice Quiz - In class 1/15 Not graded, chance to try clicker submission process. Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 2 / 37 Data Types of Data Data Types of Data Data Numerical Data all variables all variables numerical categorical numerical categorical Numerical (quantitative) - takes on a numerical values Ask yourself - is it sensible to add, subtract, or calculate an average of these values? Categorical (qualitative) - takes on one of a set of distinct categories Ask yourself - are there only certain values (or categories) possible? Even if the categories can be identified with numbers, check if it would be sensible to do arithmetic operations with these values. continuous discrete Continuous - data that is measured, any numerical (decimal) value Discrete - data that is counted, only whole non-negative numbers Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 3 / 37 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 4 / 37

Data Types of Data Data Types of Data Categorical Data Example - Class Survey numerical continuous discrete all variables regular categorical categorical ordinal Ordinal - data where the categories have a natural order Regular categorical - categories do not have a natural order Students in an introductory statistics course were asked the following questions as part of a class survey: 1 What is your gender? 2 Are you introverted or extraverted? 3 On average, how much sleep do you get per night? 4 When do you go to bed: 8pm-10pm, 10pm-12am, 12am-2am, later than 2am? 5 How many countries have you visited? 6 On a scale of 1 (very little) - 5 (a lot), how much do you dread this semester? What type of data is each variable? Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 5 / 37 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 6 / 37 Data Types of Data Visualization Representing Data - Class Survey Scatterplots We use a data matrix (data frame) to represent responses from this survey. Columns represent variables Rows represent observations (cases) student gender intro extra sleep bedtime countries dread 1 male extravert 8 10-12 13 3 2 female extravert 8 8-10 7 2 3 female introvert 5 12-2 1 4 4 female extravert 6.5 12-2 0 2....... 86 male extravert 7 12-2 5 3 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 7 / 37 http:// www.gapminder.org/ world Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 8 / 37

Visualization Histograms and shape Dot plots Useful for visualizing a single numerical variable, especially useful when individual values are of interest. 50 100 150 200 250 d$weight_kg Do you see anything out of the ordinary? Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 9 / 37 Histograms Preferable when sample size is large but hides finer details like individual observations. Histograms provide a view of the data s density, higher bars represent where the data are more common. Histograms are especially useful for describing the shape of the distribution. 0 10 20 30 40 0 2 4 6 8 10 # Sex Partners Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 10 / 37 Histograms and shape Histograms and shape Bin width The chosen bin width can alter the story the histogram is telling. 0 20 40 60 0 10 20 30 40 0 5 10 15 0 10 20 30 40 0 5 15 25 0 5 15 25 # FB / Day # FB / Day # FB / Day Which histogram is the most useful? Why. Skewness Histograms are said to be skewed towards the direction with the longer tail. A histogram can be right skewed, left skewed, or symmetric. 0 2 4 6 8 10 0 10 20 30 40 0 2 4 6 8 10 0 10 20 30 40 0 1 2 3 4 5 6 0 10 20 30 40 50 60 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 11 / 37 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 12 / 37

Histograms and shape Histograms and shape Modality This describes the pattern of the peaks in peaks in the histogram - a single prominent peak (unimodal), several (bimodal/multimodal), or no prominent peaks (uniform)? 0 5 10 15 0 5 10 15 20 0 2 4 6 8 10 12 14 Clicker Question Which of the following variables is most likely to be uniformly distributed? 1 weights of adult females 2 salaries of a random sample of people from North Carolina 3 exam scores 4 birthdays of classmates (day of the month) 0 5 10 15 0 5 10 15 20 25 30 0.0 0.2 0.4 0.6 0.8 1.0 Note: In order to determine modality, it s best to step back and imagine a smooth curve (limp spaghetti) over the histogram. Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 13 / 37 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 14 / 37 Guess the center What would you guess is the average numer of hours students sleep per night? 4 5 6 7 8 9 10 Hrs. Sleep / Night Guess the center, cont. What would you guess is the average weight of students? 50 100 150 200 250 Weight (kg) Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 15 / 37 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 16 / 37

Mean Are you typical? Sample mean ( x) - Arithmetic average of values in sample. x = 1 n (x 1 + x 2 + x 3 + + x n ) = 1 n Population mean (µ) - Computed the same way but it is often not possible to calculate µ since population data is rarely available. n x i µ = 1 N (x 1 + x 2 + x 3 + + x N ) = 1 N The sample mean is a sample statistics, or a point estimate of the population mean. This estimate may not be perfect, but if the sample is good (representative of the population) it is usually a good guess. N x i http:// www.youtube.com/ watch? v=4b2xovkffz4 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 17 / 37 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 18 / 37 Variance Standard deviation Sample Variance Population Variance Sample SD Population SD s 2 = 1 n 1 n (x i x) 2 σ 2 = 1 N Roughly the average squared deviation from the mean. N (x i µ) 2 s = s 2 = 1 n 1 n (x i x) 2 σ = σ 2 = 1 N N (x i µ) 2 Why do we use the squared deviation in the calculation of variance? Note that variance has square units while the SD has the same units as the data - this leads to a more natural interpretation. Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 19 / 37 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 20 / 37

Distribution of one numerical variable Distribution of one numerical variable Variability Variability vs. vs. diversity diversity Variability vs. diversity Variability vs. diversity Distribution of one numerical variable of Diversity Which vs Variability Which of the the following following sets sets of of cars cars has has more more diverse diverse composition composition of of colors? Which of the following sets of cars has more diverse composition of colors?of Which the following sets of cars has more diverse composition of colors? Which group of1:cars has a more diverse set of colors? Set colors? Set 1: Set 1: Set 1: Distribution of one numerical variable Variability (cont.) Variability vs. vs. diversity diversity (cont.) Variability Variabilityvs. vs. diversity diversity(cont.) (cont.) DiversityWhich vs Variability (cont.) of the following sets of cars has more variable mileage? Which of the following sets of cars has more variable mileage? Which of the following sets of cars has more variable mileage? Set 1: of the following sets of cars has more variable mileage? Which Set Which group of1:cars has a more variable mileage? Set 1: Set 1: 23 / 26 23 / 26 2 23 / 26 2 Statistics 102 (Colin Rundel) January 13, 2013 21 / 37 Lec 1 23 / 26 Statistics 102 (Colin Rundel) Median, Quartiles, and IQR January 13, 2013 22 / 37 Box plot The median is the value that splits the data in half when ordered in ascending order, i.e. 50th percentile. 0, 1, 2, 3, 4 A box plot visualizes the median, the quartiles, and suspected outliers. The 25th percentile is also called the first quartile, Q1. The 75th percentile is also called the third quartile, Q3. The range the middle 50% of the data span is called the interquartile range, or the IQR. Number of Characters (in thousands) 2+3 0, 1, 2, 3, 4, 5 = 2.5 2 50 40 max whisker reach 30 January 13, 2013 23 / 37 upper whisker 20 10 0 Lec 1 suspected outliers 60 If there are an even number of observations, then the median is the average of the two values in the middle. Statistics 102 (Colin Rundel) Lec 1 Q3 (third quartile) median Statistics 102 (Colin Rundel) Q1 (first quartile) lower whisker Lec 1 January 13, 2013 24 / 37

Box plot - Example Resting Pulse Range and IQR 62, 64, 68, 70, 70, 74, 74, 76, 76, 78, 78, 80 Steps: Range Distribution of one numerical variable Range of the entire data. 1 Calculate median, Q1, Q3, IQR, min, and max 2 Calculate upper and lower fences (Q1-1.5 IQR, Q3 + 1.5 IQR) IQR 3 Find the location of the upper and lower wiskers 4 Consider data points outside whiskers as potential outliers Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 25 / 37 range = max Range of the middle 50% of the data. IQR = Q3 min Q1 Is the range or the IQR more robust to outliers? Statistics 101 (Mine Çetinkaya-Rundel) 25 / 26 Clicker Question Clicker question Distribution of one numerical variable Which of the following is false about the distribution of average number of Which of the following is false about the distribution of average number hours students study daily of hours students study daily? Average number of hours students study daily 2 4 6 8 10 Min. 1st Qu. Median Mean 3rd Qu. Max. 1.000 3.000 4.000 3.821 5.000 10.000 (a) There are no students who don t study at all. (b) 75% of the students study more than 5 hours daily, on average. (c) 25% of the students study less than 3 hours, on average. (d) IQR is 2 hours. a) There are no students who don t study at all. b) 75% of the students study more than 5 hours daily, on average. c) 25% of the students study less than 3 hours, on average. d) IQR is 2 hours. Statistics 101 (Mine Çetinkaya-Rundel) 26 / 26 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 26 / 37 ï ¼ Robust statistics The median and IQR are examples of what are known as robust statistics - because they are less affected by skewness and outliers than statistics like mean and SD. As such: for skewed distributions it is more appropriate to use median and IQR to describe the center and spread for symmetric distributions it is more appropriate to use the mean and SD to describe the center and spread If you were searching for a car and are price conscious, should you be more interested in the mean or median vehicle price when considering a car? Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 27 / 37 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 27 / 37

Mean vs. median If the distribution is symmetric, center is the mean Symmetric: mean = median If the distribution is skewed or has outliers center is the median Right-skewed: mean > median Left-skewed: mean < median Relative Histograms The infant mortality rate is defined as the number of infant deaths per 1,000 live births. The relative frequency histogram below shows the distribution of estimated infant death rates in 2012 for 222 countries. Where would you estimate the third quartile to be located? 0 2 4 6 8 10 0 5 10 15 0 1 2 3 4 5 6 0.375 0.25 0.125 0 10 20 30 40 0 10 20 30 40 0 10 20 30 40 50 60 red solid - mean, black dashed - median Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 28 / 37 0 0 20 40 60 80 100 120 Infant Mortality Rate (per 1000 births) Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 29 / 37 Summarizing categorical data Visualizing categorical data Tables and Contingency tables Barplots - Absolute vs Relative We might be interested in looking at if there is a relationship between religion belief in God and gender, in which case we need to summarize both variables: No Somewhat Yes 22 23 36 but this is not enough alone. Female Male 14 8 16 7 26 10 Female Male 57 25 0 5 10 15 20 25 30 35 Arts and humanities Natural science Social sciences Other Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 30 / 37 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 31 / 37

Visualizing categorical data Visualizing categorical data Barplots - Absolute vs Relative Mosaic plots Is there a relationship between major and relationship status? Rel. 0.0 0.1 0.2 0.3 0.4 Rel Compl Single 8 2 7 6 1 17 9 5 23 1 0 3 A&H NS Rel Compl Single Arts and humanities Natural science Social sciences Other Oth SS Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 32 / 37 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 33 / 37 Visualizing categorical data Visualizing categorical data Bivariate Barplots - Stacked vs Juxtaposed Bivariate Barplots - Stacked vs Juxtaposed 0 10 20 30 40 50 Oth SS NS A&H 0 5 10 15 20 A&H NS SS Oth Rel Compl Single Rel Compl Single Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 34 / 37 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 35 / 37

across categories Summary Side-by-side box plot How does number of drinks consumed per week vary by affiliation? Drinks per week 0 5 10 15 20 25 30 Greek SLG Greek SLG Independent Visualization Summary Single numeric - dot plot, box plot, histogram Single categorical - bar plot (or a table) Two numeric - scatter plot Two categorical - mosaic plot, stacked or side-by-side bar plot Numeric and categorical - side-by-side box plot Tufte s Principles: 1 Above all else show data. 2 Maximize the data-ink ratio. 3 Erase non-data-ink. 4 Erase redundant data-ink. 5 Revise and edit Affiliation Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 36 / 37 Statistics 102 (Colin Rundel) Lec 1 January 13, 2013 37 / 37