Data Analysis and Statistical Methods Statistics 651

Similar documents
Data Analysis and Statistical Methods Statistics 651

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

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

MATH 1150 Chapter 2 Notation and Terminology

EXPERIMENT 2 Reaction Time Objectives Theory

Probability Distributions

Lecture Notes 2: Variables and graphics

Descriptive Statistics Methods of organizing and summarizing any data/information.

Data Analysis and Statistical Methods Statistics 651

Vocabulary: Samples and Populations

An Introduction to Probability and Statistics

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

ST Presenting & Summarising Data Descriptive Statistics. Frequency Distribution, Histogram & Bar Chart

Chapter 8 Sampling Distributions Defn Defn

THE SAMPLING DISTRIBUTION OF THE MEAN

Chapter 2: Tools for Exploring Univariate Data

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

Last Lecture. Distinguish Populations from Samples. Knowing different Sampling Techniques. Distinguish Parameters from Statistics

ACMS Statistics for Life Sciences. Chapter 13: Sampling Distributions

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

Analytical Graphing. lets start with the best graph ever made

Sampling, Frequency Distributions, and Graphs (12.1)

Chapter 5. Understanding and Comparing. Distributions

ECLT 5810 Data Preprocessing. Prof. Wai Lam

LC OL - Statistics. Types of Data

DEPARTMENT OF QUANTITATIVE METHODS & INFORMATION SYSTEMS QM 120. Spring 2008

9/2/2010. Wildlife Management is a very quantitative field of study. throughout this course and throughout your career.

Elementary Statistics

Business Statistics. Lecture 9: Simple Regression

Units. Exploratory Data Analysis. Variables. Student Data

Stat 101 Exam 1 Important Formulas and Concepts 1

Comparing Measures of Central Tendency *

ACMS Statistics for Life Sciences. Chapter 9: Introducing Probability

EXPERIMENT: REACTION TIME

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

Comparing Means from Two-Sample

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

Data Analysis and Statistical Methods Statistics 651

MATH 10 INTRODUCTORY STATISTICS

BIOL 51A - Biostatistics 1 1. Lecture 1: Intro to Biostatistics. Smoking: hazardous? FEV (l) Smoke

Week 1: Intro to R and EDA

SESSION 5 Descriptive Statistics

Survey on Population Mean

Analytical Graphing. lets start with the best graph ever made

Summarising numerical data

σ. We further know that if the sample is from a normal distribution then the sampling STAT 2507 Assignment # 3 (Chapters 7 & 8)

Data Presentation. Naureen Ghani. May 4, 2018

Unit 22: Sampling Distributions

Notes 3: Statistical Inference: Sampling, Sampling Distributions Confidence Intervals, and Hypothesis Testing

Describing distributions with numbers

MA30S APPLIED UNIT F: DATA MANAGEMENT CLASS NOTES

CIVL 7012/8012. Collection and Analysis of Information

CHAPTER 1. Introduction

Data Analysis and Statistical Methods Statistics 651

One-Way ANOVA. Some examples of when ANOVA would be appropriate include:

Chapter2 Description of samples and populations. 2.1 Introduction.

Lesson 19: Understanding Variability When Estimating a Population Proportion

Objective A: Mean, Median and Mode Three measures of central of tendency: the mean, the median, and the mode.

Introduction to Basic Statistics Version 2

Exam: practice test 1 MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

A SHORT INTRODUCTION TO PROBABILITY

Introduction. ECN 102: Analysis of Economic Data Winter, J. Parman (UC-Davis) Analysis of Economic Data, Winter 2011 January 4, / 51

Data Analysis and Statistical Methods Statistics 651

Description of Samples and Populations

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

ECON1310 Quantitative Economic and Business Analysis A

Using SPSS for One Way Analysis of Variance

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

3/30/2009. Probability Distributions. Binomial distribution. TI-83 Binomial Probability

FREQUENCY DISTRIBUTIONS AND PERCENTILES

Essentials of Statistics and Probability

Ø Set of mutually exclusive categories. Ø Classify or categorize subject. Ø No meaningful order to categorization.

Section 7.2 Homework Answers

Data Analysis and Statistical Methods Statistics 651

COMPLEMENTARY EXERCISES WITH DESCRIPTIVE STATISTICS

Chapter 2: Summarizing and Graphing Data

Let's Do It! What Type of Variable?

