stat 145 - spring 2020

153
STAT 145 - Spring 2020 Elementary Statistics (Instructor: Dr. Toribio) This course pack contains the note outlines for the sections of the book that we will cover this semester. Please be sure to bring these with you to all classes as I plan to move at a pace that assumes you have the note outlines with you. Additionally, if you do not have a graphing calculator with statistical capabilities (TI-83/84, TI-89, or TI-Nspire), it is recommended that you obtain one before we start chapter 5 in the book.

Upload: others

Post on 17-Oct-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

STAT 145 - Spring 2020

Elementary Statistics(Instructor: Dr. Toribio)

This course pack contains the note outlines for the sections of thebook that we will cover this semester. Please be sure to bring thesewith you to all classes as I plan to move at a pace that assumes youhave the note outlines with you. Additionally, if you do not have agraphing calculator with statistical capabilities (TI-83/84, TI-89, orTI-Nspire), it is recommended that you obtain one before we startchapter 5 in the book.

stat 145 – spring 2020 1.0 introduction 2

1.0 Introduction

Definition of Statistics

• Is the science of learning from data.

• Is a science that deals with the collection, analysis, interpretation, and presentation of data.

• Is a bunch of methods used for the collection, analysis, interpretation, and presentation of data.

Key Concepts

• Distinguish between descriptive and inferential statistics• Distinguish between a sample and a population

Two kinds of Statistics:

1. Descriptive Statistics are methods for organizing and summarizing information.

2. Inferential Statistics are methods for drawing and measuring the reliability of conclusions about apopulation based on information obtained from a sample of the population.

(a) Population - A set of units (people, animals, objects, transactions, or events) that we are interested instudying.

(b) Samle - A part of the population from which information is collected.

stat 145 – spring 2020 1.0 introduction 3

Some examples of statistical problems:

1. The president of the Student Council of UWL wants to determine the proportion of the student popula-tion who are in favor of making the UWL campus a non-smoking zone.

2. A politician wants to know his chance of winning in the coming election.

3. Economists want to estimate the average cost of a 4-year college education in the Midwest.

4. A city engineer wants to estimate the average weekly water consumption for single-family dwellingsunits in the city.

5. Union leaders want to know if people in this state are earning less or more than those living in otherstates?

6. An environmentalist group wants to determine the number of deer living in a certain region or thenumber of fish in a lake.Capture-Recapture Method:Step 1. Capture a sample of the population, mark them, and release back to the population.

Step 2. After a certain period of time, capture another sample from the same population.

Step 3. Compute the proportion of marked individuals, and use it to estimate the population size.

7. Market researchers want to check if the type of background music in a store affects the purchasingbehavior of customers.

8. Pharmaceutical companies want to prove that their drugs are effective and better than existing drugs.

9. Credit card companies want to know the likelihood that a person with certain known characteristicswill be able to pay a loan.

10. Medical doctors want to determine if physical fitness level prior to knee surgery has an effect on thelength of rehabilitation.

Homework: Read Sections 1.1 and 1.2.

stat 145 – spring 2020 1.2 sampling from a population 4

1.2 Sampling from a Population“An approximate answer to the right problem is worth a good deal more than an exact answer to an approxi-mate problem.” – John Tukey, Famous Statistician

Key Concepts

• Distinguish between a sample and a population• Recognize when it is appropriate to use sample data to make inferences about the population• Critically examine the way a sample is selected, identifying possible sources of bias• Recognize that random sampling is a powerful way to avoid sampling bias• Identify other potential sources of bias that may arise in studies on humans

Collecting a sample from a population A population includes all individuals orobjects of interest.

A census occurs when every case in thepopulation is measured.

The sampling frame is a list of the namesof all subjects or objects in the popula-tion.

Data are collected from a sample, whichis a subset of the population.

Statistical inference is the process ofusing data from a sample to gaininformation about the population.

If we want to answer a question about a population, one way we couldfind an answer is to look at every case by taking a census. Most of thetime, however, this is not feasible. Taking a census could take monthsand is often very costly to conduct. Sometimes items are destroyedin the sampling process, like measuring the tensile strength of a wireor the length of life for a light bulb or battery. Collecting a census inthese case would be foolish. So, most of the time, researchers take asample from the population and use what they find from the sampleto describe the population. In order to make sure that all units in thepopulation are included, a sampling frame is compiled and used toselect the subjects for the sample. This process of using a sample todescribe the population is called statistical inference, and the accuracyof the inference can be greatly impacted by the quality of the sampleand how well the sample reflects the characteristics of the population.

Popula'on Parameter

Sample Sta's'c

Inference Probability

Figure 1.2.1: The cycle of statisticalinference.

stat 145 – spring 2020 1.2 sampling from a population 5

Good ways to obtain a sample A simple random sample is obtainedwhen every sample of a given size isequally likely to be the one selected.

Stratified random sampling occurs whenthe population is divided into homoge-neous, non-overlapping groups (calledstrata) and a simple random sample isselected from each group.

There are a number of appropriate ways to randomly select yoursample. The most basic type of sampling is the simple random sample.However, there are many times when we can not conduct a simplerandom sample. Stratified random sampling occurs when the popula-tion is divided into homogeneous, non-overlapping groups (calledstrata) and a simple random sample is selected from each group.

Cluster random sampling divides thepopulation into many non-overlappinggroups (called clusters), randomlyselects a subset of clusters, and collectsdata from every case in the cluster.

Cluster random sampling occurs when the population is divided intomany non-overlapping groups (called clusters), a simple random sam-ple of clusters is obtained, and data is collected from every case inthe cluster. Systematic random sampling occurs when the sample is

Systematic random sampling selects everymth individual from the population.

obtained by selecting every mth individual encountered until thedesired sample size is obtained. The idea here is to space out theselection process.

Class Example 1.2.1 Sampling StudentsConsider the population of students in Dr. Toribio’s 2001 summer elementary statistics class

Name Year Level Gender Random #1 Buck 3 F2 Diehl 1 F3 Feasel 1 F4 Harb 2 F5 Howard 2 F6 Kaits 4 F7 Killmer 1 F8 Leung 1 F9 Little 3 M

10 Norbeck 4 F11 Stiriz 3 F12 Veres 4 F13 Verlei 3 M14 Vitale 2 F

1. Assign 3-digit random numbers to each person.

2. Using the simple random sampling, draw a random sample of size 4. Write the names of the 4 studentsyou selected. Explain how you selected these students.

3. Using gender as strata, draw a sample of 7 students using the stratified random sampling with pro-portionate allocation. Write the names of the students you selected. Explain how you selected thesestudents.

stat 145 – spring 2020 1.2 sampling from a population 6

4. Using the 4 year-levels as clusters, use cluster sampling to draw a sample composed of 2 clusters. Ex-plain how you chose your sample. How many students do you have in your sample?

5. Using the systematic random sampling, draw a sample of size 4. Explain how you chose your sample.Write the names of the 4 students you selected. Explain how you selected these students.

Class Example 1.2.2 Sampling ApartmentsAn apartment building has nine floors and each floor has four apartments. The building owner wants toinstall new carpeting in eight apartments to see how well it wears before she decides whether to replacethe carpet in the entire building.

The figure below shows the floors of apartments in the building with their apartment numbers. Only thenine apartments indicated with an asterisk (*) have children in the apartment.

1. Describe a process for randomly selecting eight different apartments using the simple random samplingprocedure.

2. For convenience, the apartment building owner wants to use the cluster sampling procedure, in whichthe floors are clusters, to select the eight apartments. Describe a process for randomly selecting eightdifferent apartments using this method.

stat 145 – spring 2020 1.2 sampling from a population 7

3. An alternative sampling procedure would be to select a stratified random sample of eight apartments,where the strata are apartments with children and apartments with no children. Describe a processfor randomly selecting eight different apartments using this method. Give one statistical advantage ofselecting such a stratified sample as opposed to a cluster sample of eight apartments using the floors asclusters.

Class Example 1.2.3 Random Sampling versus Haphazard Sampling

1. Without using a coin, write a random sequence of 30 heads and tails.

2. Flip a coin 30 times and record whether or not you get heads or tails.

Bad ways to obtain a sample Sampling bias occurs when the sampledoes not accurately represent thepopulation of interest.

Voluntary response sampling occurs whena researcher asks people to volunteerto be participants instead of randomlyselecting possible participants.

Convenience sampling happens when aresearcher just uses the most convenientgroup as a sample.

Without a random sample, we may encounter sampling bias whichoccurs when the sample does not accurately represent the populationof interest. One common sampling technique that will nearly alwaysbe biased is voluntary response sampling. With this kind of sampling, aresearcher asks people to volunteer to be a part of a study. Anothercommon type of sampling that produces biased results is the conve-nience sample. In a convenience sample, a researcher simply uses themost convenient group available as the sample.

Class Example 1.2.4 Driving with a pet on your lapOver 30,000 people participated in an online poll on cnn.com conducted in April 2012 asking “Have youever driven with a pet on your lap?” We see that 34% of the participants answered yes and 66% answeredno.

a) What is the sample?

b) Can we conclude that 34% of all drivers have driven with a pet on their lap?

c) Explain why it is not appropriate to generalize these results to all drivers, or even to all drivers whovisit cnn.com. What is the problem with this method of data collection?

stat 145 – spring 2020 1.2 sampling from a population 8

d) How might we select a sample of people that would give us results that we can generalize to a broaderpopulation?

e) Is the variable in this study quantitative or categorical?

What else might go wrong? Bias occurs when the results from thesample differ from the population

Response bias is the tendency for peopleto not answer questions honestly.

Non-response bias occurs when theresponse rate is very low.

Undercoverage occurs when part ofthe population is not considered forinclusion in the sample.

Even when we take care to collect a random sample, sometimes weinadvertently introduce bias which causes our sample to differ fromthe population. For example, asking sensitive questions may result inresponse bias, because participants do not feel comfortable answeringthe question truthfully. If a lot of people do not respond to a survey,it will suffer from non-response bias. Finally, if the population fromwhich the sample is drawn excludes groups of people, then the sam-ple will suffer from undercoverage.

Class Example 1.2.5 Paying taxes

Figure 1.2.2: HAGAR the Horrible.This image is copyright protected. Thecopyright owner reserves all rights.

What kind of bias is pictured in the cartoon in Figure 1.2.2?

Suggested Exercises (1.2): 1.47 – 1.51 (odd), 1.55, 1.59

stat 145 – spring 2020 1.1 the structure of data 9

1.1 The Structure of DataStatistics is all about data. Statistics is the study of how to collect, describe, and analyze data. These skills areimportant because data are everywhere! No matter what you are studying, what you like to do, where you live, atsome point you will have to make decisions based on data or evaluate claims that someone else has made basedon data.

Key Concepts

• Recognize that a dataset consists of cases and variables• Identify variables as either categorical or quantitative• Determine explanatory and response variables where appropriate• Describe how data might be used to address a specific question• Recognize that understanding statistics allows us to investigate a wide variety of interesting phenomena

Why we collect data A population is a well-defined collectionof all individuals or objects of interest

A parameter is a number that describesa population and is almost alwaysunknown

The main purpose of collecting data is to learn about some unknownpopulation parameter. This process is called statistical inference. Oneof the main goals of this class is to introduce you the proceduresfor making statistical inferences in a variety of settings. We often

A sample is a subset of the populationon which we measure data.

Inference is the process of drawingconclusions about a population parameterfrom a sample statistic

cannot measure data for every individual in a population because itwould cost too much money or take too long, so a sample, or subsetof the population, is collected instead. Using the information in thesample, a statistic is calculated and used to estimate the correspond-ing population parameter. This process of using a sample statistic tolearn about a population parameter is called statistical inference.

Popula'on Parameter

Sample Sta's'c

Inference Probability

Figure 1.1.1: The cycle of statisticalinference.

stat 145 – spring 2020 1.1 the structure of data 10

Understanding the parts of a dataset A dataset is used to store the set ofmeasurements taken on individualunits.After data is gathered, it needs a place to be stored. In statistics, this

is called a dataset. Datasets can be as simple as an Excel spreadsheetor as complicated as a major database. It all depends the complexityof the question.

Structure: Cases and variables Cases are the subjects/objects that weobtain information about. These aremost generally known as experimentalunits.

A Variable is a characteristic that ismeasured and recorded for each case.

In general, when data is stored in a table, each row of the table rep-resents a case in the dataset. Each column of the table represents avariable in the dataset. Note: Many datasets use the first column as anidentifier. This would not be considered a variable.

Class Example 1.1.1 Distinguishing between cases and variablesFind two people near you and ask them following questions:

a) What is your first name?

b) What is your favorite color?

c) How tall are you?

d) How many credit hours are you taking this semester?

Name Color Height Credit Hours

How many cases are there?

How many variables are there?

Types of variables: Categorical or quantitative Categorical variables divide the casesinto groups, placing each case intoexactly one of two or more non-numerical, non-overlapping categories.

Quantitative variables take on numericalvalues for each case, often by measur-ing or counting. Numerical operationslike adding and averaging make sensefor quantitative variables.

Before we can know how to answer a question, we need to thinkabout the kinds of variables we have recorded. Variables that splitcases into groups are called categorical variables. Variables that arenumerical quantities are called quantitative variables.

Quantitative variables can be discrete or continuous. Discrete variableshave gaps between possible values (e.g. the number of vehicularaccidents in La Crosse per month), while continuous variables do not(e.g. the amount of rainfall in La Crosse in July).

stat 145 – spring 2020 1.1 the structure of data 11

Class Example 1.1.2 Computer ownership at UW-LUW-L would like to estimate the proportion of students who own a computer. The university asks 500

students.

a) Identify the cases and variable(s) recorded.

b) What is the sample?

c) What is the population?

d) Is the variable categorical or quantitative?

e) Identify an unmeasured quantitative variable of interest.

f) Is the result of this study a statistic or parameter?

Class Example 1.1.3 Wetlands Ecology (EPA 832-R-93-005)Government agencies carefully monitor water quality. Too much nitrogen in the water can kill fish andwildlife. 28 samples of water were taken at random from a lake, and nitrogen content (mg/L) was deter-mined for each sample. The researchers reported the average nitrogen content.

a) Identify the cases and variable(s) recorded?

b) What is the sample?

c) What is the population?

d) Is the variable categorical or quantitative?

e) Identify an unmeasured quantitative variable of interest.

f) Is the result of this study a statistic or parameter?

Investigating variables and relationships between variables An explanatory variable is one that helpsus understand or predict the value ofanother variable.

The response variable is the variable thatwe are trying to understand.

In this class we will discuss two ways in which data are used to an-swer questions. The first is looking only at a single variable, and thesecond is to determine if there is a relationship between two vari-ables. In studies that look for relationships, many times we want toknow if one variable explains the behavior of another variable. In thiskind of study, the explanatory variable would explain the behavior inthe response variable.

stat 145 – spring 2020 2.1 categorical variables 12

Class Example 1.1.4 Explanatory and response variablesFor the following research questions, identify the explanatory variable and the response variable.

a) Does eating yogurt cause people to lose weight?

b) Does meditation help reduce stress?

c) Is hyperactivity in children affected by sugar consumption?

Class Example 1.1.5 2011 Hollywood MoviesHere is a small part of a dataset that includes information on all 136 movies to come out of Hollywoodin 2011. “Rating” is audience rating on a 100-point scale, “Budget” is budget in millions of dollars, and“Opening” is opening weekend gross, in millions of dollars.

Title Lead Studio Rating Genre Budget Opening

Insidious Sony 65 Horror $1.5 $13.27Harry Potter and Deathly Hallows P2 Warner Bros 92 Fantasy $125.0 $169.19Bridesmaids Relativity 77 Comedy $32.5 $26.25The Help DreamWorks 91 Drama $25.0 $26.04Horrible Bosses Warner Bros 72 Comedy $35.0 $28.30Transformers: Dark of the Moon DreamWorks 67 Action $195.0 $197.85

a) What are the cases in this dataset?

b) What are the variables in this dataset? For each variable, identify if it is categorical or quantitative.

c) Name a question we might ask about this dataset that is about

• a single variable

• a relationship between two of the variables

Suggested Exercises (1.1): 1.13, 1.15, 1.21, 1.22

stat 145 – spring 2020 2.1 categorical variables 13

2.1 Categorical Variables“USA Today come out with a new survey - apparently three out of four people make up 75 percent of the popula-tion.” – David Letterman

Key Concepts

• Display information from a categorical variable in a table or a graph• Use information about a categorical variable to find and report a proportion, using correct notation• Display information about a relationship between two categorical variables in a two-way table• Use a two-way table to find proportions• Interpret graphs involving two categorical variables

Summarizing one categorical variable The proportion (or relative frequency) ina category is found by dividing thenumber of cases in that category by thetotal number of cases.

When we want to summarize one categorical variable, we use a pro-portion which tells us what percentage of the sample is in each group.In this course, we will use p to represent the population proportion,and p (p-hat) to represent the sample proportion.

Numerical displays A frequency table is a table that displaysthe count for each category

A relative frequency table is a table thatdisplays the proportion of the sample ineach category.

A single categorical variable is often summarized using a frequency ta-ble to display the number of observations that fall into each category.An alternative to the frequency table is the relative frequency tablewhich displays the proportion of the sample that is in each category.

Class Example 2.1.1 Party AffiliationTo study the party of affiliation of voters in Wisconsin, a survey was conduct. Out of 500 registered voterssampled from WI, 210, 225, and 65 consider themselves to be Republican, Democrat, and Independent,respectively.

1. What is the target population? What is the sample?

2. What is the variable of interest? Is it categorical or quantitative?

3. Compute the three (3) sample proportions.

Graphical summaries A bar chart includes one bar for eachcategory, and the height of the bar is thefrequency the category appears.

In a pie chart, the proportions corre-spond to the areas of sectors of a circle.

The standard graphical summaries for a categorical variable are thebar chart and the pie chart. Graphical summaries make it very easy tosee which category had the largest number of observations in it.

stat 145 – spring 2020 2.1 categorical variables 14

Summarizing two categorical variables A two-way table is used to show therelationships between two categoricalvariables.Sometimes our goal is to examine whether there is relationship be-

tween two categorical variables. To investigate these relationships, weuse a two-way table. In a two-way table, the rows represent the groupsof the first category, and the columns represent the groups of the sec-ond category. Each cell of the table contains the number of cases thatare in both the row and the column category.

Class Example 2.1.2 Relationship status and gender169 college students were asked about relationship status and gender. The results are given in Table 2.1.1

Female Male Total

In a relationship 32 10 42It’s complicated 12 7 19Single 63 45 108

Total 107 62 169

Table 2.1.1: Contingency table forrelationship status and gender.

a) What proportion of students in this sample are in a relationship?

b) What proportion of males in this sample are in a relationship?

c) What proportion of females in this sample are in a relationship?

d) Using pF to represent the proportion of females in a relationship and pM to represent the proportion ofmales in a relationship, find the difference in proportions pF − pM

e) What proportion of the people who are in a relationship in this sample are female?

f) What proportion of the people in this sample are female and in a relationship?

g) Answers c), e) and f) are all ways of representing females in a relationship. Why are they differentnumbers?

stat 145 – spring 2020 2.1 categorical variables 15

Class Example 2.1.3 Handedness and occupationIn a study of handedness in occupations, 10 of 118 psychiatrists were left-handed, 26 of 148 architects wereleft-handed, 5 of 132 orthopedic surgeons were left-handed, and 16 of 105 lawyers were left-handed.

a) Make a two-way table of this relationship.

b) What proportion of the people in the sample are left-handed?

c) What proportion of left-handed people are architects?

d) Is your answer in part c) the same or different than the proportion of architects who are left-handed?

Class Example 2.1.4 Talking about sportsA survey in November 2012 asked a random sample of 2,000 US adults “How often do you talk aboutsports with family and friends?” The results are given in Table 2.1.2.

Response Frequency Rel. Frequency

Every day or nearly every day 302About once a week 277Occasionally 526Rarely or never 895

Total 2000

Table 2.1.2: Frequency of talking aboutsports

a) What proportion rarely or never talk about sports?

b) What percent of people in the sample talk about sports once a week or more?

c) Fill in the relative frequency column for this table.

Suggested Exercises (2.1): 2.17, 2.19, 2.23, 2.25, 2.33, 2.41

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 16

2.2 – 2.3 One Quantitative Variable: Shape, Center Spread“Averages don’t always reveal the most telling realities. You know, Shaquille O’Neal and I have an averageheight of 6 feet.” – Robert B. Reich

Key Concepts

• Understand the difference between displays of categorical and quantitative data• Use a dotplot or histogram to describe the shape of a distribution• Calculate the mean and the median for a set of data values, with appropriate notation• Identify the approximate locations of the mean and the median on a dotplot or histogram• Explain how outliers and skewness affect the values for the mean and median• Use technology to compute summary statistics for a quantitative variable• Recognize the uses and meaning of the standard deviation• Interpret a five number summary or percentiles• Use the range, the interquartile range, and the standard deviation as measures of spread• Describe the advantages and disadvantages of the different measures of spread• Identify outliers in a dataset based on the IQR method

Describing quantitative data A distribution is considered symmetricif we can fold the plot over a verticalcenter line and both sides match closely.

A distribution is considered skewed leftif the longer tail of the distribution is tothe left.

A distribution is considered skewed rightif the longer tail of the distribution is tothe right.

One of the easiest ways to describe a quantitative variable is to makea dot plot or a histogram and look at the shape and center of the distri-bution. In fact, one of the major differences between the summariesof categorical and quantitative variables is that for quantitative vari-ables, we often care about the shape and center of the distribution.When we say a distribution is symmetric it means that the left-sideof a distribution is very similar to the right-side of the distribution.We say a distribution is skewed left when the tail of the distribution islonger on the left. Similarly, we say that a distribution is skewed rightwhen the tail of the distribution is longer on the right. Sometimes, wealso want to note the number or peaks (modes) of the distribution,whether it is unimodal, bimodal, or multimodal. Finally, we may alsowant to check if there are outliers or extreme values in the data.

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 17

Class Example 2.2.1 Length of Stay in HospitalsThe U.S. National Center for Health Statistics compiles data on the length of stay by patients in short-termhospitals and publishes its findings in Vital and Health Statistics. A random sample of 21 patientsyielded thefollowing data on length of stays, in days.

5 28 1 24 15 13 9

3 1 7 6 2 10 12

4 5 18 6 9 9 13

1. Construct a frequency and relative frequency tables using the following class intervals:0 < 5, 5 < 10, . . . , 25 < 30.

2. Construct a frequency histogram.

3. Construct a split stem-and-leaf plot(stemplot).

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 18

Annual income (in $1000s)

Fre

quen

cy

0 50 100 150

020

4060

80

Figure 2.2.1: Annual household in-come for a sample of 200 Kentuckyhouseholds.

Class Example 2.2.2 Kentucky householdsThe histogram in Figure 2.2.1 shows the distribution of annual household income for a random sample of200 Kentucky households.

a) Describe the shape of the distribution.

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 19

Class Example 2.2.3 Fifth-grade IQ scoresConsider the IQ test scores for 60 randomly chosen fifth-grade students.

145 139 126 122 125 130 96 110 118 118

101 142 134 124 112 109 134 113 81 113

123 94 100 136 109 131 117 110 127 124

106 124 115 133 116 102 127 117 109 137

117 90 103 114 139 101 122 105 97 89

102 108 110 128 114 112 114 102 82 101

1. Construct a frequency and relative frequency tables using the following class intervals:80 < 90, 90 < 100, . . . , 140 < 150. Then construct a frequency histogram.

2. Construct a stem-and-leaf plot(stemplot).

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 20

Review: Summation Notation

1.5

∑i=1

2i

2.10

∑i=6

(i2 − 2i)

3.10

∑i=1

Xi

4.n

∑i=1

Xi

5.n

∑i=1

X2i

6. Consider the data, 2, -1, 0, 3, 4, compute the following:

(a) ∑ x

(b) ∑ x2

(c) ∑ x2 − (∑ x)2

(d) ∑ x2 − 15(∑ x)2

(e) ∑(x− 2)2

(f) ∑ |x− 2|

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 21

Measures of center: Mean, Median, and Mode The mean of a data set is the sum of allits values divided by the number ofobservations.

The median of a dataset is the middleentry of an ordered list of data. If thereare an even number of entries, thenwe take the average of the middle twovalues.

One type of numerical summaries you will see for a dataset arecalled measures of center. Measures of center, provide us with a sin-gle number that best describes a quantitative variable’s distribution.Essentially, they give us a guess of what a typical value would looklike. There are two measure of center we will use in this class: themean and median. The mean of a sample tells us the average. For asample of observations x1, x2, . . . , xn, the mean is given by

Mean =x1 + x2 + · · ·+ xn

n=

∑ni=1 xi

n

where n is the number of observations. In this course, we will use Notation:µ: population meanx: sample mean

µ to represent the population mean and x to represent the samplemean.

Class Example 2.2.4 Finding the mean

1. Consider a random sample of 12 monthly salaries (in thousands of dollars):

2.5, 3.2, 3.2, 3.4, 3.5, 3.6, 3.9, 3.9, 3.9, 4, 4.2, 4.2

Determine the sample mean.

2. Consider the random sample of 21 length of stay in a hospital (in days):

1, 1, 2, 3, 4, 5, 5, 6, 6, 7, 9, 9, 9, 10, 12, 13, 13, 15, 18, 24, 28

Compute the sample mean.

3. Consider the problem in part 1. Suppose a 13th person was sampled and the person earns $50K permonth (or $600K per year). Compute the new sample mean. Is the new sample mean a good representa-tive of the sample?

Note: Means are sensitive to outliers.

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 22

The median, denoted m, µ, or x, divides the sample into two groups ofequal size. We find the median by following two steps:

1. Sort the sample values.

2. Find the middle value:

• If n is odd, the median is the middle value in the sorted list.

• If n is even, the median is the average (midpoint) of the middletwo values in the ordered list.

Class Example 2.2.5 Finding the median

1. Consider a random sample of 12 monthly salaries (in thousands of dollars):

2.5, 3.2, 3.2, 3.4, 3.5, 3.6, 3.9, 3.9, 3.9, 4, 4.2, 4.2

Determine the sample median.

2. Consider the random sample of 21 length of stay in a hospital (in days):

1, 1, 2, 3, 4, 5, 5, 6, 6, 7, 9, 9, 9, 10, 12, 13, 13, 15, 18, 24, 28

Compute the sample median.

3. Consider the problem in part 1. Suppose a 13th person was sampled and the person earns $50K permonth (or $600K per year). Compute the new sample median. What can you say about the magnitudeof the effect of the outlying value to the sample median?

Note: Medians are robust againstoutliers.

Class Example 2.2.6 Ants on a sandwichThe number of ants climbing on a piece of a peanut butter sandwich left on the ground near an anthill fora few minutes was measured 7 different times, and the results are: 43, 59, 22, 25, 36, 47, 19

a) Calculate the mean number of ants.

b) Calculate the median number of ants.

c) Suppose one of the sandwich bits was extremely appealing to the ants, and instead of 59, the number ofants for that bit was actually 159, giving the 7 values as: 43, 159, 22, 25, 36, 47, 19. Compute the meanand median for this new dataset.

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 23

d) Which statistic (mean or median) is impacted most by the outlier?

The mode is the most frequent occurring value.

Class Example 2.2.7 Finding the mode

1. Consider a random sample of 12 monthly salaries (in thousands of dollars):

2.5, 3.2, 3.2, 3.4, 3.5, 3.6, 3.9, 3.9, 3.9, 4, 4.2, 4.2

Determine the mode.

2. Consider the random sample of 21 length of stay in a hospital (in days):

1, 1, 2, 3, 4, 5, 5, 6, 6, 7, 9, 9, 9, 10, 12, 13, 13, 15, 18, 24, 28

Determine the sample mode.

Class Example 2.2.8 Center alone is not enough!Compute the mean, median, and mode for the following data sets:

1. S1 = 1, 2, 5, 5, 8, 9

2. S2 = 3, 4, 5, 5, 6, 7

3. S3 = 5, 5, 5, 5, 5, 5

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 24

Measures of spread: IQR, range A measure of spread tells us how muchvariability exists in the data.

The IQR (Interquartile range) is thedifference between the 1st and 3rdquantiles of the data.

In addition to measures of center, we also should report measures ofspread. A measure of spread is a statistic that indicates the type ofvariability we see for a single variable. The IQR (interquartile range)is a statistic that tells us the range of the middle 50% of the dataset.To find the IQR, we need to first estimate Q1 and Q3, the first andthird quartiles. To find Q1, we need to take the median of all thevalues below the median. To find Q3, we need to take the median ofall the values above the median. The IQR is given by

IQR = Q3 −Q1.

To find the range of the data, you take the difference between the The range is the difference between themaximum and minimum of the data.maximum and minimum of the data.

Class Example 2.2.9 Ants revisitedIn the previous example, we found that for the 7 different times, the results were 19, 22, 25, 36, 43, 47, 59

(sorted in ascending order)

a) Find the IQR for this data

b) Find the range for this data

c) Find the range and IQR if the value 59 was actually 159?

d) Which statistic (range or IQR) is impacted most by the outlier

Mean Deviation, Variance, and Standard deviation

1. Mean Deviation: MD =∑n

i=1 |xi − x|n

2. Variance:

(a) Population variance, σ2 =1N

N

∑i=1

(xi − µ)2

(b) Sample variance, S2 =1

n− 1

n

∑i=1

(xi − x)2 =∑ x2

i − 1n (∑ xi)

2

n− 1

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 25

3. Standard Deviation =√

Variance. Notation:σ: population standard deviations: sample standard deviationThe standard deviation of a variable is a rough estimate of the typi-

cal distance of a data value from the mean.

Class Example 2.2.10 Ants revisited

a) Find the standard deviation of the ants on a sandwich data.

b) Find the standard deviation of the data if the value 59 was actually 159.

Outliers An outlier is a data point that is unusualgiven the rest of the data.

A statistic is resistant if it is not im-pacted by outliers.

In the last part of the previous example, we introduced an outlier, orunusual value, into the dataset. We can use a simple rule of thumb todetermine if an observation is an outlier. A data value, x0, is consid-ered to be an outlier if

x0 < Q1 − 1.5(IQR) or

x0 > Q3 + 1.5(IQR).

Class Example 2.2.11 Length of stay in hospitals revisitedDetermine if there is an outlier in this data set, 1, 1, 2, 3, 4, 5, 5, 6, 6, 7, 9, 9, 9, 10, 12, 13, 13, 15, 18, 24, 28.

To pick an appropriate statistic to represent the data, we need toknow if it will be impacted by outliers. We call a statistic resistant orrobust if it is not impacted by outliers.

Class Example 2.2.12 Resistant statisticsLook back at your answers to the questions about ants on a sandwich.

a) Which measures of center (mean, median) are resistant?

b) Which measures of spread (IQR, range, standard deviation) are resistant?

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 26

Estimating summary statistics from a graphical summary

We may not always have access to the full dataset to come up withthe mean or median from a sample. Sometimes we need to estimatethese values from a graphical summary. For symmetric data, themean should be very close to the median. If the data are skewed left,then the mean will be less than the median. On the other hand, forskewed right data, the mean will be greater than the median.

Class Example 2.2.13 Hollywood movies: World grossWorld gross income from all viewers (in millions of dollars) of all movies to come out of Hollywood in2011 is shown in Figure 2.2.2. There are 136 movies represented in the dotplot.

Figure 2.2.2: World gross income fromall viewers (in millions of dollars) of allmovies to come out of Hollywood in2011.

a) Use the dotplot in Figure 2.2.2 to estimate the median income from all viewers (in millions of dollars) ofall movies to come out of Hollywood in 2011.

b) Should the mean income be lower than, about the same as, or higher than the median? Explain.

c) Estimate the IQR of the income from all viewers.

Choosing the best summary statistics

When picking summary statistics to best represent the data, youshould always consider the shape of your distribution. For symmet-ric and bell-shaped distributions, you should use mean and standarddeviation to describe the center and spread of the data. If you have adistribution that is skewed, then you should use resistant statistics likemedian and IQR to describe the center and spread of the data.

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 27

Class Example 2.2.14 Kentucky households revisitedThinking back to the Kentucky annual household histogram in Figure 2.2.1.

a) Which statistic, mean or median, would be most appropriate to represent a typical Kentucky householdincome? Why did you pick that statistic?

b) Which statistic, IQR or standard deviation, would be most appropriate to represent the spread of thedistribution for Kentucky household incomes? Why did you pick that statistic?

Empirical Rule

The Empirical Rule is a rule of thumb that applies to data sets withfrequency distributions that are mound shaped and symmetric.

1. Approximately 68% of the measurements will fall within 1 stan-dard deviation of the mean, i.e., within the interval (x − s, x + s)for samples and (µ− σ, µ + σ) for populations.

2. Approximately 95% of the measurements will fall within 2 stan-dard deviations of the mean, i.e., within the interval (x− 2s, x+ 2s)for samples and (µ− 2σ, µ + 2σ) for populations.

3. Approximately 99.7% of the measurements will fall within 3 stan-dard deviation of the mean, i.e., within the interval (x− 3s, x + 3s)for samples and (µ− 3σ, µ + 3σ) for populations.

Class Example 2.2.15 Length of stay in hospitals revisitedConsider the random sample of 21 patients that yielded the following data on length of stays in days,

1, 1, 2, 3, 4, 5, 5, 6, 6, 7, 9, 9, 9, 10, 12, 13, 13, 15, 18, 24, 28.

Histogram of Length of Stay

Number of Days

Frequency

0 5 10 15 20 25 30

02

46

8

Compute x, s2, and s. Note that ∑ xi = 200 and ∑ x2i = 2936.

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 28

1. Determine the proportion of values between (x− s, x + s).

2. Determine the proportion of values between (x− 2s, x + 2s).

Class Example 2.2.16 Percent of Body Fat in MenThe variable BodyFat in the BodyFat dataset gives the percent of weight made up of body fat for 100 men.For this sample, x = 18.6 and s = 8.0. The distribution of body fat values is roughly symmetric and bell-shaped. Find an interval that is likely to contain approximately 95% of the data values.

Z-scores

1. The sample z-score for a measurement x is z =x− x

s.

2. The population z-score for a measurement x is z =x− µ

σ.

Class Example 2.2.17 December TemperatureSuppose we look at the December temperature information at the following 3 cities: [Note: C = 5

9 (F− 32)]

µ σ xJuneau, Alaska 10

oF 3oF 7

oFLa Crosse, Wisconsin 25

oF 5oF 18

oFManila, Philippines 27

oC 2oC 24

oC

1. If x represents the temperature on a certain day in December, compute the z−score for the temperaturein La Crosse, WI. Interpret the value of the z−score.

2. Which of the three cities experienced the most extreme temperature relative to their normal tempera-ture?

stat 145 – spring 2020 2.2 – 2.3 one quantitative variable: shape, center spread 29

Recentering and rescaling of data

Class Example 2.2.18 Length of stay in hospitals revisitedConsider the random sample of 21 length of stays of patients, 1, 1, 2, 3, 4, 5, 5, 6, 6, 7, 9, 9, 9, 10, 12, 13, 13, 15, 18, 24, 28.

1. If 5 is subtracted from each observation, find

(a) the sample mean of the new set of values.

(b) the standard deviation (s) of the new set of values.

Rule 1: If Y = X + a, then µY = µX + a or Y = X + a, and σY = σX or SY = SX

2. If each observation is doubled, find

(a) the sample mean of the new set of values.

(b) the standard deviation (s) of the new set of values.

Rule 2: If Y = b ∗ X, then µY = b ∗ µX or Y = b ∗ X, and σY = b ∗ σX or SY = b ∗ SX

General Rule: If Y = bX + a, then

(a) µY = b ∗ µX + a or Y = b ∗ X + a

(b) σY = b ∗ σX or SY = b ∗ SX

Class Example 2.2.19 Temperature in MelbourneThe mean daily high temperature in December in Melbourne, Australia is 23.5oC with a standard deviationof 0.25

oC. Determine the mean and standard deviation of the daily high temperatures in December inMelbourne, Australia in oF. [note: F = 9

5 C + 32]

Class Example 2.2.20 Salary of WorkersThe mean salary of workers in a large retail store is $8.25 per hour with a standard deviation of $1.75. Asan incentive for outstanding performance, the retail store decided to give a bonus of $10 per day (8-hourwork day) for the employee of the month. That is, if a worker’s regular pay is x dollars per hour, thenwhen this person is the employee of the month, he/she will receive a total of T = 8x + 10 dollars per day.Determine the mean and standard deviation of T.

stat 145 – spring 20202.4 outliers, boxplots, and quantitative/categorical relationships 30

Class Example 2.2.21 Expected IncomeLinda is a sales associate at a large auto dealership. At her commission rate of 25% of profit on each ve-hicle she sells, Linda expects to earn $325 for each car sold. On average, she is able to sell three cars ona typical week. If she has a fixed salary of $200 per week, compute Linda’s average income on a typicalweek.

Class Example 2.2.22 Mean and SD of Z-scores

Let zi =xi − x

sx, find z and sz.

Percentiles The Pth percentile is the value of aquantitative variable which is greaterthan P percent of the data.Most of you have seen a percentile at some point in the past. Perhaps

it was given on the results of a standardized test, or maybe you havehad an instructor who has given the median score for an exam orquiz. The Pth percentile tells us the value in the dataset that is largerthan P percent of the data.

Class Example 2.2.23 Three important percentilesWe have already discussed three important percentiles in class. Use what you know about the followingstatistics to determine which percentile it represents: Q1, Median, and Q3.

Suggested Exercises (2.2): 2.63, 2.69, 2.75, 2.77

Suggested Exercises (2.3): 2.107, 2.109, 2.111, 2.119, 2.129

stat 145 – spring 20202.4 outliers, boxplots, and quantitative/categorical relationships 31

2.4 Outliers, Boxplots, and Quantitative/Categorical Re-lationships

Figure 2.4.1: Boyfriend fromhttp://xkcd.com

Key Concepts

• Use a boxplot to describe data for a single quantitative variable• Use a side-by-side graph to visualize a relationship between quantitative and categorical variables• Examine a relationship between quantitative and categorical variables using comparative summary

statistics

Another display for quantitative data The boxplot is a graphical display of thefive-number summary which consists ofthe minimum, Q1, median, Q3, and themaximum of a dataset.

So far in this class, we have used histograms and dot plots to repre-sent data graphically. There is another very commonly used graph-ical summary called the boxplot. The boxplot gives us a graphicaldisplay of the five-number summary which consists of the minimum,Q1, median, Q3, and the maximum of a dataset.

Class Example 2.4.1 Length of stay in hospitals revisitedConsider the random sample of 21 length of stays of patients, 1, 1, 2, 3, 4, 5, 5, 6, 6, 7, 9, 9, 9, 10, 12, 13, 13, 15, 18, 24, 28.

1. Obtain the five-number summary.

(a) Minimum - X(1)

(b) First Quartile - Q1

(c) Median - X

(d) Third Quartile - Q3

(e) Maximum - X(n)

2. Construct the ordinary and modified Boxplots

stat 145 – spring 20202.4 outliers, boxplots, and quantitative/categorical relationships 32

Class Example 2.4.2 Population of U.S. stateThe following data represent the populations of 12 of the 50 U.S. states, in millions of people, in ascendingorder.

0.506 0.830 1.315 1.813 2.333 2.9533.524 4.198 5.504 6.207 8.685 22.472

a) Obtain the five-number summary for the state populations.

b) Draw a (modified) boxplot for the data. If there are any outliers, provide a justification as to why theyare outliers and identify them on your boxplot.

Class Example 2.4.3 Charitable ContributionsThe following data set records 40 yearly charitable contributions (in dollars) to the United Fund for agroup of employees at a public university. Note that the data are arranged in increasing order.

24 28 41 ?? 47 51 56 59 63 63

63 65 67 69 70 71 75 77 78 79

79 80 80 80 80 81 81 ?? 83 84

90 92 93 99 101 103 103 112 115 125

Obtain the 5-no. summary and construct the (modified) boxplot for this data set.

stat 145 – spring 20202.4 outliers, boxplots, and quantitative/categorical relationships 33

One quantitative and one categorical variable We use side-by-side plots to visualizethe relationship between a quantitativevariable and a categorical variable.Sometimes considering the relationship between categorical and

quantitative variables, it is often helpful to plot them side-by-side.

Class Example 2.4.4 Average household incomes broken down by U.S. geographical regionFigure 2.4.2 shows a side-by-side boxplot of average U.S. household income broken down by geographicalregion of the U.S.

MW

NE

SW

35000 40000 45000 50000 55000 60000 65000

Average U.S. Household Income

Region

Figure 2.4.2: Average U.S. HouseholdIncome by Geographical Region (Mid-west, Northeast, South or West)

a) Use these side-by-side boxplots to discuss how the average U.S. household income differs by region.

b) Are there any outliers? If so, how many and estimate the values of the outliers.

c) For which region(s) would it be more appropriate to use the median instead of the mean to describe theaverage U.S. household income? Justify your answer.

stat 145 – spring 2020 p.1 probability rules 34

Class Example 2.4.5 Gross state productFigure 2.4.3 gives a boxplot of the Gross State Product for the 50 US states.

30000 40000 50000 60000

Gross State Product (GSP) per capita (in $/resident)

Figure 2.4.3: Gross State Product for the50 US states.

a) Are there any outliers? If so, how many and estimate the values of the outliers.

b) Estimate the median, IQR and range of the data.

c) How would you describe the shape of this distribution?

d) Do you expect the mean to be less than, approximately equal to, or greater than the median? Explain.

Suggested Exercises (2.4): 2.143, 2.145, 2.147, 2.149, 2.151

stat 145 – spring 2020 p.1 probability rules 35

Review: Set Notation

Consider the universal set U = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.

• Subset. A set A is said to be a subset of U, if all elements (or en-tries) of A are in U. In this case, we write A ⊆ U.

• Complement. The complement of set A, written as Ac, is the setcontaining all elements of U that are not in A.

• Union. The union of A and B, written as A ∪ B, is the set of ele-ments that belong to either A or B or both. That is,

A ∪ B = x|x is in A or x is in B.

• Intersection. The intersection of A and B, written as A ∩ B, is theset of elements that belong to both A and B. That is,

A ∩ B = x|x is in A and x is in B.

• Properties:

1. Commutativity 2. De Morgan’s Laws

(a) A ∪ B = B ∪ A a. (A ∪ B)c = Ac ∩ Bc

(b) A ∩ B = B ∩ A b. (A ∩ B)c = Ac ∪ Bc

1

Terminologies in Probability

Ø  Experiment – Any process that produces an outcome that cannot be predicted with certainty.

Ø  Example: tossing a coin, rolling dice, picking a card, doing a survey, conducting experimental studies.

Ø  Sample Space – Set of all possible outcomes. 1.  Tossing a coin: S1 = H, T. 2.  Tossing a coin 3 times:

S2 = HHH, HHT, HTH, THH, HTT, THT, TTH, TTT. 3.  Rolling a die: S3 = 1, 2, 3, 4, 5, 6 4.  Picking a card from the standard deck of cards:

S4 = A♥, 2♥,…, 10♥, J♥, Q♥, K♥, A♦, …, K♦, A♠,…, K♠, A♣, …, K♣. Total of 52 cards

Rolling a Pair of Dice

S5 (1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6)

(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6)

(3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6)

(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6)

(5, 1) (5, 2) (5, 3) (5, 4) (5, 5) (5, 6)

(6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6)

Terminologies in Probability

Ø  Event – A subset of the sample space.

1. Picking a card from the standard deck of cards: S4 = A♥, 2♥,…, 10♥, J♥, Q♥, K♥, A♦, …, K♦, A♠,…, K♠, A♣, …, K♣. Total of 52 cards E1 = The event of selecting a heart. = A♥, 2♥,…, 10♥, J♥, Q♥, K♥

E2 = The event of selecting a face card. = J♥, Q♥, K♥, J♦, Q♦, K♦, J♠, Q♠, K♠, J♣, Q♣, K♣

Rolling a Pair of Dice

Ø  Event – A subset of the sample space.

2. Rolling a pair of dice. E3 = The event of getting doubles. =(1,1), (2,2), (3,3), (4,4), (5,5), (6,6)

E4 = The event of getting a sum of 6. =(1,5),(5,1),(2,4),(4,2),(3,3)

E5 = The event of getting at least one 5. =(1,5),(2,5),(3,5),(4,5),(5,5),(6,5),(5,6),

(5,4),(5,3),(5,2),(5,1)

2

Rolling a Pair of Dice

E3 (1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6)

(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6)

(3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6)

(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6)

(5, 1) (5, 2) (5, 3) (5, 4) (5, 5) (5, 6)

(6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6)

Rolling a Pair of Dice

E4 (1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6)

(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6)

(3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6)

(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6)

(5, 1) (5, 2) (5, 3) (5, 4) (5, 5) (5, 6)

(6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6)

Rolling a Pair of Dice

E5 (1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6)

(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6)

(3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6)

(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6)

(5, 1) (5, 2) (5, 3) (5, 4) (5, 5) (5, 6)

(6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6)

Terminologies in Probability

Ø  Experiment – Any process that generates data.

Ø  Sample Space – Set of all possible outcomes.

Ø  Event – A subset of the sample space. Ø  Probability (of an event) – The chance

of this event occurring. Ø  P(E) = sum of all the sample point probabilities in

the event.

stat 145 – spring 2020 p.1 probability rules 38

P.1 Probability Rules

“Probability theory is nothing but common sense reduced to calculation." – Pierre-Simon Laplace

Key Concepts

• Compute the probability of events if outcomes are equally likely• Identify when a probability question is asking for A and B, A or B, not A, or A if B• Use the complement, additive, multiplicative, and conditional rules to compute probabilities of events• Recognize when two events are disjoint

Equally Likely Outcomes The probability of an event is the longrun frequency or proportion of timesthe event occurs. Probabilities arealways between 0 and 1.

We use the notation P() to meanprobability of.

We use the notation N() to meannumber of events in an event.

When outcomes are equally likely, theprobability of event is the number ofoutcomes in the event divided by thetotal number of outcomes.

Ω is the set of all possible outcomes.