Chapter 16. Simple Linear Regression and Correlation

Statistics lecture 3. Bell-Shaped Curves and Other Shapes

Chapter 4: Probability and Probability Distributions

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

Business Statistics. Lecture 5: Confidence Intervals

CS 5014: Research Methods in Computer Science. Statistics: The Basic Idea. Statistics Questions (1) Statistics Questions (2) Clifford A.

- a value calculated or derived from the data.

Descriptive statistics

Data Analysis and Statistical Methods Statistics 651

Additional practice with these ideas can be found in the problems for Tintle Section P.1.1

University of California, Berkeley, Statistics 131A: Statistical Inference for the Social and Life Sciences. Michael Lugo, Spring 2012

Let's Do It! What Type of Variable?

download instant at

Stat 2300 International, Fall 2006 Sample Midterm. Friday, October 20, Your Name: A Number:

Chapter 2. Mean and Standard Deviation

Chapter 2 Class Notes Sample & Population Descriptions Classifying variables

Using Microsoft Excel

Describing distributions with numbers

Descriptive Univariate Statistics and Bivariate Correlation

Ø Set of mutually exclusive categories. Ø Classify or categorize subject. Ø No meaningful order to categorization.

20 Hypothesis Testing, Part I

TOPIC: Descriptive Statistics Single Variable

EXPERIMENTAL UNCERTAINTY

Transcription:

Data Analysis and Statistical Methods Statistics 651 http://www.stat.tamu.edu/~suhasini/teaching.html Suhasini Subba Rao

Review Our objective: to make confident statements about a parameter (aspect) in the population based on a given sample. Most statistical methods are based on the assumption that the sample is only a very tiny proportion of the population. Indeed, it is generally assumed that the population is infinite in size (this means if you were to count every individual in the population you would never be able stop). In certain cases, a sample may be a large proportion of the population. For example, we may want to understand the voting behaviour of residents in Hearn. To do this, 500 people were interviewed. 500 is a large proportion of the population of Hearn which is about 3000 people. In such cases, the statistical methods we will discuss in this class, are not valid. 1

Typically, for a statistical analysis to be valid, the sample size should be at most 5% of the population. All statistical inference that we do is based on the size of the sample only (not the size of the population). The size of a sample (the number in a sample) can influence the quality/reliability of the estimator. As the sample size increases the average becomes a better estimator of the population mean. By better we do not mean it will be closer, simply that the chance of it being close to the true mean is larger. This is because the sample mean is random and can vary from sample to sample. This idea is an important notion, that will be used frequently in this class. 2

A representative sample When making a confidence statement (inference) about a population based on a sample we need to ensure that the sample is somehow representative of the data. For example, if we want to make a confidence statement about the mean height of students at A&M (the population is all students at A&M) based on a sample containing only women. It is likely that this sample will be biased. This sample is NOT a representative sample of students at A&M. Female students form a subpopulation of the population of all students. The sample is representative sample of female students, rather than the population of all students. 3

A representative sample has nothing to do with sample size. A simple random sample (SRS) is an example of a representative sample. This is where every individual in the population has an equal chance of being selected. No subpopulation is excluded. In a SRS there is always a chance that an individual will be selected more than once. But in practice, implementing an SRS is usually not feasible; people do not want to be interviewed twice. This is why the Hearn example given in slide 1, where 500 people out of 3000 are sampled, is not a SRS. Each person that is interviewed is removed from the population when selecting the next person to interview. If the population size is sufficient large as compared to the sample size, the chance an individual is sampled twice is extremely small. This is why we require that the sample size is at most 5% of the 4

population size. Designing an experiment in a good way is extremely important, but something we shall not cover in this course. In this course we will mainly assume that the sample is simple random sample. 5

Samples, Populations and Variables The population and sample are made up of individuals (these are not necessarily human), these can be people, companies, animals, a chemical etc. A variable is a characteristic in the individual that we are interested in. For example, for people it could be height, blood pressure, ethnicity or mother tongue. The characteristic of interest varies from individual to individual it is natural to call it a variable. We will learn later that since it is variable it is random. 6

Different variables in an M&M bag In a bag of M&Ms we may be interested in the main colour, number of M&Ms, weight of bag, type of M&M (chocolate or peanut) etc. bag no. majority colour number of M&Ms weight of bag type 1 blue 18 2.2 ounces chocolate 2 brown 19 2.3 ounces chocolate 3 red 12 2.1 ounces peanut Types of Variables From the above we can see that variables come in several different types: Numerical continuous: eg. weight (2.2 ounces) Numerical discrete: eg. the number of M&Ms in a bag (18) 7