The complement of a condition, written“not A" or Ac, includes events in whichthe condition does not happen.

Definitions

• Experiment - Any process of observation that leads to a singleoutcome that cannot be predicted with certainty.

• Sample Space - Set of all possible outcomes.

• Event - A subset of the sample space.

• Probability (of an event) - The chance of this event occurring. It isequal to the sum of sample point probabilities in the event. Underthe Equally Likely model (also known as the Uniform model), itreduces to

P(E) =N(E)N(Ω)

=no. of favorable outcomesno. of possible outcomes

stat 145 – spring 2020 p.1 probability rules 39

Properties

1. 0 ≤ P(E) ≤ 1; P(S) = 1; and P(φ) = 0

2. Probability of the Complement: P(Ec) = 1− P(E)

3. Probability of the Union:

P(A ∪ B) = P(A) + P(B)− P(A ∩ B)

If A and B are mutually exclusive(disjoint) events (they don’t inter-sect), then

P(A ∪ B) = P(A) + P(B).

Class Example P.1.1 Fast Food PreferenceSuppose all 30 students in a class were asked for their preferences for fast food. The results obtained isgiven below

Gender McDonalds Taco Bell Subway TotalMale 2 6 10

Female 3 2 7

Total

If a student is selected at random, what is the probability that

1. the student prefers Taco Bell?

2. the student is a female?

3. the student does not prefer Subway?

4. the student prefer either McDonalds or Subway?

5. the student is female who prefers Subway?

Class Example P.1.2 Employment by GenderIn a small town of 2000 people, there are 800 males, 700 of whom are employed. If a total 250 people areunemployed in this town, find the probability that a randomly selected person is

1. a male?

2. an unemployed?

3. a male and unemployed (an unemployed male)?

4. male or unemployed?

5. female and employed (an employed female)?

6. female or employed?

Suggested Exercises (P.1): P.1, P.3, P.6, P.9, P.10, P.13, P.33, P.34

stat 145 – spring 2020 p.1 probability rules 40

Counting Techniques

• Equally Likely Model. If an experiment has n different possibleoutcomes each of which has the same chance of occurring, thenthe probability that a specific outcome will occur is 1/n. If anevent occurs in k out of these n outcomes, then the probability ofthe event A, P(A), is

P(A) =no. of favorable outcomesno. of possible outcomes

=kn

Examples:

1. If a card is drawn from a well-shuffled standard deck of cards,what is the probability of getting

(a) a heart?

(b) a face card?

(c) a heart or a face card?

2. If two cards are drawn, what is the probability of getting a pair(two of a kind)?

3. If five cards are drawn, what is the probability of getting a flush(all cards of the same suit)?

• Fundamental Principle of Counting (Product Rule). Supposetwo tasks are to be performed in succession. If the first task can bedone in exactly n1 different ways, and the second task can be doneindependently in n2 different ways, then the sequence of thingscan be done in n1 × n2 different ways.

Examples:

1. If you roll a six-sided die and then pick a card from the stan-dard deck of cards, how many different possible outcomes arethere?

2. In a certain town there are 3 male and 2 female candidates formayor and 4 male and 2 female candidates for vice-mayor. Ifeach candidate has the same chance of winning the election,what is the probability that after the election they will have afemale mayor and a male vice-mayor?

stat 145 – spring 2020 p.1 probability rules 41

• General Fundamental Principle of Counting. Suppose k tasks areto be performed in succession. If the first task can be done in ex-actly n1 different ways, the second task can be done independentlyin n2 different ways, the third task can be done independently inn3 different ways, and so forth, then this sequence of k tasks can bedone in n1n2n3 · · · nk different ways.

Examples:

1. In a statistical study, an individual is classified according togender, income bracket (upper, middle, or lower class) andhighest level of educational attained (elementary, high school, orcollege). Find the number of ways in which an individual canbe classified.

2. Eight elementary students are to be lined up to board a bus.How many different possible arrangements are there?

3. Three girls and nine boys, including Mark and Jim, are to belined up to get in a bus.

(a) In how many ways can this be done?

(b) In how many ways can this be done if all the girls insist tobe together?

(c) In how many ways can this be done if Mark and Jim refusedto be together?

4. In the Mathematics department of UW-L, there are 3 male and2 female professors, 7 male and 2 female associate professors,and 4 male and 2 female assistant professors. A committeeconsisting of a professor, an associate professor, and an assistantprofessor is to be set up to review the current math curriculumof the department. Assuming that each faculty member has thesame chance of being selected for the committee work, whatis the probability that the committee will be composed of allfemale teachers?

5. In a local swimming competition, there are 20 contestants. Thefirst, second, and third placer will be awarded with gold, silver,and bronze medals, respectively. How many different possiblecompetition results are there?

stat 145 – spring 2020 p.1 probability rules 42

• Combination. Given a set of n distinct objects, any unorderedsubset of size k of the objects is called a combination. The numberof combinations of size k that can be formed from n distinct objects

will be denoted by(

nk

).

(nk

)=

n!k!(n− k)!

Examples:

1. Compute(

52

),(

53

),(

55

).

2. If you draw 5 cards from a standard deck of cards, how manydifferent possible outcomes are there?

3. If 5 cards are drawn from a standard deck of cards, in howmany ways can you get

(a) a flush (all of the same suit).

(b) a full house (a trio and a pair).

4. A jar contains 6 white and 4 red marbles. If 3 marbles are ran-domly selected, what is the probability of selecting

(a) two white and one red marbles?

(b) all white marbles?

(c) all of the same colors?

5. There are 14 male and 6 female professors in the Mathemat-ics department at UW-L. A committee of 5 members is to beformed to review the current math curriculum of the depart-ment. If each professor has equal chance of being selected forthis committee, what is the probability that the committee willhave a female majority?

stat 145 – spring 2020 p.1 probability rules 43

Conditional Probability

For any two events A and B with P(B) > 0, the conditional probability of A given that B has occurred is definedby

P(A|B) = P(A ∩ B)P(B)

Example 1. In a small town of 2000 people, there are 800 males, 700

of whom are employed. If a total 250 people are unemployed in thistown, find the probability that a randomly selected person is

1. a male?

2. employed?

3. an employed male?

4. employed given he is a male?

5. male given the person is employed?

Example 2. Suppose that of all individuals buying a certain digitalcamera, 60% include an optional memory card in their purchase, 40%include an extra battery, and 30% include both a card and battery.

1. Given that the selected individual purchased an extra battery,what is the probability that an optional memory card was alsopurchased?

2. What is the probability that an extra battery is included in thepurchase given that the person got the optional memory card?

Independence of Events

Events A and B are said to be independent if one of the following is true:

1. P(A|B) = P(A)

2. P(B|A) = P(B)

3. P(A ∩ B) = P(A) ∗ P(B)

stat 145 – spring 2020 p.1 probability rules 44

The Multiplication Rule.

P(A ∩ B) = P(A|B) · P(B) or P(A ∩ B) = P(B|A) · P(A)

Example 3. A chain of video stores sells three different brands of Blu-Ray disc player (BRP). Of its BRPssales, 50% are brand 1 (the least expensive), 30% are brand 2, and 20% are brand 3. Each manufactureroffers a 1-year warranty on parts and labor. It is known that 25% of brand 1’s BRPs require warranty repairwork, whereas the corresponding percentages for brands 2 and 3 are 20% and 10%, respectively.

1. What is the probability that a randomly selected purchaser bought a brand 1 BRP that will need repairwhile under warranty?

2. What is the probability that a randomly selected purchaser bought a BRP that will need repair whileunder warranty?

3. If a customer returns to the store with a BRP that needs warranty repair work, what is the probabilitythat it is a brand 1 BRP?

Example 4. Online chat rooms are dominated by the young. Teens are the biggest users. If we look only atadult internet users (age 18 and over), 47% of the 18 to 29 age group chat, as do 21% of those aged 30 to 49

and just 7% of those 50 and over. It is known that 29% of adult internet users are age 18 to 29, another 47%are 30 to 49 years old, and the remaining 24% are age 50 and over. If an adult internet user is randomlyselected, what is the probability that

1. Construct the tree diagram showing all the different possibilities and their corresponding probabilities.

stat 145 – spring 2020 p.1 probability rules 45

2. the person is at least 50 years old?

3. the person chats online given he/she is at least 50 years old?

4. the person is at least 50 years old and chats online?

5. the person chats online?

6. the person is at least 50 years old given that the person chats online?

Total Probability. Let A1, . . . , Ak be mutually exclusive and complementary events (That is, A1, . . . , Ak

form a partition of the sample space). Then for any other event B,

P(B) = P(B ∩ A1) + P(B ∩ A2) + · · ·+ P(B ∩ Ak)

= P(B|A1)P(A1) + P(B|A2)P(A2) + · · ·+ P(B|Ak)P(Ak)

Bayes’ Rule. Let A1, . . . , Ak be a collection of k mutually exclusive and complementary events with P(Ai) >

0 for i = 1, . . . , k. Then for any other event B for which P(B) > 0,

P(Aj|B) =P(Aj ∩ B)

P(B)=

P(B|Aj)P(Aj)

∑ki=1 P(B|Ai)P(Ai)

Practice Problems.

1. A company uses three different assembly lines −A1, A2, A3− to manufacture a particular component.Of those manufactured by A1, 5% need rework to remedy a defect, whereas 8% of A2’s componentsneed rework and 10% of A3’s need rework. Suppose that 50% of all components are produced by lineA1, 30% are produced by line A2, and 20% come from line A3. If a component is randomly selected,what is the probability that

(a) it needs rework?

(b) it came from line A1 given that it requires rework?

(c) it came from line A2 given that it requires rework?

2. Airport Security. Suppose that, in a particular city, airport A handles 60% of all airline traffic, and air-ports B and C handle 25% and 15%, respectively. The detection rates for weapons at the three airportsare .95, .90, and .85, respectively. If a terrorist plans to smuggle a weapon through one of these airports,

(a) construct a tree diagram, showing the different possibilities and their corresponding probabilities.

(b) what is the probability that his weapon will be detected?

(c) what is the probability that he tried to pass through airport C given that his weapon was detected?

Suggested Exercises (P.1 & P.2): P.31, P.32, P.35, P.43, P.55, P.57

STAT 145 - Elementary Statistics Exam I Review

• Chapter 1: Terminologies

1. Two types of statistical methods - Descriptive and Inferential Statistics.

2. Two types of data - Quantitative and Categorical (Qualitative).

3. Two types of quantitative variables - Continuous and Discrete.

4. Sampling Designs

a. Simple Random Sampling (SRS)

b. Systematic Sampling

c. Cluster Sampling

d. Stratified Sampling (with proportional allocation)

• Chapter 2: Descriptive Statistics

1. Graphical Procedures - Bar graph, Pie chart, Histograms, Stem-and-leaf plot, Dotplot, Boxplot.

2. Frequency and Relative Frequency Tables.

3. Numerical Procedures

a. Measures of Center - Mean, Median, Mode.

b. Measures of Spread - Range, Mean Deviation, Variance, Standard Deviation.

c. Five-number summary.

4. Empirical Rule (for mound-shaped and symmetric distributions: 68%, 95%, 99.7%).

5. z−score = x−µx

σx. [Note: µz = 0 and σz = 1].

6. Rules for means and standard deviations: If Y = b ∗X + a, then

a. µY = b ∗ µX + a or Y = b ∗ X + a

b. σY = b ∗ σX or SY = b ∗ SX• Chapter 3: Probability

1. Experiment - Any process of observation that leads to a single outcome that cannot be predicted withcertainty.

2. Sample Space - Set of all possible outcomes of an experiment.

3. Event - A subset of the sample space.

4. Probability (of an event) - The chance of this event occurring. It is equal to the sum of sample pointprobabilities in the event. Under the Equally Likely model (also known as the Uniform model), it reducesto

P (E) =no. of favorable outcomes

no. of possible outcomes

• Properties of probabilities:

1. 0 ≤ P (E) ≤ 1; P (S) = 1; and P (φ) = 0.

2. Probability of the Complement: P (Ec) = 1− P (E) ⇒ P (E) = 1− P (Ec).

3. Probability of the Union: P (A or B) = P (A ∪B) = P (A) + P (B)− P (A ∩B).

• Events A and B are mutually exclusive if they do not intersect. That is, P (A ∩B) = 0.

• Counting Techniques: Multiplication Principle, Permutation, and Combination.

• Conditional Probability: When P (B) > 0, the conditional probability of A given B is

P (A|B) =P (A and B)

P (B)=P (A ∩B)

P (B).

• Independence: Events A and B are said to be independent if one of the following is true:

(i) P (A|B) = P (A), (ii) P (B|A) = P (B), (iii) P (A ∩B) = P (A)P (B).

• Total Probability: Using Tree Diagrams.

• Bayes Rule: Using the Tree Diagram or the conditional probability formula.

Additional Exercises on Probability

1. If 4 girls and 6 boys are to be seated in a row, what is the probability that

a. all the girls will be sitting together?

b. all the boys will be sitting together?

c. a particular girl (Rosy) and a particular boy (Rex) will not be together?

2. In the previous problem, suppose you want to form a dance group of five. What is the probability thatthe dance group will be composed of

a. all boys?

b. 3 boys and 2 girls?

c. all girls?

d. at least 1 girl?

3. Suppose that in a sample of 200 students, 120 are taking an English course, 110 are take a Mathematicscourse, and 60 are taking both Math and English. If a student is randomly selected from this sample,what is the probability that

a. the student in not taking any Math course?

b. the student is taking English but not Math?

c. the student is taking Math but not English?

d. the student is taking at least one of these two courses?

e. the student is NOT taking any of these two courses?

f. the student is taking English given that he/she is taking Math?

g. the student is taking Math given that he/she is taking English?

4. The probability the a certain bank will setup a new branch in La Crosse is .80. The probability that thisbank will setup a new branch in Onalaska is .70. The probability that the bank will setup a new branchin both cities is .60. What is the probability that this bank

a. will NOT setup a new branch here in La Crosse?

b. will setup a new branch in at least one of these two cities?

c. will NOT setup a new branch in either cities?

d. will setup a new branch in Onalaska giventhat it already setup a new branch in La Crosse?

e. will setup a new branch in La Crosse giventhat it already setup a new branch in Onalaska?

5. Police plans to enforce speed limits by using radar traps at 4 different locations within the city limits.The radar traps at each of the locations L1, L2, L3, and L4 are operated 30%, 40%, 50%, and 20% of thetime, respectively. A person who is speeding on his way to work has probabilities of 0.2, 0.1, 0.5, and 0.2,respectively, of passing through these locations. Construct the appropriate tree diagram to answer thequestions below. What is the probability that

a. he will pass through L2?

b. he will receive a speeding ticket given that he passed through L2?

c. he will pass through L2 and will receive a speeding ticket?

d. he will receive a speeding ticket?

e. he passed through L2 given that he received a speeding ticket?

1

Random Variable – A random variable is a variable whose value is a numerical outcome of a random phenomenon. – A random variable is a function or a rule that assigns a numerical value to each possible outcome of a statistical experiment.

Two Types: 1. Discrete Random Variable – A discrete random variable has a countable number of possible values (There is a gap between possible values). 2. Continuous Random Variable – A continuous random variable takes all values in an interval of numbers.

1

Examples

Tossing a coin 3 times: Sample Space = HHH, HHT, HTH, THH, HTT, THT, TTH, TTT. Random variables :

X1 = The number of heads. = 3, 2, 2, 2, 1, 1, 1, 0 X2 = The number of tails. = 0, 1, 1, 1, 2, 2, 2, 3

2

Rolling a Pair of Dice

Sample Space:

(1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6)

(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6)

(3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6)

(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6)

(5, 1) (5, 2) (5, 3) (5, 4) (5, 5) (5, 6)

(6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6)

3

Rolling a Pair of Dice

Random variable: X3 = Total no. of dots

2 3 4 5 6 7

3 4 5 6 7 8

4 5 6 7 8 9

5 6 7 8 9 10

6 7 8 9 10 11

7 8 9 10 11 12

4

2

Rolling a Pair of Dice

X4 = (positive) difference in the no. of dots

0 1 2 3 4 5

1 0 1 2 3 4

2 1 0 1 2 3

3 2 1 0 1 2

4 3 2 1 0 1

5 4 3 2 1 0

5

Rolling a Pair of Dice

X5 = Higher of the two.

1 2 3 4 5 6

2 2 3 4 5 6

3 3 3 4 5 6

4 4 4 4 5 6

5 5 5 5 5 6

6 6 6 6 6 6

6

More Examples

Survey: Random variables :

X6 = Age in years. X7 = Gender 1=male, 0=female. X8 = Height.

Medical Studies: Random variables :

X9 = Blood Pressure. X10 = 1=smoker, 0=non-smoker.

7

Probability Distribution

Tossing a coin 3 times: Sample Space = HHH, HHT, HTH, THH, HTT, THT, TTH, TTT. Random variable : X1 = The number of heads.

= 3, 2, 2, 2, 1, 1, 1, 0

x 0 1 2 3 Prob. 1/8 3/8 3/8 1/8

8

3

Probability Histogram

Tossing a coin 3 times: Random variable : X1 = The number of heads.

X 0 1 2 3

Prob. 1/8 3/8 3/8 1/8

0

1/8

1/4

3/8

1/2

0 1 2 3

Prob

9

Rolling a Pair of Dice

Sample Space:

(1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6)

(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6)

(3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6)

(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6)

(5, 1) (5, 2) (5, 3) (5, 4) (5, 5) (5, 6)

(6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6)

10

Rolling a Pair of Dice

Random variable: X3 = Total no. of dots

2 3 4 5 6 7

3 4 5 6 7 8

4 5 6 7 8 9

5 6 7 8 9 10

6 7 8 9 10 11

7 8 9 10 11 12

x 2 3 4 5 6 7 8 9 10 11 12 P 1/36 2/36 3/36 4/36 5/36 6/36 5/36 4/36 3/36 2/36 1/36

11

Rolling a Pair of Dice

Random variable: X3 = Total no. of dots

1/361/18

1/121/9

5/361/6

5/361/9

1/121/18

1/36

0

1/8

1/4

2 3 4 5 6 7 8 9 10 11 12

Prob

x 2 3 4 5 6 7 8 9 10 11 12 P 1/36 2/36 3/36 4/36 5/36 6/36 5/36 4/36 3/36 2/36 1/36

1. Pr(X3<5)= 2. Pr(3<X3<12)= 12

4

Discrete Random Variable

A discrete random variable X has a countable number of possible values.

The probability distribution of X

x x1 x2 x3 … xk

Prob p1 p2 p3 … pk

where, 1.  Every pi is a between 0 and 1. 2.  p1 + p2 +…+ pk = 1.

13

Mean of a Discrete R.V.

The probability distribution of X

x x1 x2 x3 … xk

Prob p1 p2 p3 … pk

1.  Mean (µ) = E(X) = x1p1+x2p2+…+ xkpk 2.  Variance (σ2) = V(X) = (x1-µ)2p1 + (x2-µ)2p2

+ …+ (xk-µ) 2pk .

14

Continuous Random Variable

A continuous random variable X takes all values in an interval of numbers.

Examples: X11 = Amount of rain in October. X12 = Amount of milk produced by a cow. X13 = Useful life of a bulb. X14 = Height of college students. X15 = Average salary of UWL faculty.

The probability distribution of X is described by a density curve.

The probability of any event is the area under the density curve and above the values of X that make up the event. 15

Continuous Distributions

1.  Normal Distribution 2.  Uniform Distribution 3.  Chi-squared Distribution 4.  T-Distribution 5.  F-Distribution 6.  Gamma Distribution

16

stat 145 – spring 2020 p.3 random variables and probability distributions 52

P.3 Random Variables and Probability Distributions

• A random variable is a variable that assumes values associated with the random outcomes of an experi-ment, where one (and only one) numerical value is assigned to each sample point. A random variablecan either be discrete or continuous. A discrete random variable has a countable number of possible values(i.e., there is a gap between possible values).

• The probability distribution of a discrete random variable is a graph, table, or formula that specifies theprobability associated with each possible value the random variable can assume.

Consider the discrete r.v. X with only k possible values, then the probability distribution of X can beexpressed in a table form:

Values of X x1 x2 x3 · · · xk

Probability p1 p2 p3 · · · pk

where,

1. Every probability pi is a number between 0 and 1.

2. p1 + p2 + · · ·+ pk = 1

• Examples:

1. Using the given probability distribution of X below, find the following:

x 10 20 30 40 50P(X = x) = p(x) .18 .26 .32 .16

(a) P(X = 10) = p(10)

(b) P(X ≤ 30)

(c) P(X > 30)

(d) P(20 ≤ X ≤ 40)

(e) P(X = 25)

(f) P(X ≤ 25)

2. Roll a pair of dice (one red and one green) and let Y denote the total number of dots on the top faces.

yP(Y = y)

3. Roll a fair six-sided die until you get a 5. Let X denote the number of rolls needed to get the first 5.

stat 145 – spring 2020 p.3 random variables and probability distributions 53

• Practice:

1. In the experiment of rolling a pair of six-sided dice, let the random variable Y be the absolute valueof the difference in the number of dots. Construct the probability distribution table for Y and thecorresponding probability histogram.

yP(Y = y)

2. In the experiment of tossing a fair coin 4 times, let the random variable W be the number of headsout of the 4 tosses. Construct the probability distribution table for W and the corresponding probabil-ity histogram.

wP(W = w)

3. In a survey study of 200 college students, list 3 meaningful random variables that you can define.

(a)

(b)

(c)

Means and Variances of Discrete R.V.

Consider a discrete random variable X with only k possible outcomes.

x x1 x2 x3 · · · xk

Pr(X = x) p1 p2 p3 · · · pk

– The Mean (or expected value) of X,

µ = E(X) = x1 p1 + x2 p2 + · · ·+ xk pk =k

∑i=1

xi pi

– The Variance of X,

σ2 = V(X) = (x1 − µX)2 p1 + (x2 − µX)

2 p2 + · · ·+ (xk − µX)2 pk =

k

∑i=1

(xi − µX)2 pi

• Example 1: Let X be the number of heads when a fair coin is tossed three times. Find the mean andvariance of X.

stat 145 – spring 2020 p.3 random variables and probability distributions 54

• Example 2: Let X be the number of cars that Linda is able to sell on a typical Saturday. The probabilitydistribution for X is given below:

Car sold (x) 0 1 2 3

Probability 0.3 0.4 0.2 0.1

Find the mean and variance of X.

1. µ =

2. σ2 =

• Example 3: In the experiment of rolling a die, let Z be the number of dots on top of the die. Constructthe probability distribution table and compute the mean and variance of Z.

• Example 4: A large insurance company estimates that the probability that a $20,000 car insurance policywill result in a claim in the amount of X dollars is given in the table below:

x $0 $1,000 $5,000 $10,000 $20,000

p(x) 0.894 0.09 0.01 0.005 0.001

1. Find the mean or expected value of X.

2. Find the standard deviation of X.

stat 145 – spring 2020 p.3 random variables and probability distributions 55

• Law of Large Numbers: Draw n independent observations at random from any population with finitemean µ. As the number of observations drawn increases, the sample average x of the observed valueseventually approaches the mean µ of the population as closely as you wish and then stays that close.

• Rules for Means:

1. If X is a random variable and a and b are fixed numbers, then

µa+b∗X = a + b ∗ µX or E(a + b ∗ X) = a + b ∗ E(X)

2. If X and Y are random variables, then

µX±Y = µX ± µY or E(X±Y) = E(X)± E(Y)

• Example 5: Linda is a sales associate at a large auto dealership. At her commission rate of 25% of profiton each vehicle she sells, Linda expects to earn $350 for each car sold. The probability distributions forthe number of cars (X) that she is able to sell on a typical Saturday is given below. If she has a fixedsalary of $50 per day, compute Linda’s expected earnings on a typical Saturday.

Car sold (x) 0 1 2 3

Probability 0.3 0.4 0.2 0.1

• Example 6: In the previous example, suppose Linda also receives $400 in commision for each truck orSUV sold. The probability distributions for the number of SUVs (Y) that she is able to sell on a typicalSaturday is given below. Compute Linda’s total expected earnings on such a day.

Vehicles sold (y) 0 1 2

Probability 0.4 0.5 0.1

• Rules for Variances:

1. If X is a random variable and a and b are fixed numbers, then

Var(a + bX) = b2Var(X)

2. If X and Y are independent random variables, then

Var(X±Y) = Var(X) + Var(Y)

Suggested Exercises (P.3): P.69, P.70, P.71, P.73, P.77, P.83, P.85, P.87, P.91.

stat 145 – spring 2020 p.4 binomial probability 56

P.4 Binomial Probability

Key Concepts

• Identify a binomial random variable• Compute probabilities for a binomial random variable• Compute the mean and/or standard deviation for a binomial random variable

Bernoulli Random Variable

A Bernoulli Trial is a trial that has only two (2) possible outcomes − asuccess S or a failure F.

Bernoulli Distribution: Let the random variable X = 1 when asuccess is observed from a Bernoulli trial and X = 0 when a failure isobserved. If the probability of getting a success is denoted by p, thenthe probability distribution of X is given below

x 1 0

Pr(X = x) p 1− p

Binomial Random Variables A binomial random variable measures thenumber of successes in a fixed numberof trials.Suppose a Bernoulli trial is repeated n times. The random variable

X, that counts the number of successes out of n, follows the Binomialprobability distribution. The probability for each possible value of Xis given by the following formula

P(X = x) =(

nx

)px(1− p)n−x, for x = 0, 1, . . . , n

In order to be considered a binomial random variable, the followingproperties must hold:

1. We must be measuring the number of successes in n independenttrials

2. The number of trials, n, is fixed in advance

3. The probability of success, p, does not change from trial to trial

4. Each trial is independent of the others (the outcome of one trialdoes not affect the outcome of another trial)

stat 145 – spring 2020 p.4 binomial probability 57

Class Example P.4.1 Is it binomial?For each of the following, determine if the random variable is binomial. If it is, determine n and p.

a) On average, 25% of La Crosse residents recycle. 500 residents of La Crosse were asked if they recycle. Ais the number of ‘yes’ answers in the sample.

b) A box contains 50 marbles, 35 green and 15 white. Fifteen marbles are selected without replacement. Bis the number of white marbles in the sample.

c) An American roulette wheel consists of 18 red, 18 black, and 2 green numbers. Suppose you observedred on 10 consecutive spins. J is the number of additional spins needed until you observe black.

d) D is the number of 5s in ten rolls of a fair die.

e) Customers arrive at Alice’s with a rate of 5 per hour. E is the number of customers that enter Alice’sbetween 2 A.M. and 4 A.M.

Class Example P.4.2 How many girls?A couple plans to have exactly 5 children. Let the random variable X be the number of girls that they willhave. Assume that the probability of a male birth is 0.4 and the probability of a female birth is 0.6 and thatgender of any successive child is unaffected by previous brothers or sisters.

a) Construct the probability distribution of X.

stat 145 – spring 2020 p.4 binomial probability 58

Class Example P.4.3 Binding strength testSuppose that 20% of all copies of a particular textbook fail a certain binding strength test. If 15 of thesetextbooks are randomly selected, what is the

a) probability that exactly 4 textbooks will fail this binding strength test?

b) probability that at most 4 textbooks will fail this binding strength test?

c) probability that at least 4 textbooks will fail this binding strength test?

d) probability that between 4 to 7 (inclusive) textbooks will fail this binding strength test?

e) mean, variance, and standard deviation of this distribution?

Class Example P.4.4 Free throw shotsSuppose that each time you take a free throw shot, you have a 70% chance of making it. If you take 10

shots,

1. What is the probability of making exactly 8 of them?

2. What is the probability of making fewer than 5 shots?

3. What is the probability of making at least 8 of them?

4. What is the probability of making between 5 to 8 (inclusive) shots?

Mean, and Standard Deviation

When a random variable is binomially distributed, probabilities andother characteristics can be expressed as formulas. For a binomialrandom variable X with n trials and probability of success p,

• Mean: µ = E[X] = np

• Standard Deviation: σ = sd(X) =√

np(1− p)

stat 145 – spring 2020 5.1 continuous distributions 59

Class Example P.4.5 Finding the mean and SD of binomial variables

1. Compute the expected number of girls out of 5 children if the probability of a girl birth is 60%. Thencompute the variance and standard deviation.

2. Compute the expected number of textbooks that will fail the binding strength test if out of 15 if theprobability of a failing the test is 20%. Then compute the variance and standard deviation.

3. Compute the expected number of successful free throw shots out of 10 if the probability of a successfulshot is 70%. Then compute the variance and standard deviation.

Class Example P.4.6 Testing ESPTo test for ESP, we have 4 cards, each with different symbols. These cards are shuffled and one is chosen atrandom (symbol down). Each time, you guess the symbol on the card. Suppose you do not have ESP.

a) Let R be the number of times you guess correctly. Is R binomial? If so, what are n and p?

b) What are the expected value and standard deviation of R?

c) To be certified as having ESP, you need to correctly identify at least 6 cards of the 8 drawn. What is theprobability you get certified?

Class Example P.4.7 Customer serviceJoan takes 10 phone calls per day from customers, and, on average, 30% of these callers are angry. If 7 ormore of these callers in a given day are angry, Joan has a bad day.

a) Let C be the number of angry callers in a day. Is C binomial? If so, what are n and p?

b) How many angry callers will Joan speak to on average each day? What is the standard deviation for thenumber of angry callers?

c) What is the probability that Friday is a bad day?

d) What is the probability that 3 of 5 days in her workweek are good?

Suggested Exercises (P.4): P.117, P.121, P.125, P.127

stat 145 – spring 2020 5.1 continuous distributions 60

5.1 Continuous Distributions

Let X be a continuous random variable with density function f (x) in the interval [c, d].

1. P(X = a) ≈ 0, for any a in [c, d].

2. P(a ≤ X ≤ b) is the area under the density curve between a to b.

3. The total area under the density curve is 1.

Uniform Distribution

Let X ∼ Unif[c, d].

f (x) =1

d− c(c ≤ x ≤ d)

1. Mean: µ =c + d

2.

2. Variance: σ2 =(d− c)2

12.

Class Example 5.1.1 Delay TimeA manager of a bus company claims that the delay time (X) of buses from his company is uniformly dis-tributed between 0 to 12 minutes.

a) What is the probability that a randomly selected bus will be late for at most 5 minutes?

b) What is the probability that a randomly selected bus will be late for at least 10 minutes?

c) What is the probability that a randomly selected bus will be late between 2 to 6 minutes?

d) Determine the mean and SD of X.

stat 145 – spring 2020 5.1 continuous distributions 61

Class Example 5.1.2 Cholesterol levelToo much cholesterol in the blood increases the risk of heart disease. Young women are generally lessafflicted with high cholesterol than other groups. The cholesterol levels of women aged 20 to 34 follow anapproximately uniform distribution from 120 mg/dl to 250 mg/dl.

a) What percent of young women have cholesterol levels below 245 mg/dl? Sketch an appropriate densitycurve and shade the area under the curve that corresponds to this question.

b) What percent of young women have cholesterol levels above 245 mg/dl? Sketch an appropriate densitycurve and shade the area under the curve that corresponds to this question.

c) What percent of young women have cholesterol levels between 210 and 245 mg/dl? Sketch an appropriatedensity curve and shade the area under the curve that corresponds to this question.

d) If 220 mg/dl is the threshold cholesterol level, what is the probability that a randomly selected youngwoman has a cholesterol level that is higher than this threshold value?

e) Determine the mean and SD of the cholesterol level of women aged 20 to 34.

stat 145 – spring 2020 5.1 continuous distributions 62

Normal Distribution

X ∼ N(µ, σ2). The mean is µ and the variance is σ2.

f (x) =1√2πσ

e−1

2σ2 (x−µ)2(−∞ < x < ∞)

Class Example 5.1.3 Cholesterol level revisitedSuppose the cholesterol levels of women aged 20 to 34 follow an approximately normal distribution withmean 185 milligrams per deciliter (mg/dl) and standard deviation 39 mg/dl.

a) What percent of young women have cholesterol levels below 245 mg/dl? Sketch an appropriate normalcurve and shade the area under the curve that corresponds to this question.

b) What percent of young women have cholesterol levels between 210 and 245 mg/dl?

c) If 220 mg/dl is the threshold cholesterol level, what is the probability that a randomly selected youngwoman has a cholesterol level that is higher than this threshold value?

stat 145 – spring 2020 5.1 continuous distributions 63

Class Example 5.1.4 SAT scoresLet X be the SAT math scores for science and engineering majors. X ∼ N(609, 80)

a) What proportion of SAT scores should be under 569?

b) What is the probability that a randomly selected student with a science and engineering major has anSAT score of at least 684?

c) What proportion of SAT scores should be between 500 and 630?

Class Example 5.1.5 Rainfall in IthacaLet R be the yearly rainfall (in inches) in Ithaca, NY. Data from Cornell’s Northeast Regional Climate Cen-ter indicates that R ∼ N(35.4, 4.2).

a) How much rain should Ithaca expect to get in the year that is the 99th percentile of rainfall?

b) How much rain should Ithaca expect to get in the year that marks the top 20 percent of rainfall?

c) What should the IQR be for yearly rainfall in Ithaca? (i.e. the middle 50%)

stat 145 – spring 2020 5.1 continuous distributions 64

Class Example 5.1.6 Furniture assemblyA company that markets build-it-yourself furniture sells a computer desk that is advertised with the claim“less than an hour to assemble.” Let T be the time (in hours) it takes to assemble the furniture. Throughpost-purchase surveys, it appears that T ∼ N(1.29, 0.43).

a) What percentage of people should be able to assemble the desk in less than an hour?

b) What is the probability that a randomly selected person can assemble the desk in between 1 and 1.5hours?

c) The company would like to change the advertising claim to read “less than to assem-ble” so that 90% of people can assemble the desk in the time listed. What time should they use (as thecutoff for the bottom 90%?

Class Example 5.1.7 Standardizing to compareFor each of the following, compare the results using their standardized score

a) Benny and Aaron are on the same track team. They have recently competed at a track and field day,and have each won their respective events. Benny won the high jump with a jump of 75 inches, andAaron won the 100 m dash with a time of 12 seconds. Let J ∼ N(65, 2) be the height of the jumps andD ∼ N(15, 1) be the times of the 100 m dash. Who performed better Benny or Aaron?

b) A car manufacturer has a small car that gets 36 mpg and a truck that gets 22 mpg. Let C ∼ N(35, 4)be the distribution of mpgs for small cars and T ∼ N(19, 3) be the mpgs for trucks. Which vehicleperforms better relative to the other vehicles in its class?

Suggested Exercises (P.5 & 5.1) P.129 - P.131, P.141 - P.144, P.159, P.161, P.167, and 5.29, 5.33

stat 145 – spring 2020 5.1 continuous distributions 65

Normal Approximation To Binomial

We have learned before that if a Bernoulli trial is repeated n times, then the number of successes X out of ntrials follows the binomial distribution. That is, X ∼ bin(n, p). Now, when n is sufficiently large (np ≥ 10and n(1− p) ≥ 10), it has been shown that X ≈ N(µ = np, σ =

√np(1− p)).

Class Example 5.1.8 Using Continuity Correction

Let X ∼ bin(n = 10, p = 0.4). Calculate P(X ≤ 5).

a) Using the exact binomial distribution.

b) Using the normal approximation without continuity correction.

c) Using the normal approximation with continuity correction.

Class Example 5.1.9 Mechanical FailureAn unnoticed mechanical failure has caused 1

3 of a machine shop’s production of rifle firing pins to bedefective. If an inspector will check 90 random selected pins from this batch, what is the probability thatthe inspector will find

a) no more than 25 defective pins? Before calculating the probability, check first that you satisfy the requiredconditions.

b) less than 25 defective pins?

c) at least 20 defective pins?

d) between 22 to 34 (inclusive) defective pins?

stat 145 – spring 2020 5.1 continuous distributions 66

Class Example 5.1.10 Wearing Seat Belts

Suppose that 40% of all drivers in a certain state regularly wear a seat belt. A random sample of 500

drivers is selected. What is the probability that

a) fewer than 175 of those in the sample regularly wear a seat belt? Before calculating the probability, checkfirst that you satisfy the required conditions.

b) at least 220 of those in the sample regularly wear a seat belt?

c) between 180 and 230 (inclusive) of the drivers in the sample regularly wear a seat belt?

stat 145 – spring 2020 6.1central limit theorem 67

6.1Central Limit Theorem

Key Concepts

• Tell the difference between a sample statistic and a population parameter• Find the mean and standard error for a distribution of sample means and proportions• Identify when a normal distribution is an appropriate model for a distribution of sample means and

proportions• Determine the mean and standard error of the sampling distribution of sample means and proportions

Sample Statistics versus Population Parameters

A parameter is a numerical descriptive measure of a population. Thisquantity is usually unknown but it is constant at a given time. Examples:µ=population mean, σ=population standard deviation, p=populationproportion.

A sample statistic is a numerical descriptive measure of a sample.Its value is calculated from the observations in the sample. Examples:x=sample mean, s= sample SD, p=sample proportion.

A point estimator of a population parameter is a rule or formula thattells us how to use the sample data to calculate a single number thatcan be used as an estimate of the population parameter. For example,x, s, and p are used as estimators of µ, σ, and p, respectively.

The sampling distribution of a sample statistic calculated from asample of n measurements is the probability distribution of the statis-tic.

If the sampling distribution of a sample statistic has a mean equalto the population parameter the statistic is intended to estimate, thestatistic is said to be an unbiased estimator of the parameter. Other-wise, the statistic is said to be biased estimator of the parameter.

Class Example 6.1.1 Unbiased StatisticsIf E(X) = µ and Var(X) = σ2, then

1. E(X) = µ. [Note: Var(X) = σ2/n ⇒ SD(X) = σ/√

n]

2. E( p) = p. [Note: Var( p) = p(1−p)n ⇒ SD( p) =

√p(1−p)

n ]

3. E(s2) = σ2.

4. Note: E(s) 6= σ (That is, s is not an unbiased estimator of σ)

stat 145 – spring 2020 6.1central limit theorem 68

When we have quantitative data, we usually summarize it by tak-ing the sample mean (x). So it would be nice if we know how thisstatistic behaves in repeated trials.

Sampling Distribution of the Sample Mean

1. If a sample of size n come from a normal population, then thesample mean X of n will be normally distributed. From example 1 ofunbiased estimators, this implies that

X ∼ N(µX = µ, σX = σ/√

n).

2. Central Limit Theorem (CLT) for the Sample Mean: Draw anSRS of size n from any population with mean µ and finite stan-dard deviation σ. When n is sufficiently large (rule of thumb:n ≥ 30), the sampling distribution of the sample mean X is go-ing to be approximately normal. That is, when n ≤ 30,

X ≈ N(µX = µ, σX = σ/√

n).

Class Example 6.1.2 Finding the probability of the sample meanA soft-drink machine is regulated so that it discharges an average of 200 ml per cup. Suppose the amountof drink discharged by this machine is normally distributed with a standard deviation equal to 10 ml.

1. What is the probability that a cup will contain less than 188 ml?

2. Suppose we sample 25 cups from this machine and take their average content. What is the probabilitythat, the average content of these 25 cups is less than 188 ml?

stat 145 – spring 2020 6.1central limit theorem 69

Class Example 6.1.3 Application of the CLTThe mean time it takes a senior high school student to complete a certain achievement test is 46.2 minuteswith standard deviation of 8 minutes. If a random sample of 100 senior high school students who took thetest was selected, find the probability that the average time it takes the group to complete the test will be

1. less than 44 minutes.

2. more than 48 minutes.

3. between 44 to 48 minutes.

4. more than 50 minutes.

stat 145 – spring 2020 6.1central limit theorem 70

Sampling Distribution of the Sample Proportion

For categorical data, the goal is often to learn about a populationproportion from a sample proportion.

Central Limit Theorem (CLT) for the Sample Proportion: Drawan SRS of size n binary/dichotomous responses a population withproportion of success p. When n is sufficiently large (rule of thumb:np ≥ 10 and n(1− p) ≥ 10), the sampling distribution of the sampleproportion p is going to be approximately normal. That is, when n issufficiently large,

p ≈ N

(µ p = p, σp =

√p(1− p)

n

).

Class Example 6.1.4 Use the CLT to estimate the standard errorFor each of the following, find SE( p).

a) Samples of size n = 100 from a population with p = 0.5

b) Samples of size n = 400 from a population with p = 0.5

Class Example 6.1.5 Describe the sampling distributionFor each of the following questions, identify if you can use the CLT. If so, fully describe the distribution. Ifnot, identify the smallest sample size you need in order to use the CLT.

a) Samples of size n = 10 from a population with p = 0.4.

p ∼ N( , ) or Smallest n:

b) Samples of size n = 100 from a population with p = 0.6.

p ∼ N( , ) or Smallest n:

c) Samples of size n = 40 from a population with p = 0.9.

p ∼ N( , ) or Smallest n:

stat 145 – spring 2020 6.1central limit theorem 71

Class Example 6.1.6 Left-handednessSuppose we assume that 10% of the UWL student population are left-handed. If we select a random sam-ple of 300 UWL students and calculate the sample proportion (p) of these students who are left-handed,

1. What can you say about the distribution of p? Explain why?

2. What is the probability that at least 36 out of the 300 are left-handed?

3. What is the probability that at least 45 out of the 300 are left-handed?

Suggested Exercises (6.1D & 6.2D): 6.3, 6.5, 6.7, 6.9, 6.63, 6.65, 6.75

STAT 145 - Elementary Statistics Exam 2 Review

• Chapter 4: Discrete Random Variables and Probability Distributions

1. Discrete Random Variable: Let X be a discrete random variable with probability distribution givenbelow.

Values of X x1 x2 x3 · · · xkProbability p1 p2 p3 · · · pk

where,

a. Every probability pi is a number between 0 and 1.

b. Total probability: p1 + p2 + · · ·+ pk = 1.

c. Cumulative Distribution: F (x) = P (X ≤ x).

d. Mean (or expected value) of X: µ = E(X) = x1p1 + x2p2 + · · ·+ xkpk =k∑

i=1

xipi

e. Variance of X: σ2 = V ar(X) = (x1 − µ)2p1 + · · ·+ (xk − µ)2pk =k∑

i=1

(xi − µ)2pi

f. Standard Deviation of X: σ =√V ar(X)

g. Rules for Means: (i) E(a+ b ∗X) = a+ b ∗ E(X) and (ii) E(X ± Y ) = E(X)± E(Y ).

h. Rules for Variance: V ar(a+ b ∗X) = b2 ∗ V ar(X) ⇒ SD(a+ b ∗X) = b ∗ SD(X).

2. Binomial Distribution: Suppose X ∼ Bin(n, p), then

P (X = x) =

(n

x

)px(1− p)n−x, for x = 0, 1, . . . , n

a. Mean: µ = np

b. Variance: σ2 = np(1− p)c. Special Case: When n = 1, X ∼ Ber(p) [Bernoulli Distribution ]

• Chapter 5: Continuous Random Variables and Density Functions

1. Properties: Let X be a continuous random variable.

a. P (X = a) is virtually 0.

b. P (a ≤ X ≤ b) is the area under the density curve between a and b.

c. The total area under a density curve is 1.

2. Uniform Distribution . Let X ∼ Unif[c, d]. Then, f(x) = 1d−c , when x is in [c, d].

a. Mean: µ =c+ d

2.

b. Variance: σ2 =(d− c)2

12⇒ Standard Deviation: σ =

d− c√12

.

3. Normal Distribution . Let X ∼ N(µ, σ). The mean is µ and the standard deviation is σ.

a. Standard Normal: Z = X−µσ ∼ N(µ = 0, σ = 1).

b. P (a < X < b) = P (a−µσ < X−µσ < b−µ

σ ) = P (za < Z < zb) = Φ(zb)− Φ(za).

4. If X ∼ Bin(n, p) with np ≥ 10 and n(1− p) ≥ 10, then X ≈ N(µ = np, σ =√np(1− p)).

[Apply Continuity Correction:] ⇒ P (XBinomial ≤ a) ≈ P (X∗Normal ≤ a+ 0.5).

• Chapter 6: Sampling Distributions

1. If E(X) = µ and SD(X) = σ, then E(X) = µ and SD(X) =σ√n

. Also, E(p) = p and SD(p) =√

p(1−p)n .

2. If X is normal, then X is also normal.

3. Central Limit Theorem for x: When the sample size (n) is large (rule of thumb: n ≥ 30), the samplingdistribution of the sample mean X is approximately normal. That is, X ≈ N(µX = µ, σX = σ√

n)

4. Central Limit Theorem for p: When the sample size (n) is large (rule of thumb: np ≥ 10 andn(1 − p) ≥ 10), the sampling distribution of the sample proportion p is approximately normal. That is,p ≈ N(µp = p, σp =

√p(1− p)/n)

stat 145 – spring 2020 6.2confidence intervals 73

6.2Confidence Intervals

Key Concepts

• Construct confidence intervals for population means and proportions• Provide appropriate interpretation of confidence intervals

Confidence interval for a single population mean, µ (σ is known)

For quantitative data, the goal is often to learn about a populationaverage from a sample average.

Review:

1. If X ∼ N(µ, σ), then X ∼ N(µ,σ√n) ⇒ Z =

X− µ

σ/√

n∼ N(0, 1)

2. If n ≥ 30, then X ≈ N(µ,σ√n) ⇒ Z =

X− µ

σ/√

n≈ N(0, 1)

The (1− α)100% confidence interval for µ is[

X− z α2

σ√n

, X + z α2

σ√n

].

1. The 90% C.I. for µ is[

X− 1.645σ√n

, X + 1.645σ√n

].

2. The 95% C.I. for µ is[

X− 1.96σ√n

, X + 1.96σ√n

].

3. The 99% C.I. for µ is[

X− 2.576σ√n

, X + 2.576σ√n

].

Notation. The value zα is defined as the value of the standard normalrandom variable Z such that the area α will lie to its right. In otherwords, P(Z > zα) = α.

stat 145 – spring 2020 6.2confidence intervals 74

Class Example 6.2.1 Constructing Confidence Intervals for µ

1. A random sample of 90 observations were obtained from a population with a known standard deviationof σ = 2.7. The sample produced an average of x = 25.9.