Binary: eg. Type (chocolate/peanut) Categorical: eg. Majority colour (blue/brown/red/green) Numerical variables always have a meaningful ordering. Beware of categorical variables disguised as a numerical variable. For example, the number of a bus is not a numerical variable but a categorical variable. In statistics we treat different types of variables in different ways. There are two types of Numerical variables, numerical discrete and numerical continuous. There is an interesting connection between these two variables. Numerical discrete variables become numerical continuous variables when averaged. For example, the number of children in a family is discrete but the average number of children in a family is continuous. 8

Therefore in this course we will treat numerical continuous and numerical discrete variables in the much same way (with a few exceptions). In more advanced courses (such as STAT652), where more sophisticated models are used. Numerical discrete and numerical continuous variables will be treated differently. During the course we will consider different methods for treating different types of variables. 9

Examples of variables What type of variables are the following: The gender of a randomly chosen person (we can use M/F or 0/1)? The number of a randomly selected bus? The make of bicycle of a randomly chosen person? The number of bicycles owned by a randomly chosen person? The height of person? Whether a random selected person responds to a drug? The predictions of Paul the octopus (win or lose). 10

Statistical Analysis comes in three stages (1) Data description. When starting a data analysis first use a graphical method to represent the data (Chapter 3, Ott and Longnecker). I.e. histograms, pie charts, line graphs, line and whisker plots etc. (2) Summary statistics, average (mean), median, variance, quantiles etc. This describes the data set (which can be large) in a few numbers, it also gives us an idea about the spread of the data. (3) Quantative techniques (this will be the main focus of the course, Chapter 3-11, Ott and Longnecker). We can evaluate an average, but what does this average tell us about of the true population average (usually called population mean)? How close is the sample average to the population average? We will be finding out a few weeks from now. 11

Visual Tools One picture is more effective than a thousand words. Reasons to reuse and recycle plastics: https://www.stat.tamu.edu/~suhasini/plastic.html When analyzing data find the plotting tool which best describes the data. http://www.stat.tamu.edu/~suhasini/teaching651/temp_faraday.dat This is the minimum and maximum monthly temperatures in the Antarctic Peninsula (from 1951-2004). To understand how the temperatures change over time, below is a time series plot of both the min and max temperatures. 12

13

What features do you observe? Is there seasonality? Is there a slow increase? What are the differences between the two plots? There are interesting plotting tools, such as time series plots, pie charts etc (see Ott and Longnecker, Chapter 3). 14

Open JMP Opening data in JMP JMP > Preferences > Text Data Files > Import Setting check the Use best guess box. This displays the data in the correct way (recognizes spaces or commas as a new column etc,) Data on hard drive Go to File > Open. Then you will see a Finder or File Manager. Select file and and press open. Data on internet Go to File > New (an empty spread sheet will pop up) > File > Internet Open...A window will pop up. Paste desired url in the pop-up window. You should see the data in a JMP spreadsheet. 15

The data in JMP The symbol on the left indicates how JMP reads each variable. The blue right angle triangle mean JMP reads the variables are continuous numerical. 16

You can change the type of variable by clicking on the symbol/triangle. It can be changed to ordinal (numerical discrete; data with an ordering such as ratings) nominal variable (which is another name for categorical). Ensuring the variable is correctly is specified in JMP is important for using the appropriate statistical procedure. 17

Histograms: A tool for plotting the distribution of numerical variables Range The smallest interval which contains all the data. For example, the range of 22, 23, 39, 37, 31, 24, 24, 26, 27, 41 is the interval [22, 41]. Bin Partitioning of the Range (usually into equal parts). Frequency Number/or percentage of data lying in each bin. The histogram is a plot device for checking the frequency of observations in a certain interval. It does this by partitioning the range and plotting frequency of each bin as a height on the graph. The size of each bin is called the binwidth. 18

Relative frequency histogram Is exactly the same as the histogram. The only difference is that height is not the number in the bin but the proportion in the bin. It is usually more useful than a standard histogram since proportions convey more information than the raw numbers. 19