(a) Find a 95% confidence interval for µ. What is the margin of error?

(b) Find a 90% confidence interval for µ. What is the margin of error?

(c) Find a 99% confidence interval for µ. What is the margin of error?

2. A random sample of 100 observations from a normal population with σ = 6.4 yielded a sample mean of83.2.

(a) Find a 95% confidence interval for µ.

(b) What does it mean when you say that the confidence level is 95%?

(c) Find a 99% confidence interval for µ.

stat 145 – spring 2020 6.2confidence intervals 75

(d) What happens to the width of a confidence interval as the value of the confidence level is increasedwhile the sample size is held fixed?

(e) Would your confidence intervals of parts (i) and (iii) be valid if the distribution of the original popu-lation was not normal? Explain.

3. A random sample of n measurements were taken from a population with σ = 3.3. The sample producedan average of 33.9.

(a) Find a 95% confidence interval for µ if n = 100.

(b) Find a 95% confidence interval for µ if n = 400.

(c) What is the effect on the width of a confidence interval of quadrupling the sample size while hold-ing the confidence coefficient fixed?

(d) How large a sample to do need so that the margin of error is at most 0.25?

stat 145 – spring 2020 6.2confidence intervals 76

Confidence interval for a single population mean, µ (σ is unknown)

• If the sample size n ≥ 30, treat s as if it is σ, then use the previous method. This is due to the fact thatthe sample size is large (n ≥ 30) and hence, the value of s is very close to σ.

• If the sample size n < 30, use the statistic T =X− µ

s/√

n. T follows the student t-distribution with n − 1

degrees of freedom. The resulting (1− α)100% confidence interval for µ is given by[

X− (t α2)

s√n

, X + (t α2)

s√n

]

where, M = (t α2)

s√n

, is the margin of error.

Class Example 6.2.2 Describe the sampling distributionFor each of the following questions, tell whether or not a t-distribution would be appropriate. If so, iden-tify the number of degrees of freedom that you would use for the t-distribution.

a) Samples of size n = 10, from a population that is approximately normal.

b) Samples of size n = 15, from a population that is heavily skewed to the right.

c) Samples of size n = 50, from a population that is heavily skewed to the left.

Class Example 6.2.3 Commercial SoapA quality control employee random selects 10 commercial soap containers from the production line to ver-ify that the machine is working proporly. The machine is supposed to put 10 liters of soap in this particularcontainer size. There resulting data are 10.2, 9.7, 10.1, 10.3, 10.1, 9.8, 9.9, 10.4, 10.3, and 9.8 liters. Assumethat these values come from a normal population.

1. Construct and interpret a 95% confidence interval for the mean soap content of all such containers.Interpret your answer.

2. Construct and interpret a 99% confidence interval for the mean soap content of all such containers.Interpret your answer.

stat 145 – spring 2020 6.2confidence intervals 77

Class Example 6.2.4 Triathlon Heart RatesThe article “Cardiovascular and Thermal Response of Triathlon Performance" (Medicine and Science in Sportsand Exercise, 1988, 385–389) reports on a research study involving nine male triathletes. Maximum heartrate (beats/min) was recorded during performance of each of the three events. For swimming, the samplemean and standard deviation were 188.0 and 7.2, respectively.

a) What is the variable in this study? Is it categorical or quantitative?

b) Assuming that the distribution of maximum heart-rates is (approximately) normal, construct and inter-pret a 99% confidence interval for the mean heart rate of triathletes when swimming.

c) If we had calculated a 90% confidence interval instead of a 99% confidence interval, would it have beenlarger or smaller than the 99% confidence interval? Explain.

Class Example 6.2.5 Walking CadenceA study of the ability of individuals to walk in a straight line (“Can We Really Walk Straight?" AmericanJournal of Physical Anthropology, 1992, 19–27) reported data on cadence (strides per second) for a sampleof n = 20 randomly selected healthy men. The sample mean and standard deviation for these data were0.9255 and 0.0809, respectively.

a) What is the variable in this study? Is it categorical or quantitative?

b) Assuming that the cadence distribution is (approximately) normal, construct and interpret a 95% confi-dence interval estimate for the mean strides per second?

c) Is it plausible to suggest that men take an average of 1 stride per second? Explain.

stat 145 – spring 2020 6.2confidence intervals 78

Confidence interval for a single population proportion, p (when n is large)

1. The (1− α)100% confidence interval for p is

[p− (z α

2)

√p(1− p)

n, p + (z α

2)

√p(1− p)

n

].

2. The Margin of Error, M = (z α2)

√p(1− p)

n⇒ n =

z2α/2 p(1− p)

M2 ≤z2

α/2(0.25)

M2 .

Class Example 6.2.6 FTC Price CheckIn the Federal Trade Commission (FTC) Price Check study of electronic checkout scanners, the FTC in-spected 1,669 scanners at retail stores and supermarkets by scanning a sample of items at each store anddetermining if the scanned price was accurate. The FTC gives a store a passing grade if 98% or more of theitems are priced accurately. Of the 1,669 stores in the study, 1,185 passed inspection.

1. Find a 90% confidence interval for the true proportion of retail stores and supermarkets with electronicscanners that pass the FTC price-check test. Interpret your result.

2. Two years prior to the study, the FTC found that 45% of the stores passed inspection. Use the intervalyou obtained in part (a) to determine whether the proportion of stores that now pass inspection exceeds45%.

3. Determine the sample size needed to have a margin of error of at most 0.01.

stat 145 – spring 2020 6.2confidence intervals 79

Class Example 6.2.7 Quebec SovereigntyQuebec is a large province in eastern Canada, and is the only Canadian province with a predominantlyFrench-speaking population. Historically there has been debate over whether Quebec should secede fromCanada and establish itself as an independent, sovereign nation. In a survey of 800 Quebec residents, 28%thought that Quebec should separate from Canada. In the same survey, 82% agreed that Quebec society isdistinct from the rest of Canada.

a) Construct and interpret a 95% confidence interval for the true proportion of Quebecers who would likeQuebec to separate from Canada.

b) Construct and interpret a 99% confidence interval for the true proportion of Quebecers who think Que-bec society is distinct from the rest of Canada.

c) How large a sample do you need if you want the margin of error of the C.I. from part (a) to be at most0.02?

d) How large a sample do you need if you want the margin of error of the C.I. from part (b) to be at most0.02?

Suggested Exercises (6.1 & 6.2): 6.19, 6.21, 6.23, 6.25, 6.83, 6.85, 6.91, 6.95, 6.105

stat 145 – spring 2020 6.2hypothesis testing 80

6.2Hypothesis Testing

Key Concepts

• Test hypothesis concerning population means and proportions• Provide appropriate conclusions based on the result of the hypothesis tests• Learn how to interpret p-values

Types of Hypothesis

• Null Hypothesis: The null hypothesis, denoted by H0, represents the hypothesis that will be acceptedunless the data provide convincing evidence that it is false. This usually represents the “status quo" orsome claim about the population parameter that the researcher wants to test.

• Alternative Hypothesis: The alternative hypothesis, denoted by Ha or H1, represents the hypothesis thatwill be accepted only if the data provide convincing evidence of its truth. This usually represents thevalues of a population parameter for which the researcher wants to gather evidence to support.

Steps to do Hypothesis Testing:

1. Formulate the Null hypothesis (H0) and Alternative hypothesis (Ha).

2. Specify the level of significance (Commonly used: α = 0.05 or 0.01).

3. Determine the appropriate test statistic to use. State the required assumptions.

4. Define your rejection rule. (Or use, reject H0 if p-value < α).

5. Compute the observed value of the test statistic (or compute the p-value).

6. Write your conclusion.

Hypothesis test for a single mean (when σ is known)

• H0 : µ = µ0 vs. H1 : µ > µ0 (One-sided alternative)

• H0 : µ = µ0 vs. H1 : µ < µ0 (One-sided alternative)

• H0 : µ = µ0 vs. H1 : µ 6= µ0 (Two-sided alternative)

When the population SD (σ) is known and the sample size n is large (≥ 30) or the data come from a nor-mal population, we can use the Z−statisitc:

Z =X− µ0

σ/√

n∼ N(0, 1)

stat 145 – spring 2020 6.2hypothesis testing 81

Class Example 6.2.1 SAT Math ScoresETS, the company that administers the SAT exam, reports that the mean SAT mathematics score is 519. Butsome people think that this score overestimates the ability of typical high school seniors because only thosewho plan to attend college take the SAT. To check if this is true, a test was given to a SRS of 500 seniorsfrom California. These students had an average score of x = 504. Is this enough evidence to say that themean for all California seniors is lower than 519? Use a level of significance equal to α = 0.05. (Assumethat σ = 100).

Class Example 6.2.2 Hilltop CoffeeThe Federal Trade Commission (FTC) periodically conducts statistical studies designed to test the claimsthat manufacturers make about their products. For example, the label on a large can of Hilltop Coffeestates that the can contains 3 pounds of coffee. To protect the consumers, FTC wants to make sure thatthe population mean amount of coffee in each can is at least 3 pounds. If a sample of 36 Hilltop coffeecans provides a sample mean of x = 2.92 pounds and σ is known to be 0.18, is there enough evidence toconclude that the population mean is statistically lower than 3 pounds per can? Use a level of significanceequal to α = 0.05.

stat 145 – spring 2020 6.2hypothesis testing 82

Class Example 6.2.3 Rental RatesReis, Inc., a New York real state research firm, tracks the cost of apartment rentals in the United States. Inmid-2002, the nationwide mean apartment rental rate was $895 per month (The Wall Street Journal, July 8,2002). Assume that, based on the historical quarterly surveys, a population standard deviation σ = $225is reasonable. In a current study of apartment rental, a sample of 180 apartments nationwide provided asample mean of $915 per month. Do the sample data enable Reis to conclude that the population meanapartment rental rate now exceeds the level reported in 2002? α = 0.01.

Class Example 6.2.4 Blood Pressure of Male ExecutivesDo middle-aged male executives have different average blood pressure than the general population? Thenational Center for Health Statistics reports that the mean systolic blood pressure for males 35 to 44 yearsof age is 128 and the standard deviation in this population is 15. The medical director of a company looksat the medical records of 72 company executives in this age group and finds that the mean systolic bloodpressure in this sample is x = 126.07. Is this enough evidence that executive blood pressures differ fromthe national average? Use α = 0.05.

stat 145 – spring 2020 6.2hypothesis testing 83

Class Example 6.2.5 Florida’s Annual WageThe Florida Department of Labor and Employment Security reported the state mean annual wage was$26,133 (The Naples Daily News, Feb. 13, 1999). A hypothesis test of wages by county can be conductedto see whether the mean annual wage for a particular county differs from the state mean. A sample of550 individuals from Collier County showed a sample mean annual wage of $25,457. Assuming that σ =

$7600, is there enough evidence to conclude that mean annual wage of people from this county is differentthan the state mean? Use α = 0.05.

Class Example 6.2.6 Home PricesThe national mean sales price for new one-family homes is $181,900 (The New York Times Almanac 2000).A sample of 40 one-family home sales in the south showed a sample mean of $166,400. If σ = $33, 500, isthere enough evidence to say that the population mean sales price for new one-family homes in the southis less than the national mean? Use α = 0.01.

stat 145 – spring 2020 6.2hypothesis testing 84

Class Example 6.2.7 Late FilersIndividuals filing federal income tax returns prior to March 31 received an average refund of $1056. Con-sider the population of last minute filers who mail their tax return during the last five days of the incometax period (typically April 10 to April 15).

1. A researcher suggests that a reason individuals wait until the last five days is that on average theseindividuals receive lower refunds than do early filers. Formulate appropriate hypotheses such that therejection of H0 will support the researcher’s contention. Clearly define the parameter you used.

2. For a sample of 400 individuals who filed a tax return between April 10 to April 15, the sample meanrefund was $910. Based on prior experience a population standard deviation of σ = $1600 may beassumed. Calculate the value of the appropriate test statistic.

3. At α = 0.05, what is your conclusion?

Observed Significance or P-value

The observed significance level, or p-value, for a specific statistical test is the probability (assuming thatH0 is true) of observing a value of the test statistic that is at least as contradictory to the null hypothesis,and supportive of the alternative hypothesis, as the actual one computed from the sample data.

stat 145 – spring 2020 6.2hypothesis testing 85

Class Example 6.2.8 Using the P-value method

1. Redo the Late Filers example using the p-value method.

2. Redo the Hilltop Coffee example using the p-value method.

3. Redo the Rental Rates example using the p-value method.

4. Redo the Blood Pressure of Male Executives example using the p-value method.

4/1/16

1

Type I and Type II Errors

H0 is true H0 is false (H1 is true)

TRUTH

Type I error

Correct Decision (Usually this result leads to no conclusion.)

Correct Decision (Usually what researchers are hoping to get.) Pr(I error)=α

Type II error

Pr(II error)=β

: Drug is not effecIve : Drug is effecIve

(Conclude Drug is effecIve)

DECISION

Do not reject H0

Reject H0

Test H0: Drug is not effecIve vs H1: Drug is effecIve.

The Power of the test is the probability of rejecIng the null when it is false. It is the probability of saying the drug is effecIve when it is really effecIve. Power=1-­‐β.

(Consumer’s Risk)

(Producer’s Risk)

(Power=1-­‐β)

1

Rela1onships Between α, β, power, and n •  H0: μ=100 vs H1: μ > 100 •  Use α=0.05.

α=P(Type I error) =P(reject Ho when H0 is true)

β=P(Type II error) =P(not rejecIng H0 when H1 is true)

•  Note: As α decreases, β increases. (Keeping everything else the same.)

•  Q: Is there a way to lower α and β at the same Ime? •  Increase Δ=(alternaIve mean)-­‐(null mean). •  Lower populaIon standard deviaIon, σ. •  Increase the sample size, n.

α=0.05

Rejection Region

H0: μ=100 H1: μ>100 β

Δ=10 2

stat 145 – spring 2020 6.2hypothesis testing 87

Hypothesis test for a single mean (when σ is unknown)

When the population SD (σ) is unknown, assuming the data come from a normal population, we can use

the T−statisitc: T =X− µ0

s/√

n. This statistic follows the t-distribution with n− 1 degrees of freedom. [Note:

If the data are not normal, you may still use this statistic as long as the sample size is large (n ≥ 30).]

Class Example 6.2.9 How much is left!?Have you ever been frustrated because you could not get a container of some sort to release the last bitof its contents? The article “Shake, Rattle, and Squeeze: How Much is Left in That Container?" (ConsumerReports, May 2009: 8) reported on an investigation of this issue for various consumer products. In a ran-dom sample of five 6.0 ounce tubes of toothpaste from a particular brand and squeeze them until no moretoothpaste will come out. Then each tube is cut open and the amount remaining is weighed. For this sam-ple, the mean and standard deviation of the amount of toothpaste remaining (in ounces) was 0.502 and0.102, respectively. Suppose the toothpaste manufacturer claims that it’s packaging allows at least 90% ofits contents to be released. Conduct a hypothesis test (using α = 0.05) to test the manufacturer’s claim. Youmay assume that the remaining amounts of toothpaste are approximately normally distributed.

Class Example 6.2.10 Daily zinc intakeThe recommended daily dietary allowance for zinc among males older than age 50 years is 15 mg/day.The article “Nutrient Intakes and Dietary Patterns of Older Americans: A National Study" (Journal ofGerontology, 1992, M145–150) reports the following summary data on intake for a sample of males age65–74 years: n = 115, x = 11.3, s = 6.43. Conduct a hypothesis test (using α = 0.05) to test whether or notaverage daily zinc intake in the population of all males ages 65–74 falls below the recommended allowance.

a) Define the relevant parameter(s) and state the null and alternative hypotheses. Be sure to check anyrelevant conditions.

b) What is the value of the test statistic?

stat 145 – spring 2020 6.2hypothesis testing 88

c) Define your rejection rule.

d) State your decision and interpret your findings in the context of the study.

Class Example 6.2.11 Wildlife: CoyotesA random sample of 46 adult coyotes in a region of northern Minnesota showed the average age to bex = 2.05 years with sample standard deviation s = 0.82 years (based on information from the book Coyotes:Biology, Behavior, and Management by M. Bekoff, Academic Press). However, it is thought that the overallpopulation mean age of coyotes is µ = 1.75. Conduct a hypothesis test (using α = 0.01) to test whether coy-otes in this region of northern Minnesota tend to have longer average lifespans than the overall population.

a) Define the relevant parameter(s) and state the null and alternative hypotheses. Be sure to check anyrelevant conditions.

b) What is the value of the test statistic?

c) Find the p-value and give a sketch to illustrate your p-value.

d) State your decision and interpret your findings in the context of the study.

Class Example 6.2.12 Ski Patrol: AvalanchesSnow avalanches can be a real problem for travelers in the western United States and Canada. A verycommon type of avalanche is called the slab avalanche. These have been studied extensively by DavidMcClung, a professor of civil engineering at the University of British Columbia. Slab avalanches stud-ied in Canada had an average thickness of 67 (in cm) (Avalanche Handbook, by David McClung and P.Schaerer.) The ski patrol at Vail, Colorado, is studying slab avalanches in their region. A random sample ofavalanches in spring gave the following thicknesses (in cm).

59 51 76 38 65 54 49 62 68 55 64 67 63 74 65 79

Assuming that slab thickness has an approximately normal distribution, is there evidence that the slabthickness in the Vail region differs from that in Canada? You may either us a 95% confidence interval or ahypothesis test (use α = 0.05) to support your conclusion.

stat 145 – spring 2020 6.2hypothesis testing 89

Assessing model conditions The t-test is robust to lack of normality,but we still need to see if normality is areasonable assumption.It is important to investigate whether normality is reasonable before

performing a statistical test. The t-test is robust to lack of normality,so when we check this condition we are looking for clear evidencethat the distribution is non-normal. If normality is reasonable, we canproceed with a t-test. Create a histogram/dot plot or a QQ

plot to assess the normality conditionfor a t-test.There are two primary ways that we can check for normality: his-

tograms/dot plots or quantile-quantile plots. For histograms/dotplots, simply create a histogram/dot plot of the sample data anddetermine whether normality is reasonable (if the sample data is ap-proximately normal, then normality is reasonable). Quantile-quantileplots, or QQ plots, are commonly seen when using statistical soft-ware (such as SPSS). They are created by first ordering the sampledata from smallest to largest then comparing these ordered sampledata to percentiles of the normal distribution. If the resulting graphfollows a straight line (that goes through the origin), we can say thatthe normality assumption is reasonable. Figure 6.2.1 provides someexamples of QQ plots and their corresponding histograms.

-3 -2 -1 0 1 2 3

02

46

810

Skewed-Left Samples

Theoretical Quantiles

Sam

ple

Qua

ntile

s

-3 -2 -1 0 1 2 3

510

1520

Normal Samples

Theoretical Quantiles

Sam

ple

Qua

ntile

s

-3 -2 -1 0 1 2 3

510

1520

2530

Right-Skewed Samples

Theoretical Quantiles

Sam

ple

Qua

ntile

s

Skewed-Left Samples

Sample Data

Frequency

0 2 4 6 8 10 12

0100

200

300

400

Normal Samples

Sample Data

Frequency

0 5 10 15 20

050

100

150

200

250

Right-Skewed Samples

Sample Data

Frequency

0 5 10 15 20 25 30 35

0100

200

300

Figure 6.2.1: QQ plots and correspond-ing histograms

Suggested Exercises (6.2): 6.75, 6.77, 6.79, 6.91, 6.93, 6.95, 6.121, 6.125

STAT 145 - Elementary Statistics Summary

1. One population (µ)

a. If σ is known or n ≥ 30, Z =X − µσ/√n

follows the N(0, 1).

i. The (1− α)100% confidence interval for µ is [X − Zα2

σ√n, X + Zα

2

σ√n

].

ii. To test H0 : µ = µ0 vs. H1 : µ > µ0, reject the null if Zobs =Xobs − µσ/√n

> Zα, or if the

p−value= P (Z ≥ Zobs) is < α.

iii. To test H0 : µ = µ0 vs. H1 : µ < µ0, reject the null if Zobs < −Zα, or if thep−value= P (Z ≤ Zobs) is < α.

iv. To test H0 : µ = µ0 vs. H1 : µ 6= µ0, reject the null if |Zobs| > Zα2, or if the

p−value= 2 ∗ P (Z ≥ |Zobs|) is < α.

b. If σ is unknown and theX ′is come from a normal population, t =X − µs/√n

follows the t−distribution

with (n− 1) degrees of freedom.

i. The (1− α)100% confidence interval for µ is [X − tα2

s√n, X + tα

2

s√n

].

ii. To test H0 : µ = µ0 vs. H1 : µ > µ0, reject the null if tobs =Xobs − µs/√n

> tα.

iii. To test H0 : µ = µ0 vs. H1 : µ < µ0, reject the null if tobs < −tα.

iv. To test H0 : µ = µ0 vs. H1 : µ 6= µ0, reject the null if |tobs| > tα2.

2. One population (p)

a. If n is large (np ≥ 10 and n(1− p) ≥ 10), Z =p− p√p(1−p)n

≈ N(0, 1).

i. The (1− α)100% confidence interval for p is [p− Zα2

√p(1−p)n , p+ Zα

2

√p(1−p)n ].

ii. To test H0 : p = p0 vs. H1 : p > p0, reject the null if Zobs =p− p0√p0(1−p0)

n

> Zα.

iii. To test H0 : p = p0 vs. H1 : p < p0, reject the null if Zobs < −Zα.

iv. To test H0 : p = p0 vs. H1 : p 6= p0, reject the null if |Zobs| > Zα2.

3. One population (σ2): When the X ′is come from a normal population,(n− 1)S2

σ2follows the χ2

distribution with n− 1 degrees of freedom.

a. To test H0 : σ2 = σ20 vs. H1 : σ2 > σ20, reject the null if X2obs =

(n− 1)S2obs

σ20> χ2

α.

b. To test H0 : σ2 = σ20 vs. H1 : σ2 < σ20, reject the null if X2obs =

(n− 1)S2obs

σ20< χ2

1−α.

c. To test H0 : σ2 = σ20 vs. H1 : σ2 6= σ20, reject the null if X2obs > χ2

α2

or if X2obs < χ2

1−α2.

4. Two populations (µ1, µ2)

a. If σ1 and σ2 are known (or n1 and n2 ≥ 30), Z =(X1 − X2)− (µ1 − µ2)√

σ21n1

+σ22n2

follows the N(0, 1).

i. The (1− α)100% confidence interval for µ1 − µ2 is (X1 − X2)± Zα2

√σ21n1

+σ22n2

.

ii. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 > d0, reject the null if Zobs > Zα.

iii. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 < d0, reject the null if Zobs < −Zα.

iv. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 6= d0, reject the null if |Zobs| > Zα2.

b. If σ1 and σ2 are unknown, t =(X1 − X2)− (µ1 − µ2)√

s21n1

+s22n2

follows approximately t−distribution

with k degrees of freedom, where k is approximated by k ≈

(s21n1

+s22n2

)2

1n1−1

(s21n1

)2+ 1

n2−1

(s22n2

)2

i. The (1− α)100% confidence interval for µ1 − µ2 is (X1 − X2)± tα2

√s21n1

+s22n2

.

ii. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 > d0, reject the null if tobs > tα.

iii. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 < d0, reject the null if tobs < −tα.

iv. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 6= d0, reject the null if |tobs| > tα2.

c. If σ1 and σ2 are unknown but can be assumed to be equal, t =(X1 − X2)− (µ1 − µ2)√

s2pn1

+s2pn2

follows t−distribution with (n1+n2−2) degrees of freedom, where s2p =(n1 − 1)s21 + (n2 − 1)s22

n1 + n2 − 2.

i. The (1− α)100% confidence interval for µ1 − µ2 is (X1 − X2)± tα2

√s2pn1

+s2pn2

.

ii. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 > d0, reject the null if tobs > tα.

iii. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 < d0, reject the null if tobs < −tα.

iv. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 6= d0, reject the null if |tobs| > tα2.

d. For paired observations (the two samples are NOT independent), work with di = xi − yi.

i. To test H0 : µD = d0 vs. H1 : µD > d0, reject the null if tobs =d− d0SD/√n> tα,(n−1).

ii. To test H0 : µD = d0 vs. H1 : µD < d0, reject the null if tobs < −tα,(n−1).iii. To test H0 : µD = d0 vs. H1 : µD 6= d0, reject the null if |tobs| > tα

2,(n−1).

5. Two populations (p1, p2): If n1 and n2 are large (nipi ≥ 10 and ni(1− pi) ≥ 10),

Z =p1 − p2 − (p1 − p2)√p1(1−p1)

n1+ p2(1−p2)

n2

≈ N(0, 1).

a. The (1− α)100% confidence interval for p1 − p2 is

[(p1 − p2)± Zα

2

√p1(1−p1)

n1+ p2(1−p2)

n2

].

b. To test H0 : p1 − p2 = 0 vs. H1 : p1 − p2 > 0, reject the null if Zobs =(p1 − p2)− 0√p(1−p)n1

+ p(1−p)n2

> Zα,

where, p =Y1 + Y2n1 + n2

, the pooled sample proportion.

c. To test H0 : p1 − p2 = 0 vs. H1 : p1 − p2 < 0, reject the null if Zobs < −Zα.

d. To test H0 : p1 − p2 = 0 vs. H1 : p1 − p2 6= 0, reject the null if |Zobs| > Zα2.

stat 145 – spring 2020 6.3inferences based on two samples 92

6.3Inferences Based on Two Samples

Class Example 6.3.1 Dust ExposureExposure to dust at work can lead to lung disease later in life. One study measured the workplace expo-sure of tunnel construction workers. Part of the study compared 115 drill and blast workers with 220 out-door concrete workers. Total dust exposure was measured in milligram years per cubic meter (mg.y/m3).This part of the study aims to see if there is a difference in the dust exposure between these two groups ofworkers.

1. Formulate the appropriate null and alternative hypotheses.

2. Determine the appropriate test statistics to use and specify its distribution.

3. If the mean exposure for the drill and blast workers was 18.0 mg.y/m3 with a standard deviation of7.8 mg.y/m3 and for the outdoor concrete workers, the corresponding values were 6.5 mg.y/m3 and 3.4mg.y/m3, test the null hypothesis H0 : µ1 = µ2 versus the alternative hypothesis you specified in part (b)using α = 0.01

4. Construct a 99% confidence interval for µ1 − µ2.

stat 145 – spring 2020 6.3inferences based on two samples 93

Class Example 6.3.2 Calcium SupplementDoes increasing the amount of calcium in our diet reduce blood pressure? A randomized comparativeexperiment gave one group of 10 men a calcium supplement for 12 weeks. The control group of 11 menreceived a placebo that appeared identical to the calcium supplement. The experiment was double-blind.The table below gives the decrease in the blood pressure for each subject.

Calcium 7 -4 18 17 -3 -5 1 10 11 -2Placebo -1 12 -1 -3 3 -5 5 2 -11 -1 -3

1. Determine the appropriate test statistics to use and specify its distribution.

2. Construct and interpret the 95% confidence interval for the true difference between the mean reductionin BP level for the Calcium group and that of the Placebo group (µ1 − µ2).

3. Formulate the appropriate null and alternative hypotheses.

4. Conduct a complete test of significance using α = 0.05.

stat 145 – spring 2020 6.3inferences based on two samples 94

Class Example 6.3.3 Calcium Supplement revisited

In the previous problem, suppose we can assume that σ1 = σ2.

1. Determine the appropriate test statistics to use and specify its distribution.

2. Construct and interpret the 95% confidence interval for the true difference between the mean reductionin BP level for the Calcium group and that of the Placebo group (µ1 − µ2).

3. Formulate the appropriate null and alternative hypotheses.

4. Conduct a complete test of significance using α = 0.05.

stat 145 – spring 2020 6.3inferences based on two samples 95

Class Example 6.3.4 Industrial Safety ProgramTo determine the effectiveness of an industrial safety program, the following data was collected (over aperiod of one year) on the average weekly loss of worker-hours due to accidents in 12 plants “before andafter" the program was put into operations.

Plants 1 2 3 4 5 6 7 8 9 10 11 12

Before 37 45 12 72 54 34 26 13 39 125 79 26

After 28 46 18 59 43 29 24 15 35 120 75 24

1. Explain why the standard two-sample independent t-test is not appropriate for this study. How can weuse this data?

2. Formulate the most appropriate null and alternative hypotheses to test whether the safety program iseffective.

3. Specify the appropriate test statistic for this analysis. What is its distribution?

4. Using a level of significance of α = 0.05, define your rejection rule.

5. Do the data provide sufficient evidence to say that the safety program is effective? Provide all necessaryresults to support your answer.

stat 145 – spring 2020 6.3inferences based on two samples 96

Class Example 6.3.5 Flu MedicineIn a winter of an epidemic flu, babies were surveyed by a well-known pharmaceutical company to deter-mine if the company’s new medicine was effective after two days. Among 120 babies who had the flu andwere given the medicine, 29 were cured within two days. Among 280 babies who had the flu but were notgiven the medicine, 56 were cured within two days.

1. Formulate the most appropriate null and alternative hypotheses. Define clearly the parameters you usein your hypotheses.

2. Using a level of significance of α = 0.05, test the company’s claim of the effectiveness of the medicine.Write a practical conclusion.

3. Compute the p-value of this sample.

4. Construct and interpret a 99% confidence interval for (p1 − p2).

stat 145 – spring 2020 6.3inferences based on two samples 97

Class Example 6.3.6 Mobile Connections to LibrariesIn a random sample of 2,252 Americans age 16 and older, 11% of the 1,059 men and 16% of the 1,193

women said they have accessed library services via a mobile device.

a) What must be assumed in order to construct a confidence interval for the difference in proportions?

b) Find and interpret a 95% confidence interval for the difference in proportion accessing libraries viamobile devices, between men and women.

c) Does your interval in (b) suggest that there is a difference in the proportions of men and women access-ing libraries via mobile devices? Which population has a higher proportion?

stat 145 – spring 2020 6.3inferences based on two samples 98

Class Example 6.3.7 Tagging PenguinsA study was conducted to see if tagging penguins with metal tags harms them. In the study, 100 penguinswere randomly assigned to receive a metal tag or (as a control group) an electronic tag. One of the vari-ables studied is survival rate ten years after the penguins were tagged. The scientists observed that 20% ofthe 50 metal tagged penquins survived while 36% of the 50 electronically tagged penguins survived.

a) Are the conditions met for using the normal distribution? Verify your answer.

b) Define the two population proportions p1 and p2.

c) Test at α = 0.05 to see if the survival rate is lower for all metal tagged penguins than for all electroni-cally tagged penguins. Do metal tags appear to reduce survival rate in penguins?

Class Example 6.3.8 Highball vs tumblerTwo common types of glassware at a bar are “highballs” (tall and thin) and “tumblers”(short and wide).Researchers randomly assigned participants either a “highball” glass or a “tumbler,” each of which held355 ml (BMJ, 2005). Participants were asked to pour a shot (1.5 oz = 44.3 ml) into their glass. The summarystatistics are given in Table 6.3.1.

n x s

Highball 99 42.2 ml 16.2 mlTumbler 99 60.9 ml 17.9 ml

Table 6.3.1: Summary statistics foramount poured

We want to know about the difference in the average amount of liquid poured into the two types of glasses.

a) What are the variables of interest in this study? Are they categorical or quantitative? Which is the ex-

stat 145 – spring 2020 6.3inferences based on two samples 99

planatory variable and which is the response?

b) What is the parameter of interest?

c) Find and interpret a 95% confidence interval estimate for the difference in the average amount pouredin the two different types of glasses. Use highball for group 1 and tumbler for group 2.

d) If you were the owner of a local bar, from a profit perspective, do you think there is any reason to pre-fer the highball to the tumbler glass?

Class Example 6.3.9 Swimming heats at the OlympicsThe data in Table 6.3.2 are finishing times that randomly selected from the preliminary heats for the 400 mwomen’s run in the 2004 Olympics in Athens for preliminary heats 2 and 5.

Heat 2 51.02 51.50 52.10 56.01Heat 5 51.20 52.85 52.87 54.58

Table 6.3.2: Randomly selected finishingtimes for 400 m women’s run

We want to know about the difference in the average finishing times for the two preliminary heats.

a) What are the variables of interest in this study? Are they categorical or quantitative? Which is the ex-planatory variable and which is the response?

b) What is the parameter of interest?

c) Find and interpret a 95% confidence interval estimate for the difference in the average time for the 400

m run between the two heats. You may assume that the finishing times for all participants in the heatsare approximately normally distributed.

d) Does your interval in c) suggest that there is a difference in the average finishing time between the

stat 145 – spring 2020 6.3inferences based on two samples 100

heats?

Class Example 6.3.10 Highball vs tumbler revisitedRecall the following summary statistics from the highball vs tumbler example.

n x s

Highball 99 42.2 ml 16.2 mlTumbler 99 60.9 ml 17.9 ml

Table 6.3.3: Summary statistics foramount poured

Conduct a hypothesis test to see if there is a difference between the average amounts poured in the twotypes of glasses (use α = 0.05).

a) Define the relevant parameter(s) and state the null and alternative hypotheses. Be sure to check anyrelevant conditions.

b) What is the test statistic.

c) Find the p-value and give a sketch to illustrate your p-value.

d) State your decision and interpret your findings in the context of the study.

e) Do the findings from your hypothesis test agree with your confidence interval?

stat 145 – spring 2020 6.3inferences based on two samples 101

Class Example 6.3.11 400 m times revisitedThe summary statistics from the 400 m run example are given in Table 6.3.4.

n x s

Heat 2 4 52.66 s 2.23 sHeat 5 4 52.88 s 1.38 s

Table 6.3.4: Summary statistics forfinishing times for 400 m women’s run

Conduct a hypothesis test to see if there is a difference between the average finishing times for the twoheats (use α = 0.05).

a) Define the relevant parameter(s) and state the null and alternative hypotheses. Be sure to check anyrelevant conditions.

b) What is the test statistic.

c) Find the p-value and give a sketch to illustrate your p-value.

d) State your decision and interpret your findings in the context of the study.

e) Do the findings from your hypothesis test agree with your confidence interval?

stat 145 – spring 2020 6.3inferences based on two samples 102

Class Example 6.3.12 Teaching methods and post-test scoresThe following SPSS output is from an analysis of data from an experimental study conducted by Baumannand Jones, as reported by Moore and McCabe (1993). Students were randomly assigned to one of twoexperimental groups: “Basal" represents the traditional method of teaching, and “DRTA" represents aninnovative teaching methods. The results are based on post-test scores for the two groups.

a) What are the variables recorded in this study? Are they categorical or quantitative? Which of the vari-ables is the independent variable? Dependent variable?

b) Conduct a hypothesis test to determine whether there is a difference post-test scores between the twomethods using the SPSS output above. Use α = 0.05.

c) Compare your results to the 95% confidence interval in the output. Do the test results agree with theinterpretation of the confidence interval?

stat 145 – spring 2020 6.3inferences based on two samples 103

Class Example 6.3.13 Insecticide effectivenessThe counts of insects in agricultural experiments were taken between two types of insecticides (Beall,Biometrika 1942). The following SPSS output represents a test to determine if the two insecticides differed ineffectiveness.

a) What are the variables recorded in this study? Are they categorical or quantitative? Which of the vari-ables is the independent variable? Dependent variable?

b) Conduct a hypothesis test to determine whether there is a difference in insecticide effectiveness be-tween the two insecticides using the SPSS output above. Use α = 0.05.

c) Compare your results to the 95% confidence interval in the output. Do the test results agree with theinterpretation of the confidence interval?

stat 145 – spring 2020 6.3inferences based on two samples 104

Class Example 6.3.14 CAOS ComparisonsThe CAOS (Comprehensive Assessment of Outcomes in Statistics) exam is an online multiple-choice teston concepts covered in a typical introductory statistics course. Students take one version before the start ofthe course and another version after the course ends. The data are summarized in the following QQ plotand SPSS output.

a) Using the output, record the 95% confidence interval for the average difference in test scores? Interpretthis interval.

b) Conduct a test to determine if the test scores change, on average, between the pre- and post-test. Useα = 0.05.

stat 145 – spring 2020 6.3inferences based on two samples 105

Class Example 6.3.15 Body image and weight preoccupationA study was conducted to determine how males and females report their weight and height. 82 males and99 females were asked their height and weight, then height and weight were measured for each partici-pant. (Davis, C. (1990). “Body image and weight preoccupation: A comparison between exercising andnon-exercising women." Appetite, 15, 13–21.)

The study reported that “women appear to accurately report their weight; we found no evidence of a dif-ference between weight and reported weight (xd = 1.62 lbs, sd = 10.14, t = 1.45, p-value: 0.1513).” Thestudy also reported that “men, on the other hand, appear to underestimate their weight (xd = −0.59 lbs,sd = 2.79, t = −2.13, p-value: 0.036).” Finally, the study went on to say that “there is also a significantdifference between men and women when measuring the differences in height and reported height. Menoverestimate their height (xd = 1.76 in, sd = 2.17, t = 7.41, p-value < 0.001) while women do not overesti-mate their height (xd = 1.28 in, sd = 11.04, t = 1.15, p-value: 0.2517).”

There are five statements in this study that indicate statistical findings. For each of the following, evaluatethe validity of the claim based on the statistical evidence, and correct the statement if necessary. Only twoof the conclusions are correct.

a) Women appear to accurately report their weight; we found no evidence of a difference between weightand reported weight.

b) Men, on the other hand, appear to underestimate their weight.

c) Men overestimate their height.

d) Women do not overestimate their height.

e) There is also a significant difference between men and women when measuring the differences inheight and reported height.

stat 145 – spring 2020 6.3inferences based on two samples 106

Class Example 6.3.16 Pulse rates in classDo you think your pulse rate is higher when you are taking a quiz than when you are sitting in a lecture?The data in Table 6.27 show pulse rates collected from 10 students in a class lecture and then from thesame students during a quiz. The data are summarized in the following output.

a) Record the 95% confidence interval for the average difference in pulse rates? Interpret this interval.

b) Conduct a test to determine if pulse rates are greater, on average, during a quiz than during a lecture.Use α = 0.05.

Suggested Exercises(6.3): 6.137, 6.145, 6.147, 6.153, 6.163, 6.173

(6.4): 6.193, 6.195, 6.199, 6.201, 6.203, 6.213, 6.219, 6.223

(6.5): 6.247, 6.249, 6.253, 6.255, 6.257

STAT 145 - Elementary Statistics Exam 3 Review

1. Decide which inferential method is the most appropriate for each of the following practical researchquestions. Write the letter of the most appropriate statistical procedure next to each experiment orstudy question. Each procedure may be used more than once or not at all.

A) One-sample t−test for a mean. F) Two-sample z−test for proportions.B) One-sample z−test for a proportion. G) C.I. for the difference of proportions.C) One-sample χ2−test for a variance. H) C.I. for a mean.D) Two-sample independent t−test for means. I) C.I. for difference of means using independent samples.E) Paired differences t−test. J) C.I. for the mean of paired differences.

1. On average, how much do lawyers earn annually?

2. Is there statistical evidence that lawyers earn on average more than $100,000 annually?

3. Is there statistical evidence lawyers earn on average more than accountants?

4. Estimate the difference in the average annual income of lawyers and accountants.

5. Policy makers want to know if the proportion of women in the United States who are in favorof legalizing marijuana use is more than 50%.

6. Is there statistical evidence that there is a lower percentage of women than men who favorlegalizing marijuana use?

7. Is there evidence that men spend more than women for food?

8. Estimate how much more or less men spend on average per month than women for food.

9. Using only one group of men, test whether men spend more or less for the month of July thanfor the month of December.

10. Using only one group of men, estimate how much more or less they spend for food for the monthof July than for the month of December.

11. Determine if the diameter of pipes produced by a machine is consistent enough to pass qualitycontrol.

12. How much does a UWL student spend, on average, for the month of February?

13. Using one set of students, estimate how much more or less they spend for the month of Februarythan for the month of March.

14. Is there evidence that male students spend more, on average, than female students for the monthof February?

15. Is there evidence that there is a higher percentage of female students than male students whoare in favor of making UWL a none smoking zone?

16. Inconsistency in product dimensions is a sign that the machine is not functioning properly. Isthere evidence that a machine is not functioning properly?

1.H2.A3.D4.I5.B6.F7.D8.I9.E10.J11.C12-16.Seefall2012sampleexamkey.

STAT 145 - Elementary Statistics Formula Sheet - Exam III

1. If Z =X − µσ/√n∼ N(0, 1).

a. The (1− α)100% confidence interval for µ is [X − Zα2

σ√n, X + Zα

2

σ√n

].

b. For a specified margin of error M , the required sample size is n =

(Zα

M

)2

.

c. To test H0 : µ = µ0 vs. H1 : µ > µ0, reject the null if Zobs =Xobs − µσ/√n

> Zα, or if the

p−value= P (Z ≥ Zobs) is ≤ α.

d. To test H0 : µ = µ0 vs. H1 : µ < µ0, reject the null if Zobs < −Zα, or if thep−value= P (Z ≤ Zobs) is ≤ α.

e. To test H0 : µ = µ0 vs. H1 : µ 6= µ0, reject the null if |Zobs| > Zα2, or if the

p−value= 2 ∗ P (Z ≥ |Zobs|) is ≤ α.

2. If t =X − µs/√n∼ t(n−1)

a. The (1− α)100% confidence interval for µ is [X − tα2

s√n, X + tα

2

s√n

].

b. To test H0 : µ = µ0 vs. H1 : µ > µ0, reject the null if tobs =Xobs − µs/√n

> tα.

c. To test H0 : µ = µ0 vs. H1 : µ < µ0, reject the null if tobs < −tα.

d. To test H0 : µ = µ0 vs. H1 : µ 6= µ0, reject the null if |tobs| > tα2.

3. If Z =p− p√p(1−p)n

≈ N(0, 1).

a. The (1− α)100% confidence interval for p is [p− Zα2

√p(1−p)n , p+ Zα

2

√p(1−p)n ].

b. For a specified margin of error M , the required sample size is n =Z2α/2[p(1− p)]

M2≤Z2α/2(0.25)

M2.

c. To test H0 : p = p0 vs. H1 : p > p0, reject the null if Zobs =p− p0√p0(1−p0)

n

> Zα.

d. To test H0 : p = p0 vs. H1 : p < p0, reject the null if Zobs < −Zα.

e. To test H0 : p = p0 vs. H1 : p 6= p0, reject the null if |Zobs| > Zα2.

4. If(n− 1)S2

σ2∼ χ2

(n−1).

a. To test H0 : σ2 = σ20 vs. H1 : σ2 > σ20, reject the null if X2obs =

(n− 1)S2obs

σ20> χ2

α.

b. To test H0 : σ2 = σ20 vs. H1 : σ2 < σ20, reject the null if X2obs =

(n− 1)S2obs

σ20< χ2

1−α.

c. To test H0 : σ2 = σ20 vs. H1 : σ2 6= σ20, reject the null if X2obs > χ2

α2

or if X2obs < χ2

1−α2.

5. If Z =(X1 − X2)− (µ1 − µ2)√

σ21n1

+σ22n2

∼ N(0, 1).

a. The (1− α)100% confidence interval for µ1 − µ2 is (X1 − X2)± Zα2

√σ21n1

+σ22n2

.

b. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 > d0, reject the null if Zobs > Zα.

c. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 < d0, reject the null if Zobs < −Zα.

d. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 6= d0, reject the null if |Zobs| > Zα2.

6. If t =(X1 − X2)− (µ1 − µ2)√

s21n1

+s22n2

≈ t(k∗), where k∗ ≈

(s21n1

+s22n2

)2

1n1−1

(s21n1

)2+ 1

n2−1

(s22n2

)2 .

a. The (1− α)100% confidence interval for µ1 − µ2 is (X1 − X2)± tα2

√s21n1

+s22n2

.

b. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 > d0, reject the null if tobs > tα.

c. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 < d0, reject the null if tobs < −tα.

d. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 6= d0, reject the null if |tobs| > tα2.

7. If t =(X1 − X2)− (µ1 − µ2)

sp

√1n1

+ 1n2

∼ t(n1+n2−2), where sp =

√(n1 − 1)s21 + (n2 − 1)s22

n1 + n2 − 2.

a. The (1− α)100% confidence interval for µ1 − µ2 is (X1 − X2)± tα2∗ sp

√1n1

+ 1n2

.

b. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 > d0, reject the null if tobs > tα.

c. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 < d0, reject the null if tobs < −tα.

d. To test H0 : µ1 − µ2 = d0 vs. H1 : µ1 − µ2 6= d0, reject the null if |tobs| > tα2.

8. If Z =p1 − p2 − (p1 − p2)√p1(1−p1)

n1+ p2(1−p2)

n2

≈ N(0, 1).

a. The (1− α)100% confidence interval for p1 − p2 is

[(p1 − p2)± Zα

2

√p1(1−p1)

n1+ p2(1−p2)

n2

].

b. To test H0 : p1 − p2 = 0 vs. H1 : p1 − p2 > 0, reject the null if Zobs =(p1 − p2)− 0√p(1−p)n1

+ p(1−p)n2

> Zα,

where, p =Y1 + Y2n1 + n2

, the pooled sample proportion.

c. To test H0 : p1 − p2 = 0 vs. H1 : p1 − p2 < 0, reject the null if Zobs < −Zα.

d. To test H0 : p1 − p2 = 0 vs. H1 : p1 − p2 6= 0, reject the null if |Zobs| > Zα2.

stat 145 – spring 2020 7.1 chi-square (χ2) tests 110

7.1 Chi-square (χ2) Tests

Key Concepts

• Test a hypothesis about a categorical variable using a chi-square goodness-of-fit test• Recognize when a chi-square distribution is appropriate for testing a categorical variable

Testing more than two groups

Up until now, we have discussed testing for categorical variableswhen there are only two groups. However, there are many statisticalquestions that require us to test categorical variables with three ormore groups. In this chapter, we will learn about two new tests thatgive us additional methods to learn about categorical variables.