Plotting a Histogram Example using binwidth 4. interval [20-24] [25-29] [30-34] [35-39] [40-44] count 4 2 1 2 1 percent/relative frequency 40% 20% 10% 20% 10% The Histogram (in Statcrunch and JMP): 20

Once data is loaded into JMP. Plotting a Histogram in JMP Analyze > Distribution. A window will pop up will variable. Highlight and (double) click on variable you want to plot. Press OK. You can adjust the histogram by selecting red arrow next to the variable and going to Histogram option. To get counts on the y-axis choose Count Axis. To get proportions/relative frequency (percentage of data on the y-axis) choose Prob Axis. You can change the bin width by selecting Set Bin Width. If you click on a block in the histogram, it will be highlighted as a stripped block. The data which contributes to that block will be highlighted on the corresponding spreadsheet. 21

To make comparisons between different subgroups, highlight the factor variable click on By. 22

Features in a histogram? Outcomes that are most frequent. If the sample is a composition of multiple populations (more of this later), these can be seen with multiple modes in the histogram. The spread of the data, the main concentration of the data. Warning: The histogram and your perception of how the data is distributed depends heavily on the bin width you use. In practice, it is useful to plot several histograms with different bin widths, and compare the plots. 23

The distribution of M&Ms in a bag Observe how different bin widths can change your perception of the data. 24

Using a histogram to compare populations A histogram is a very useful tool for comparing samples and seeing whether they come from the same or from different populations. We will learn more quantative methods of comparison later in the course. What we do now is simply a visual comparison. Example We could expect the temperatures in January in the Antarctic to be more than those in May in the Antarctic (recall that in the Antarctic, January is summer and May is winter) not that all temperatures are in Celsius. Below are the histograms of data taken in January and a sample taken from May (maximum temp). What do you think? 25

Comparing temperatures in the Antarctic 26

The top plot the summer temperatures and the lower plot are the winter temperatures in the Antarctic between 1951-2005. What do you notice? We see that the histograms appear to be a shift of each other. How to quantify the main features and the differences? There are several ways to do this. One way is to consider a numerical value which describes a feature in the data, and to compare the numerical values from each sample. From the point of view of statistical inference, it is much easier to compare numerical values than graphs. One measure of center is the average (sample means) of the sample. 27

Summary of the Histogram For discrete variables the relative frequency histogram is an appropiate way to represent the frequency/distribution of a sample or population. The y-axis gives the proportion of the population who live in 2- person households, 3-person households etc. The relatively frequency histogram of the population contains all the information on the distribution of the population. However, making a relatively frequency histogram for continuous data is problematic. No relative frequency histogram will contain all the information about the population. By construction, the relatively frequency histogram is restricted by the chosen binwidth. 28

If the binwidth of the plot is two, you cannot obtain the proportions for bins less than two. Consider the heights of all people in the world. Suppose you make a relatively frequency histogram using the bin-width of 0.01m (1cm). This will convey a lot of information about the data - but not all. It will not tell you the proportion of people between 1.60-1.605 meters tall (this binwidth is narrower than 0.01m). To get over this problem (and other mathematical issues), we consider a closely related cousin of the relative frequency histogram called the density plot. For numerical continuous variables no relative frequency histogram will convey all the information about the frequency of the variable. However, the density plot will. 29

The density plot The density plot is a little different to the histogram, in the sense that the area under the graph represents the frequency of an event and not the height. Look at https://www.stat.tamu.edu/~suhasini/teaching651/ density_functions.pdf, which gives information about the density. To plot the distribution of the population of numerical continuous variables we will always use the density plots. The area under the curve is used to calculate probabilities. But the height of the plot will help understand which outcomes are most likely to occur. 30

The Shape of a distribution/density The shape of a density gives important information about the population. Variables whose distributions tend to be close to symmetric: Heights of a certain gender. Length of bird bills and other biological lengths. Variables whose distributions tend to be skewed: Price of houses. Gestation period of a baby. Variables whose distributions tend to be multi-modal (have several distinct peaks). The height of adult humans (both sexes), 31

Number of M&Ms in a bag (all types, Peanut/Milk chocolate/peanut butter). Multi-modal densities suggest that it is a mix of subpopulations. Variables whose distribution tends to be flat (uniformly distributed): The numbers in a lottery. Each numerical continuous variable will have its own density plot, with its own features. In general, the distribution will not be bell shaped. Skewed distributions very common. 32