χ2 test for goodness-of-fit The χ2 goodness-of-fit test is used totest proportions when we have morethan two groups in a single categoricalvariable.

In this lecture, we will be discussing a new hypothesis test calledthe χ2 (chi-square) goodness-of-fit test. The χ2 goodness-of-fit test isused to test about the relative frequency (or proportion) of observa-tions for three or more groups.

Class Example 7.1.1 Relative frequenciesJavier recently took an exam in a chemistry class that had 100 multiple choice questions. There were fouroptions per question (a, b, c, and d). Out of the 100 questions, he answered “a” 40 times, “b” 20 times, “c”15 times, and “d” 25 times.

a) Find the relative frequencies for each of the answers on his exam.

b) If he was just guessing on each question, what proportion of the time should he answer each option.

Hypotheses

The χ2 goodness-of-fit hypothesis test lets us see if Javier’s responsesfollow a different breakdown than what we expect to see if he werejust guessing. The hypotheses that we want to test in this exampleare as follows:

H0 :pa = 0.25, pb = 0.25, pc = 0.25, pd = 0.25

Ha :At least one pi is different

Note that the alternative only states that at least one is different. Ifwe reject the null hypothesis here, we do not know which one isdifferent, we only know that one of them is.

stat 145 – spring 2020 7.1 chi-square (χ2) tests 111

Expected counts

As with all hypothesis tests, we assume that the null hypothesis istrue when we conduct our test. For the χ2 goodness-of-fit test, weuse this assumption to figure out the counts we expect to see in thesample. To find the expected count for group i:

Expected count = n · pi

Class Example 7.1.2 Expected countsIn the previous example, we identified the proportion of the time Javier should answer each option. Usethese proportions to find the expected count of times he will answer each letter in a 100 question exam.

Test statistic We want to see if the observed countsare far enough away from the expectedcountsWhen we conduct the test, the goal is to see if the counts we observed

are farther from the expected counts than we would reasonably expectto see due to random chance. We use the following test-statistic forthe χ2 test

χ2 = ∑(Observed− Expected)2

Expected

χ2 distribution

There is a χ2 distribution (like a normal or t-distribution) that we canuse if we have a large enough sample size. In order for us to be able To use the χ2 distribution, each ex-

pected count must be at least 5 or larger

Our null distribution has a− 1 degreesof freedom if there are a categories.

to use the χ2 distribution, all of the expected counts need to be atleast 5 or larger. If we have met this condition, then we can use a χ2

distribution with a− 1 degrees of freedom where a is the number ofgroups in the categorical variable.

Class Example 7.1.3 Finish the hypothesis testCheck the conditions, identify the degrees of freedom, give the test statistic, and use the χ2 distribution tofind the p-value for this hypothesis test.

stat 145 – spring 2020 7.1 chi-square (χ2) tests 112

Class Example 7.1.4 Butterfly SpotsNature (Sept. 1993) reported on a study of animal and plant species “hotspots" in Great Britain. A hotspotis defined as a 10-km2 area that is species-rich, that is, is heavily populated by the species of interest. Anal-ogously, a coldspot is a 10-km2 area that is species-poor. The table below gives the number of butterflyhotspots and the number of butterfly coldspots in a sample of 2,588 10-km2 areas. In theory, 5% shouldbe butterfly hotspots and 5% coldspots, while the remaining areas (90%) are neutral. Test the theory usingα = 0.01.

Hotspots Coldspots Neutral Areas TotalObserved (Expected) 123 ( ) 147 ( ) 2318 ( ) 2588

Class Example 7.1.5 Car CrashesAmong drivers who have had a car crash in the last year, 88 are randomly selected and categorized by age,with the results listed in the accompanying table. If all ages have the same crash rate, we would expect(because of the age distribution of licensed drivers) the given categories to have 16%, 44%, 27%, and 13%of the subjects, respectively. At the 0.05 level of significance, test the claim that the distribution of crashesconforms to the distribution of ages. Does any age group appear to have a disproportionate number ofcrashes?

Age Under 25 25 - 44 45 - 64 Over 64

No. of Crashes 36 ( ) 21 ( ) 12 ( ) 19 ( )

stat 145 – spring 2020 7.1 chi-square (χ2) tests 113

Class Example 7.1.6 U.S. ethnicitiesThe U.S. Census Bureau reported that the U.S. population was approximately 16.9% Hispanic. A sample of1000 individuals in La Crosse yielded 145 Hispanic and 855 non-Hispanic individuals.

a) Is the proportion of Hispanic individuals in La Crosse different than the national rate? Use a χ2 goodness-of-fit test at α = 0.05.

b) What other kind of hypothesis test might we conduct to answer this question? How do the results fromthat hypothesis test compare with the χ2 test?

Suggested Exercises (7.1): 7.13, 7.17, 7.19, 7.21, 7.25

stat 145 – spring 2020 7.2 independence for two categorical variables 114

7.2 Independence for Two Categorical Variables

Key Concepts

• Test a hypothesis about an association between two categorical variable using a chi-square associationtest

• Recognize when a chi-square distribution is appropriate for testing an association between two categori-cal variables

Association Between Categorical Variables The χ2 association test is used to testthe relationship between two categoricalvariablesIn this lecture, we will be discussing a new hypothesis test called the

χ2 (chi-square) association test. The χ2 association test is used to testabout the relative frequencies (or proportions) of observations for twocategorical variables.

Hypotheses

The hypotheses for the χ2 association test tends to be described moregenerally than the other tests that we have seen so far. In fact, ratherthan using parameters in the hypotheses, we will typically expressour hypotheses in words. The hypotheses that we want to test in thistest are as follows:

H0 :Variable 1 is not associated with Variable 2

Ha :Variable 1 is associated with Variable 2

If we reject the null hypothesis here, we can only say that there is anassociation, but we cannot state exactly what that relationship is.

Class Example 7.2.1 Traffic cameras and injuriesMany cities have introduced traffic cameras at high-risk street intersections in an effort to reduce the sever-ity of traffic accidents. Citizen rights groups have complained about the efficacy of these cameras. In fact,they doubt they have any impact whatsoever. A sample of 2938 reported accidents was collected includ-ing the type of accident (Death/Disabling Injury, Evident Injury, or Probable Injury) and camera status atthe intersection (Before Camera, After Camera). What are the hypotheses to test the relationship betweenaccident severity and presence of a traffic camera?

stat 145 – spring 2020 7.2 independence for two categorical variables 115

Expected counts

As with all hypothesis tests, we assume that the null hypothesis istrue when we conduct our test. For the χ2 association test, if the null The expected counts come from the

probability rules. If A and B are inde-pendent, then P(A ∩ B) = P(A) ∗ P(B)

hypothesis is true, the two categorical variables are independent. Weuse this assumption to figure out the counts we expect to see in thesample. To find the expected count for (Variable 1 group i, Variable 2

group j):

Expected count =Row total ∗Column total

Total total

Class Example 7.2.2 Traffic cameras and injuries, continuedTable 7.2.1 summarizes the traffic camera data. Use this data to compute a table of expected counts.

Camera status

Injury Severity Before Camera After Camera

Death/Disabiling 61 27

Evident 210 136

Probable 1659 845

Table 7.2.1: Traffic camera status andaccident severity

Test statistic We want to see if the observed countsare far enough away from the expectedcountsWhen we conduct the test, the goal is to see if the counts we observed

are farther from the expected counts than we would reasonably expectto see due to random chance. We use the same test-statistic for the χ2

association test that we used for the χ2 goodness-of-fit test:

χ2 = ∑(Observed− Expected)2

Expected

Class Example 7.2.3 Traffic cameras and injuries, continuedUsing the data in table 7.2.1, find the χ2 test statistic using the traffic camera data to test if there is an asso-ciation between traffic cameras and injury severity.

stat 145 – spring 2020 7.2 independence for two categorical variables 116

χ2 test for association To use the χ2 distribution, each ex-pected count must be at least 5 or larger

In order for us to be able to use the χ2 distribution, all of the ex-pected counts need to be at least 5 or larger. If we have met this con-dition, then we can use a χ2 distribution with (r− 1) ∗ (c− 1) degreesof freedom where r is the number of groups in the first categoricalvariable (number of rows) and c is the number of groups in the sec-ond categorical variable (number of columns). To find the p-valueusing the χ2 distribution, you can either use StatKey or a TI-83/84.The p-value calculation here works the same as for the goodness-of-fit test.

Class Example 7.2.4 Traffic cameras and injuries, continuedCheck the conditions, identify the degrees of freedom, and use the χ2 distribution to find the p-value forthe hypothesis test for the traffic camera study.

Class Example 7.2.5 Quitting Smoking.The accompanying table summarizes successes and failures when subjects used different methods in tryingto stop smoking. The determination of smoking or not smoking was made fivemonths after the treatmentwas begun, and the data are based onresults from the Centers for Disease Control and Prevention. Usea 0.05 level of significance to test the claim that success is independent of the method used. If someonewants to stop smoking, does the choice of the method make a difference?

Nicotine Gum Nicotine Patch Nicotine InhalerSmoking 191 263 95

No smoking 59 57 27

stat 145 – spring 2020 7.2 independence for two categorical variables 117

Class Example 7.2.6 Survey Refusals by AgeA study of people who refused to answer survey questions provided the randomly selected sample datashown in the table. At the 0.01 significance level, test the claim that the cooperation of the subject (responseor refusal) is independent of the age category. Does any particular age group appear to be particularlyuncooperative?

Age 18-21 22-29 30-39 40-49 50-59 60 and overResponded 73 255 245 136 138 202

Refused 11 20 33 16 27 49

Class Example 7.2.7 Gender and tattooTattoos among teens are becoming more much prevalent in our society. Is there a relationship betweengender and getting a tattoo? In an article in the journal Pediatrics, Carroll et al. presented the results of asurvey of 442 adolescents. This survey was conducted between December 2000 and April 2001 at the Ado-lescent Clinic, Naval Medical Center in San Diego. The survey asked questions regarding many behaviorsincluding the use of drugs, sexual activity, and the presence of tattoos. Table 7.2.2 gives a breakdown of thegender and if the subjects had at least one tattoo. Does this give evidence to suggest that gender and tattoostatus are related?

Gender

Male Female

Tattoo 15 44

No Tattoo 171 212

Table 7.2.2: Gender and tattoo status

stat 145 – spring 2020 7.2 independence for two categorical variables 118

Class Example 7.2.8 Racial steeringA subtle form of racial discrimination in housing is “racial steering.” Racial steering occurs when realestate agents show prospective buyers only homes in neighborhoods already dominated by that family’srace. This violate the Fair Housing Act of 1968. According to an article in Chance magazine (Vol. 14, no. 2

[2001]), tenants at a large apartment complex recently filed a lawsuit alleging racial steering. The complexis divided into two parts: Section A and Section B. The plaintiffs claimed that white potential renters weresteered to Section A, while African-American renters were steered to Section B. Table 7.2.3 displays thedata that were presented in court to show the locations of recently rented apartments. Do you think thereis evidence of racial steering?

Race

White Black

Section A 87 8

Section B 83 34

Table 7.2.3: Apartment sections brokendown by race

Class Example 7.2.9 Background MusicBackground Music. Market researchers know that background music can influence the mood and pur-chasing behavior of customers. One study in a supermarket in Northern Ireland compared three treat-ments: no music, French accordion music, and Italian string music. Under each condition, the researchersrecorded the numbers of bottles of French, Italian, and other wine purchased. The two-way table that sum-marizes the data are given below. Test the hypothesis that background music and purchasing behavior(type of wine purchased) are independent. Use α = 0.05.

Wine French music Italian music No musicFrench 39 30 30

Italian 1 19 11

Other 35 35 43

Suggested Exercises (7.2): 7.41, 7.51, 7.53, 7.55

stat 145 – spring 2020 1.3 experiments and observational studies 119

1.3 Experiments and Observational Studies“To consult the statistician after an experiment is finished is often merely to ask him to conduct a post mortemexamination. He can perhaps say what the experiment died of.” – R. A. Fisher

Key Concepts

• Not every association implies causation• Identify potential confounding variables in a study• Distinguish between an observational study and a randomized experiment• Recognize that only randomized experiments can lead to claims of causation• Explain how and why placebos and blinding are used in experiments• Distinguish between a randomized comparative experiment and a matched pairs experiment• Design and implement a randomized experiment

Class Example 1.3.1 Child growth hormone and sleepAbout 60% of a child’s growth hormone is secreted during sleep, so it is believed that a lack of sleep inchildren might stunt growth. (Time magazine, March 26, 2012, p. 46)

a) What is the explanatory variable?

b) What is the response variable?

c) Describe a completely randomized experiment to test this association is a causal association.

d) Is the experiment you described ethical? Explain.

stat 145 – spring 2020 1.3 experiments and observational studies 120

Association and causation Two variables are associated if values ofone variable tend to be related to thevalues of the other variable.

Two variables are causally associated ifchanging the value of one variable in-fluences the value of the other variable.

The comic in Figure 1.3.1 describes a very common occurrence. Aresearch study finds a relationship between variables A and B, andbefore you know it, all of the sudden the media is reporting thatvariable A causes variable B. Fortunately, with a basic understandingof experimental design, you can easily determine whether we areonly talking about an association between A and B, or if we can saythat A causes B.

Figure 1.3.1: “Piled Higherand Deeper” by Jorge Chamwww.phdcomics.com

Observational studies vs experiments In an experiment the researcher activelycontrols one or more of the explanatoryvariables.

In an observational study the researchersimply observes the values as theynaturally exist.

A confounding variable is a third vari-able that is associated with both theexplanatory and response variable, butnot necessarily of interest in the study.

In determining causation, the first thing we need to know is whetheror not the researcher actively controlled the value of any variable.If the researcher is only observing what happened, the study is anobservational study. In statistics, the word observational does not meanthat the researcher is watching the participant do every part of thestudy. Instead, observational refers to the fact that the researchertakes a dataset and makes observations about the data in the set. If

stat 145 – spring 2020 1.3 experiments and observational studies 121

the researcher is actively involved with assigning different valuesof the explanatory variable to the participants, then the study is anexperiment. Although you can conduct an experiment without ran-domization, the only way you can determine causation (as opposedto association) is through a randomized experiment.

Randomized experiments In a randomized experiment the value ofthe explanatory variable for each unitis determined randomly, before theresponse variable is measured.

Although observational studies and non-randomized experimentscan help us begin to notice relationships between variables, the onlyway we can state that one variable “causes” another is to use a ran-domized experiment. As with random sampling, there are a number ofways we can randomly assign treatments to study participants.

Class Example 1.3.2 Running shoe study backgroundTo demonstrate the differences between some of the more commonly used experimental designs, considerthe following study. A running shoe company wants to know if the type of shoe impacts the speed ofrunners. One aspect of the shoe that they are considering is the heel-toe drop, or the difference in heightbetween the heel of the shoe to the toe of the shoe. Minimalist shoes reduce the heel-toe drop to 0 – 4 mm,whereas a more traditional shoe has an 8 – 12 mm heel-toe drop. This company wants to know if a lowerheel-toe drop will cause runners to run more quickly, so they recruit 100 marathon runners of varyingability. For the study, the runner will run 5k, and their time will be used to establish their pace.

Randomized comparative design In a randomized comparative design,we randomly assign cases to differenttreatment groups and then compareresults on the response variable(s)

In a randomized comparative design, we take all the participants in thestudy and randomize them to a different treatment group.

stat 145 – spring 2020 1.3 experiments and observational studies 122

Block design In a block design, cases are first splitinto groups (called blocks), and withineach group the value of the explanatoryvariable for each unit is determinedrandomly.

In a block design, we first participants by some logical grouping thatwe think might have an impact on the response in addition to thevariable we are studying.

Class Example 1.3.3 Picking the blocking factorWhy might it make sense to group the runners into professionals vs amateurs?

Matched pairs design In a matched pairs design, cases get bothtreatments (or cases are paired) andwe examine differences in the responsebetween the two treatments.

In a matched pairs design, each participant is assigned to each of twotreatment settings, responses are measured for each treatment, andthe differences in responses are computed for each participant. Be-cause two measurements are obtained for each individual, the mea-surements are dependent upon each other. The two treatments oftencome in the form of “Before vs. After” or “Method A vs. Method B.”In the “Method A vs. Method B” type of pairing, it is important torandomize the order of the treatments to avoid a confounding ordereffect.

stat 145 – spring 2020 1.3 experiments and observational studies 123

Class Example 1.3.4 Describing the matched pairs running shoe experimentThinking about the matched pairs design for the experiment about running shoes

a) What are the variables in the study? Are they categorical or quantitative?

b) What are the explanatory and response variables?

c) Explain how the treatments would be assigned.

d) Why might a matched pairs design be beneficial in this experiment?

Control groups, placebos, and blinding The control group does not receive atreatments.

A placebo is a fake treatment that isdesigned to look like the treatment buthas no therapeutic value.

In a single-blind study, participants donot know if they are in the treatment orcontrol group.

For an experiment, it is important to be able to determine if the treat-ment actually is making a difference, or if we are seeing results thatwould have happened regardless of the treatment. The purpose of acontrol group is to establish what we would expect to happen regard-less of the treatment. Often times, in order to make sure that peopleadhere to the study guidelines, we use a placebo that is designed tolook like the treatment. The placebo makes it much easier to con-

In a double-blind study, neither theparticipants nor the people interactingwith the participants knows if they arein the treatment or control group.

duct single-blinded experiments or double-blinded experiments. Not allrandomized experiments make use of control groups, placebos, orblinding; however, in studies involving humans, these techniques areoften used to help make effective comparisons between groups.

Class Example 1.3.5 Depression and ProzacResearchers at a prominent Midwestern university would like to determine if Prozac is effective in re-ducing depression as determined by patient responses to a questionnaire. The researchers recruited 50

individuals suffering from depression. Describe a completely randomized double-blind experiment using aplacebo to test this association is a causal association.

Suggested Exercises (1.3): 1.83, 1.85, 1.87, 1.89, 1.91

1

Analysis of Variance (ANOVA)

Two Types of Study: 1.  Observational Study – observes individuals and

measures variables of interest but does not attempt to influence the responses.

Ø  This type of study can also establish association between a factor and the response variable.

2.  Designed Experiments – deliberately imposes some treatment on individuals in order to observe their responses.

Ø  This type of study can also establish cause and effect (between a factor and the respon

Do # 10.5 on page 480.

1

Examples of Designed Experiment

Example 1 : Consider the problem of comparing the effectiveness of 3 kinds of diets (A, B, C). Forty males and 80 females were included in the study and were randomly divided into 3 groups of 40 people each. Then a different diet is assigned to each group. The body weights of these 120 people were measured before and after the study period of 8 weeks and the differences were computed.

Example 2 : In a classic study, described by F. Yates in the The

Design and Analysis of Factorial Experiments, the effect on oat yield was compared for three different varieties of oats (A, B, C) and four different concentrations of manure (0, 0.2, 0.4, and 0.6 cwt per acre).

2

Terminologies in Experiments Ø  Experimental Units – These are the individuals on

which the experiment is done. Ø  Subjects – human beings.

Ø  Response variables – Measurement of interest. Ø  Factors – Things that might affect the response

variable (explanatory variables). new drug Ø  Levels of a factor – different concentration of the new

drug; no drug, 10 mg, 25 mg, etc. Ø  Treatment – A combination of levels of factors. Ø  Repetition – putting more than one experimental

units in a treatment.

3

Example 1 : Diet Study

Example 1 : Consider the problem of comparing the effectiveness of 3 kinds of diets (A, B, C). Forty males and 80 females were included in the study and were randomly divided into 3 groups of 40 people each. Then a different diet is assigned to each group. The body weights of these 120 people were measured before and after the study period of 8 weeks and the differences were computed.

a)  Experimental units : b)  Response variable : c)  Factor(s) : d)  Levels : e)  Treatments :

4

2

Example 2 : Oat Yield Study

Example 2 : In a classic study, described by F. Yates in the The Design and Analysis of Factorial Experiments, the effect on oat yield was compared for three different varieties of oats (A, B, C) and four different concentrations of manure (0, 0.2, 0.4, and 0.6 cwt per acre).

a)  Experimental units : b)  Response variable : c)  Factor(s) : d)  Levels : e)  Treatments :

5

Designs of Experiments Ø  Completely Randomized – Experimental units are allocated at

random among all treatments, or independent random samples are selected for each treatment.

Ø  Double-Blind Study – Neither the subjects nor the medical personnel know which treatment is being giving to the subject.

Ø  Matched Pair – Used for studies with 2 treatment arms, where an individual from one group is matched to another in the other group.

Ø  Block Design – The random assignment of units to treatments is carried out separately within each block.

Ø  Block – is a group of experimental units that are known to be similar in some way that is expected to affect the response to the treatment.

6

Example 1 : Diet Study

Example 1: Consider the problem of comparing the effectiveness of 3 kinds of diets (A, B, C). Forty males and 80 females were included in the study and were randomly divided into 3 groups of 40 people each. Then a different diet is assigned to each group. The body weights of these 120 people were measured before and after the study period of 8 weeks and the differences were computed.

Ø  Block - Gender

7

stat 145 – spring 2020 1.3 experiments and observational studies 126

Class Example 1.3.6 Terminologies for Study Designs

1. A company investigated the effects of selling price on sales volume of one of its products. Three sellingprices (55 cents, 60 cents, 65 cents) were studied. Twelve communities throughout the United States, ofapproximately equal size and similar socioeconomic characteristics, were selected and the treatmentswere assigned to them at random, such that each treatment was given to four communities.

(a) Is this an example of experimental or observational study?

(b) Identify the response variable.

(c) Identify the Experimental units.

(d) Identify the Factor and the levels.

(e) Identify the treatments.

2. In the previous example, suppose the company investigated the effects of selling price and type of pro-motional campaign on sales volume of one of its products. Three selling prices (55 cents, 60 cents, 65

cents) were studied, as were two types of promotional campaigns (radio advertising, newspaper ad-vertising). Twelve communities throughout the United States, of approximately equal size and similarsocioeconomic characteristics, were selected and the treatments were assigned to them at random, suchthat each treatment was given to two communities.

(a) What study design was employed in this study?

(b) Identify the response variable.

(c) Identify the Factors and their levels.

(d) How many treatments are there?

3. An analyst studied the effects of family income (under $15,000, $15,000 − $29,999, $30,000 − $49,999,$50,000 and more) and stage in the life cycle of the family (stages 1, 2, 3, 4) on amount spent on appli-ance purchases in the last 5 years. The analyst selected 20 families with the required income and life-cycle characteristics for each of the “treatment" classes for this study, yielding 320 families for the entirestudy.

(a) Is this an example of experimental or observational study?

(b) Identify the response variable.

(c) Identify the Experimental units.

(d) Identify the Factors and their levels.

(e) How many treatments are there?

4. A medical investigator studied the relationship between the response to three blood pressure loweringdrug types for hypertensive males and females. The investigator selected 30 adult males and 30 adultfemales and randomly assigned 10 males and 10 females to each of the three drug types, yielding 60

total subjects.

(a) Is this an example of experimental or observational study?

(b) Identify the response variable.

(c) Identify the Experimental units.

(d) Identify the Factors and their levels.

(e) How many treatments are there?

stat 145 – spring 2020 8.1 analysis of variance 127

8.1 Analysis of Variance

Key Concepts

• Use ANOVA to test for a difference in means among several groups• Explain how variation between groups and variation within groups are relevant for testing a difference

in means between multiple groups.

Motivation

s In a two-sample t-test (test for difference in means), we record values of one categorical variable (withtwo groups) and one quantitative variable. Our goal is to compare the means between the two groups.

Figure 8.1.1: Motivating example forANOVATwo sets of sample data are displayed in Figure 8.1.1. In which set of sample data, A or B, is there likely to

be stronger evidence of a difference between the two sample means? Why?

Analysis of Variance

In the example above, the sample mean for Group 1 was the same forboth datasets, and likewise for Groups 2. However, the spread withineach sample was different for the two datasets. We used the spreadto decide which provided stronger evidence of a difference. Recall,the test statistic for a two-sample t-test is:

t =x1 − x2√

s21

n1+

s22

n2

stat 145 – spring 2020 8.1 analysis of variance 128

In the numerator of the test statistic, we calculated the difference be-tween the two sample means, or the spread between the two groups.In the denominator, we calculated the standard error, which is a mea-sure of spread within the two groups. How would this test statisticchange if we wanted to test if there was a difference in means be-tween three or more groups? The Analysis of Variance (ANOVA) ANOVA is an extension of the two-

sample t-test to more than two groups.procedure can be regarded as an extension of the two-sample t-testto more than two samples. In fact, the test statistic is formed in muchthe same way. The test statistic for ANOVA is an F-statistic, and hasthe following form.

F =Spread between group means

Spread within groups

This is the same concept as our t-statistic from a two sample t-test; infact, we can think of the difference in means (numerator of t) to be ameasure of spread between the means.

Statement of hypotheses

The ANOVA hypothesis test is used to see if groups have signifi-cantly different averages. If we are considering k groups, then thehypotheses for the ANOVA test are

H0 :µ1 = µ2 = . . . = µk

Ha :At least one µi is different

Finding the test statistic SS stands for sum of squares

MS stands for mean squaresThe test statistic for an ANOVA hypothesis test is an F-statistic. Tofind an F-statistic, we will use an ANOVA table. An ANOVA tableis used to help us compare the variability between the sample meansand the variability within the samples.

ANOVA Table

Source DF Sum of Squares Mean Square F

Treatment k− 1 SSTR =k

∑i=1

ni(xi − x)2 MSTR =SSTRk− 1

Fobs =MSTRMSE

Error n− k SSE =k

∑i=1

(ni − 1)s2i MSE =

SSEn− k

Total n− 1 SSTO =k

∑i=1

ni

∑j=1

(xij − x)2

Note: SSTO = SSTR + SSE. Under H0, Fobs ∼ f(k−1,n−k).

stat 145 – spring 2020 8.1 analysis of variance 129

Class Example 8.1.1 Productivity ImprovementAn economist compiled data on productivity improvements last year for a sample of firms producing elec-tronic computing equipment. The firms were classified according to the level of their average expendituresfor research and development in the past three years (low, moderate, high). The results of the study aregiven in the table below (productivity improvement is measured on a scale from 0 to 100). Assuming thatANOVA model is appropriate, test the hypothesis that the level of expenditures for research and develop-ment has no effect on the productivity improvements. Use α = 0.05.

1 2 3 4 5 6 7 8 9 10 11 12

Low 7.6 8.2 6.8 5.8 6.9 6.6 6.3 7.7 6.0Moderate 6.7 8.1 9.4 8.6 7.8 7.7 8.9 7.9 8.3 8.7 7.1 8.4High 8.5 9.7 10.1 7.8 9.6 9.5

stat 145 – spring 2020 8.1 analysis of variance 130

Class Example 8.1.2 Rehabilitation TherapyA rehabilitation center researcher was interested in examining the relationship between physical fitnessprior to surgery of persons undergoing corrective knee surgery and time required in physical therapy untilsuccessful rehabilitation. Patient records in the rehabilitation center were examined, and 24 male subjectsranging in age from 18 to 30 years who had undergone similar corrective knee surgery during the past yearwere selected for the study. The number of days required for successful completion of physical therapyand the prior physical fitness status (below average, average, above average) for each patient follow.

1 2 3 4 5 6 7 8 9 10

Below Average 29 42 38 40 43 40 30 42

Average 30 35 39 28 31 31 29 35 29 33

Above Average 26 32 21 20 23 22

1. Construct the ANOVA table.

2. Test whether or not the mean number of days required for successful rehabilitation is that same for thethree fitness groups. Use α = 0.05 level of significance.

stat 145 – spring 2020 8.1 analysis of variance 131

Class Example 8.1.3 Comparing ShampoosAnalysis of variance methods are often used in clinical trials where the goal is to assess the effectivenessof one or more treatments for a particular medical condition. One such study compared three treatmentsfor dandruff and a placebo. The treatments were 1% pyrithione zinc shampoo (PyrI), the same shampoobut with instructions to shampoo two times (PyrII), 2% ketoconazole shampoo (Keto), and a placebo sham-poo (Placebo). After six weeks of treatment, eight sections of the scalp were examined and given a scorethat measured the amount of scalp flaking on a 0 to 10 scale. The response variable was the sum of theseeight scores. An analysis of the baseline flaking measurements indicated that randomization of patients totreatments was successful in that no differences were found between the groups. At baseline there were112 subjects in each of the three treatment groups and 28 subjects in the Placebo group. During the clinicaltrial, 3 dropped out from the PyrII group and 6 from the Keto group. No patients dropped out of the othertwo groups. A summary of the data is given below. Using α = 0.01, test the hypothesis that there is nodifference in the effectiveness of the four treatments.

Treatments n x sPyr I 112 17.39 1.142

Pyr II 109 17.20 1.352

Keto 106 16.03 0.931

Placebo 28 29.39 1.595

stat 145 – spring 2020 8.1 analysis of variance 132

Conditions to use the F-test Conditions to use the F-test:

• We need to know that each averageis approximately normal

• No group standard deviation can bemore than 2 times the others

1. The samples are independent SRS from each population.

2. The populations are assumed to be normal.

3. The standard deviations are equal. [Rule of thumb: The largeststandard deviation should not be more than twice the smallest standarddeviation.]

Class Example 8.1.4 Productivity Improvement revisitedVerify that the 3 conditions are satisfied by the data set for productivity improvement.

Class Example 8.1.5 Rotten TomatoesRotten Tomatoes is a website providing movie ratings and reviews. Each movie gets a “Tomatometer"score, which is “The percentage of Approved Tomatometer critics who have given this movie a positivereview." A sample of movies for seven categories was taken, and the summary statistics are provided inTable 8.1.1. Does the average Tomatometer score differ by movie genre?

Genre x s n

Action 44.97 25.10 31Animation 60.58 26.73 12Comedy 49.78 26.35 27Drama 67.90 18.06 21Horror 41.29 27.04 17Romance 47.20 31.57 10Thriller 62.38 28.66 13

Table 8.1.1: Summary statistics forrandom sample of tomatometer scoresfor seven categories

a) What are the variables recorded in this study? Are they categorical or quantitative? Which of the vari-ables is the independent variable? Dependent variable?

b) State the appropriate hypotheses for this test.

c) Are the conditions for using the F-distribution satisfied? Why or why not?

d) Regardless of your previous answer, test to see whether the Tomatometer score differ significantly bymovie genre (use α = 0.05)? Make a conclusion in context.

stat 145 – spring 2020 8.1 analysis of variance 133

Source df SS MS F p-value

Group 11407.4

Error

Total 93268.1

Table 8.1.2: Tomatometer ANOVA table

Class Example 8.1.6 Caffeine and finger tappingDoes caffeine consumption have an effect on twitch movements? To investigate this question, the followingexperiment was conducted. 30 subjects were randomly assigned to one of three groups, with 10 subjectsin each group. The subjects were then given a tablet containing 0mg, 100mg, or 200mg of caffeine. Twohours later, they were asked to tap their finger as quickly as possible for one minute. Summary statisticsare provided in Table 8.1.3.

0 mg 100 mg 200 mg

x 244.8 246.4 248.3s 2.394 2.066 2.214

Table 8.1.3: Summary statistics forcaffeine and finger tapping experiment

a) What are the variables recorded in this study? Are they categorical or quantitative? Which of the vari-ables is the independent variable? Dependent variable?

b) State the appropriate hypotheses for this test.

c) Are the conditions for using the F-distribution satisfied? Why or why not?

d) Regardless of your previous answer, test to see whether caffeine consumption cause a difference in theaverage number of finger taps (use α = 0.05)? Make a conclusion in context.

Source df SS MS F p-value

Group 61.4

Error 134.1

Total

Table 8.1.4: Caffeine and finger tappingANOVA table

e) Is there a practical difference between the groups? Is this the same as a statistical difference?

Suggested Exercises (8.1): 8.15, 8.17, 8.23, 8.31, 8.39

Math 145 - Elementary Statistics Correlation

• Regression analysis is a statistical tool that utilizes the relation between two or more quantitative variables sothat one variable can be predicted from the other, or others.

• Some Examples:

1. Waistline and Weight.

2. SAT score and First year college GPA.

3. Number of customers and Revenue.

4. Family income and Family expenditures.

• Functional Relation vs. Statistical Relation between two variables.

– A functional relation between two variables is expressed by a mathematical formula. IfX is the independentvariable and Y the dependent variable, a functional relation is of the form:

Y = f(X).

That is, given a particular value of X , we get only one corresponding value Y .

1. For example, let x denote the number of printer cartridges that you order over the internet. Supposeeach cartridge costs $40 and there is a fixed shipping fee of $10, determine the total cost y of orderingx cartridges.

– A statistical relation, unlike a functional relation, is not a perfect one. If X is the independent variableand Y the dependent variable, a statistical relation is of the form:

Y = f(x) + ǫ.

In such cases, we call X an explanatory variable and Y a response variable.

1. For example, let x denote the distance that a person plans to jog and y the time that it will take thisperson to finish it. Consider his 22 jogging distances and times from last month shown in the tablebelow. If this person plans to jog for 5.5 miles tomorrow, predict how long it will take him to finishthe run.

1 2 3 4 5 6 7 8 9 10 11Distance (x) 2 2 3 3 2 2.5 2.5 3 3.5 3.5 4Time (y) 25 22 35 36 23 30 31 35 41 40 49

12 13 14 15 16 17 18 19 20 21 22Distance (x) 4 4 4 4.5 4.5 5 5 5 3.5 3.5 4Time (y) 47 48 48 56 53 62 60 61 42 41 47

• Scatterplots. A scatterplot (or scatter diagram) is a graph in which the paired (x, y) sample data are plottedwith a horizontal x−axis and a vertical y−axis. Each individual (x, y) pair is plotted as a single point.Scatterplots are useful as they usually display the relationship between two quantitative variables.

– Always plot the explanatory variable on the x−axis, while the response variable on the y−axis.

– In examining a scatterplot, look for an overall pattern showing the form, direction, and strength ofthe relationship, and then for outliers or other deviations from this pattern.

∗ Form - linear or not.

∗ Direction - positive or negative association.

∗ Strength - how close the points lie to the general pattern (usually a line).

2.0 2.5 3.0 3.5 4.0 4.5 5.0

30

40

50

60

Distance

Fin

ish T

ime

• Correlation. A correlation exists between two variables when one of them is related to the other in some way.

• Linear Correlation. The linear correlation coefficient r measures the strength of the linear relationshipbetween the paired x− and y−quantitative values in a sample.

r =

∑(xi − x)(yi − y)√∑

(xi − x)2∑

(yi − y)2(1)

=n∑

xiyi − (∑

xi)(∑

yi)√n∑

x2i − (

∑xi)2

√n∑

y2i − (∑

yi)2(2)

=1

n− 1

n∑

i=1

(xi − x

sx

)(yi − y

sy

)(3)

=SSxy√

SSxxSSyy

(4)

where,

SSxx = Σx2 − 1

n(Σx)2 = (n− 1)s2x (5)

SSyy = Σy2 − 1

n(Σy)2 = (n− 1)s2y (6)

SSxy = Σxy − 1

n(Σx)(Σy) (7)

• Tree Circumference and Height. Listed below are the circumferences (in feet) and the heights (in feet)of trees in Marshall, Minnesota (based on data from “Tree Measurements” by Stanley Rice, American BiologyTeacher.

x (circ) 1.8 1.9 1.8 2.4 5.1 3.1 5.5y (height) 21.0 33.5 24.6 40.7 73.2 24.9 40.4

x (circ) 5.1 8.3 13.7 5.3 4.9 3.7 3.8y (height) 45.3 53.5 93.8 64.0 62.7 47.2 44.3

1. Determine the values of SSxx, SSyy, and SSxy.

2. Determine the correlation coefficient r.

3. What can you say about the linear relationship of x and y? Is it a strong linear relationship.

• The table below displays data on age (in years) and price (in $100)for a sample of 11 cars.

Age (x) 5 4 6 6 5 5 6 6 2 7 7Price (y) 85 102 70 80 89 98 66 90 169 68 50

1. Determine the values of SSxx, SSyy, and SSxy.

2. Determine the correlation coefficient r.

3. What can you say about the linear relationship of x and y? Is it a strong linear relationship.

5/16/17

1

Correlation• Aneasywaytodetermineiftwoquantitativevariablesarelinearlyrelatedisbylookingattheirscatterplot.

• Anotherwayistocalculatethecorrelationcoefficient,denotedusuallybyr.

Note:-1≤r ≤1.

1

• TheLinearCorrelationmeasuresthestrengthofthelinearrelationshipbetweenexplanatoryvariable(x)andtheresponsevariable(y).AnestimateofthiscorrelationparameterisprovidedbythePearsonsamplecorrelationcoefficient,r.

ExampleScatterplotswithCorrelations

2

IfXandYareindependent,thentheircorrelationis0.

5/16/17

2

Correlation

• SomeGuidelinesinInterpretingr.

Value of|r| Strengthoflinearrelationship

If|r|≥ 0.95 VeryStrong

If0.85≤|r|<0.95 Strong

If0.65≤|r|<0.85 Moderate toStrong

If0.45≤|r|<0.65 Moderate

If0.25≤|r|<0.45 Weak

If|r|<0.25 Veryweak/Close tonone

If the correlation between X and Y is 0, itdoesn’t mean they are independent. It onlymeans that they are not linearly related.

One complain about the correlation is thatit can be subjective when interpreting itsvalue. Some people are very happy withr≈0.6, while others are not.

Note:CorrelationdoesnotnecessarilyimplyCausation!

3

SimpleLinearRegression• Model:Yi=(β0+β1xi)+εi

where,• Yi istheith valueoftheresponsevariable.• xi istheith valueoftheexplanatoryvariable.• εi’s areuncorrelatedwithameanof0andconstantvarianceσ2.

x

y

Y=β0+β1xRandom Error

x1

*

Expectedpoint

Observedpoint

ε1

*

*

**

*

**

• Howdowedeterminetheunderlyinglinearrelationship?

• Well,sincethepointsarefollowingthislineartrend,whydon’twelookforalinethat“best”fitthepoints.

• Butwhatdowemeanby“best”fit?Weneedacriteriontohelpusdeterminewhichbetween2competingcandidatelinesisbetter.

L1L2

L3

L4

4

5/16/17

3

MethodofLeastSquares• Model:Yi=(β0+β1xi)+εi

where,• Yi istheith valueoftheresponsevariable.• xi istheith valueoftheexplanatoryvariable.• εi’s areuncorrelatedwithameanof0andconstantvarianceσ2.

x

y

Y=β0+β1x

x1

*

P1(x1,y1)

e1

*

*

**

*

**

• Residual=(Observedy-value)– (Predictedy-value)e1=y1 –

y1Example:

2+.8x

e2

MethodofLeastSquares:ChoosethelinethatminimizestheSSEasthe“best”line.ThislineisunknownastheLeast-SquaresRegressionLine.

Question: Butthereareinfinitepossiblecandidatelines,howcanwefindtheonethatminimizestheSSE?

Observed

Predicted

Answer:SinceSSEisacontinuousfunctionof2variables,wecanusemethodsfromcalculustominimizetheSSE.5

ModelAssumptions

Since the underlying (green) line is unknown to us, we can’t calculate the values of the error terms (εi). The best that we can do is study the residuals (ei).

• Model:Yi=(β0+β1xi)+εi

where,• εi’s areuncorrelatedwithameanof0andconstantvarianceσ2ε.• εi’s arenormallydistributed.(This is needed in the test for the slope.)

x

y

Y=β0+β1x

e1

*ε1

x1

Expectedpoint

Observedpoint

Predictedpoint

6

STAT 145 - Elementary Statistics Simple Linear Regression

• In a simple linear regression model, the response variable Y is linearly related to one explanatory variable X.That is,

Yi = (a+ bxi) + εi. i = 1, 2, . . . , n.

Assumptions:

1. The mean of εi is 0.

2. The variance of εi is σ2 and is constant across values of x.

3. The random errors εi are uncorrelated.

• Equation of the Least-Squares Regression Line . Suppose we have data on an explanatory variable xand a response variable y for n individuals. The means and standard deviations of the sample data are x and sxfor x and y and sy for y, and the correlation between x and y is r. The equation of the least-squares regressionline of y on x is

y = a+ bx, with slope, b =SSxySSxx

= rsysx, and intercept , a = y − bx.

• Inference for the Slope b.

1. Test statistic:b− bSEb

∼ t(n−2), where, SEb =b√

1− r2r√n− 2

2. Confidence Interval: b± tα/2SEb• Practice.

1. The table below displays data on age (in years) and price (in $100) for a sample of 11 cars.

Age (x) 5 4 6 6 5 5 6 6 2 7 7Price (y) 85 102 70 80 89 98 66 90 169 68 50

a. Determine the regression line.

b. Estimate the expected value of a car that is 3 years old.

c. Using α = .01, test if Age (x) has a significant effect on the Price (y) of the car.

2. Tree Circumference and Height. Listed below are the circumferences (in feet) and the heights (infeet) of trees in Marshall, Minnesota (based on data from “Tree Measurements” by Stanley Rice, AmericanBiology Teacher.

x (circ) 1.8 1.9 1.8 2.4 5.1 3.1 5.5y (height) 21.0 33.5 24.6 40.7 73.2 24.9 40.4

x (circ) 5.1 8.3 13.7 5.3 4.9 3.7 3.8y (height) 45.3 53.5 93.8 64.0 62.7 47.2 44.3

a. Determine the regression line.

b. Estimate the expected height of a tree that has a circumference of 10 feet.

c. Using α = .05, test if trunk circumference of trees is a significant predictor on their height.

3. To study the relationship between age x (in years) and body fat y, 18 adults (with ages from 33 to 48)were randomly selected. A summary of the data obtained is given below:

SSxx = 2970, SSxy = 1998, SSyy = 1683,∑

xi = 834 and∑

yi = 499

a. Determine the correlation coefficient.

b. Determine the regression line.

c. Using the regression line that you obtained in part (b), estimate the expected body fat of 50-year-oldpeople.

d. Based on your result in part (b), what can you expect to happen to someone’s body fat as he/sheages by one year?

e. Construct and interpret a 95% confidence interval for the slope, b.

STAT 145 - Elementary Statistics More Regression

• The response variable Y is linearly related to one explanatory variable X. That is,

yi = (a+ bxi) + εi. i = 1, 2, . . . , n.

Assumptions:

1. The mean of εi is 0 and the variance of εi is σ2.

2. The random errors εi are uncorrelated.

• Equation of the Least-Squares Regression Line . Suppose we have data on an explanatory variable xand a response variable y for n individuals. The means and standard deviations of the sample data are x and sxfor x and y and sy for y, and the correlation between x and y is r. The equation of the least-squares regressionline of y on x is

y = a+ bx, with slope, b =SSxySSxx

= rsysx, and intercept , a = y − bx.

• The fitted (or predicted) values yi’s are obtained by successively substituting the xi’s into the estimated

regression line: y = a+ bxi. The residuals are the vertical deviations, ei = yi − yi, from the estimated line.

• The error sum of squares, (equivalently, residual sum of squares) denoted by SSE, is

SSE =∑

e2i =∑

(yi − yi)2 = SSyy − bSSxy

and the estimate of σ2 is

σ2 =SSE

n− 2=

(n− 1)s2y(1− r2)

n− 2. (1)

• The coefficient of determination, denoted by r2, is the amount of the variation in y that is explained bythe regression line.

r2 = 1− SSE

SST, where, SST = SSyy =

∑(yi − y)2 (2)

=SST − SSE

SST=

explained variation

total variation(3)

• Mean Response of Y at a specified value x∗, (µY |x∗).

1. Point Estimate. For a specific value x∗, the estimate of the mean value of Y is given by

µY |x∗ = a+ bx∗

2. Confidence Interval. For a specific value x∗, the (1− α)100% confidence interval for µY |x∗ is given by

µY |x∗ ± tα/2;(n−2)SEµ where, SEµ =

√MSE

(1

n+

(x∗ − x)2

(n− 1)s2x

)

• Prediction of Y at a specified value x∗.

1. Point Estimate. For a specific value x∗, the predicted value of Y is given by

y = a+ bx∗

2. Prediction Interval. For a specific value x∗, the (1− α)100% prediction interval is given by

y ± tα/2;(n−2)SEy where, SEy =

√MSE

(1 +

1

n+

(x∗ − x)2

(n− 1)s2x

)

• Blood Pressure Measurements. To see if there is a linear relationship between the Systolic and Diastolicblood pressure of a person, the following measurements from 14 randomly selected individuals were recorded.

Person 1 2 3 4 5 6 7Systolic (x) 138 130 135 140 120 125 120Diastolic (y) 82 91 100 100 80 90 80

Person 8 9 10 11 12 13 14Systolic (x) 130 130 144 143 140 130 150Diastolic (y) 80 80 98 105 85 70 100

1. Determine the correlation coefficient r.

2. What can you say about the linear relationship of x and y? Is it a strong linear relationship.

3. Determine the coefficient of determination r2. Explain the meaning of this quantity in this context.

4. Determine the regression line.

5. Find the residual of the first person and determine if this residual is an outlier using the estimate of σ.

6. Find an estimate to the expected diastolic blood pressure (µy) for people with a systolic reading of 122.

7. Construct a 95% confidence interval for µy for people with a systolic reading of 122.

8. Construct a 95% prediction interval for y for a person with a systolic reading of 122.

• Homework Problem : Consider the following data of 10 production runs of a certain manufacturing company.

Production run 1 2 3 4 5 6 7 8 9 10Lot size (x) 30 20 60 80 40 50 60 30 70 60

Man-Hours (y) 73 50 128 170 87 108 135 69 148 132

1. Determine the correlation coefficient r.

2. What can you say about the linear relationship of x and y? Is it a strong linear relationship.

3. Determine the coefficient of determination r2. Explain the meaning of this quantity in this context.

4. Determine the regression line.

5. Using α = 0.01, test H0 : b = 0 vs. H1 : b 6= 0

6. Construct and interpret a 99% confidence interval for b.

7. Find an estimate for the mean number of man-hours (µY |x∗) required to produce a lot size 100.

8. Construct a 95% confidence interval for the mean number of man-hours (µY |x∗) required to produce alot size 100.