A full year of introductory college statistics: describing data, designing studies, probability, and the inference procedures for proportions, means and regression, taught unit by unit to the College Board course framework, one lesson for each required topic (closely related topics share a lesson). Every lesson quotes the required content, works examples with the numbers checked, shows the TI-84 route next to the by-hand one, and adds figures where a picture makes an idea clear. Work through the lessons at your own pace, and book a tutor the moment a topic doesn't click. A graphing calculator is expected on the entire exam, so practice with yours from the first lesson.
3H EXAM42 MCQ4 FRQ51 LESSONS50 PRACTICE PROBLEMSPREREQ: ALGEBRA II
What this course covers, and how the exam weights it.
AP Statistics follows the five units of the College Board course framework, in 51 lessons. The exam has 42 multiple-choice questions and 4 free-response questions, each section worth half of the score, and the four free-response questions are worth 12.5 percent each, and one of them is always an inference question. Each unit below shows its share of the multiple-choice section, so you can see where to spend your time: Unit 1 is the largest, and the two inference units (3 and 4) together are roughly a third.
U1Exploring One-Variable Data and Collecting Data20–30%
U2Probability, Random Variables, and Probability Distributions15–25%
U3Inference for Categorical Data: Proportions15–25%
U4Inference for Quantitative Data: Means10–20%
U5Regression Analysis10–20%
All five units are open, 51 topics in all. Every topic opens with the method, worked examples, and a set of practice problems. Every problem has a full worked solution, so you can find the step where yours went wrong. Each unit closes with a ten-problem mixed review.
Free preview: all of Unit 1, its lessons and its review set,
is open to everyone with no account. Past that, a few more lessons open
for free, and a free account can start a free month of this course: no
card, every lesson and practice set open for 30 days. Grading of
written work and teacher review come with a paid plan.
Statistics is the science of learning from data. A statistical study starts with a question about a large group, collects information from a small part of that group, and uses what it finds to answer the question. Before you can graph, summarize or test anything, you have to know what the study is about: who or what is being studied, what is being measured, and what the answer is supposed to tell you. This first lesson gives you the vocabulary for those parts and the habit of connecting every number back to the real situation it came from.
Required content · 1.1.A, 1.1.B
Learning objectives.
1.1.A. Identify components within a statistical study.
1.1.B. Determine an investigative question within a statistical study.
Essential knowledge.
1.1.A.1. A statistical study is a study in which data are collected from a sample to answer an investigative question about a larger population.
1.1.A.2. Statistical studies are necessary when the population is too large or it is too difficult to collect data from every item or individual in the population.
1.1.A.3. A datum (singular form of data) is a piece of information about an item or individual. A collection of data is called a data set.
1.1.A.4. A population consists of all items or individuals of interest. The population size is represented by the symbol N.
1.1.A.5. A sample selected for study is a subset of the population from which data are obtained. The number of items in the sample, called the sample size, is represented by the symbol n.
1.1.A.6. Each component of a statistical study and the resulting calculations can be related to an aspect of the corresponding real-world context from which the components were derived. This identification of a statistical result with the corresponding contextual component is what is meant by “in context.”
1.1.B.1. An investigative question for a specific study should have a defined purpose and should not be changed based on the data analysis or results.
1.1.B.2. An investigative question should be posed so that the required data can be collected and analyzed.
The parts of a statistical study
A statistical study collects data from a sample to answer an investigative question about a larger population. Each part has a name and a symbol.
A datum (the singular of data) is one piece of information about one item or individual. A collection of data is a data set.
The population is all the items or individuals of interest. Its size is written \(N\).
The sample is the subset of the population from which data are actually obtained. Its size, the sample size, is written \(n\).
Figure 1.1. A statistical study draws a sample from a population (green dots) and uses a statistic computed from the sample to learn about a parameter of the whole population.
Notice what the arrows in Figure 1.1 mean. A sample is drawn from the population, and the information in the sample is used to say something about the population. The sample is almost never the whole story, so a statistic computed from a sample usually differs a little from the population value it estimates. Learning how much it can differ, and what to conclude anyway, is what most of this course is about.
Why we sample
You would not need statistics if you could measure everyone. A statistical study is necessary when the population is too large, or when it is too difficult to collect data from every item or individual in it.
Too large. Asking every teenager in a country about their daily screen time is not realistic.
Too difficult or destructive. A battery maker who wants to know how long its batteries last cannot run all of them until they die; nothing would be left to sell.
Too slow or expensive. A hospital that wants this year's average waiting time cannot wait until every patient has been seen to decide whether to change a policy.
In each case a well-chosen sample lets us answer the question with far less effort, provided we are honest about the uncertainty.
"In context" means attaching every number to the real situation
The most common way to lose points on an AP Statistics free-response question is to answer correctly but without context. Each component of a study, and every calculation made from it, can be tied to an aspect of the real-world situation it came from. Doing that is what the exam means by in context. Compare:
Statement
Not in context
In context
A mean
"The mean is 7.1."
"The 400 sampled students slept an average of 7.1 hours on school nights."
The population
"All of them."
"All 6,200 high school students in the district."
A proportion
"The proportion is 0.35."
"About 35% of the sampled shoppers said they prefer the store brand."
A good in-context sentence names the variable, the group it describes and the units.
Worked example · Identifying the components
A school district has 6,200 high school students. The district wants to know how many hours the typical student sleeps on a school night. It randomly selects 400 students and asks each of them how many hours they slept last night. Identify the population, the sample, \(N\) and \(n\), and describe the data.
Population: all high school students in the district, so \(N=6{,}200\). Sample: the 400 students selected, so \(n=400\). Data: each of the 400 students supplies one datum, the number of hours slept, so the data set contains 400 values measured in hours.
Suppose the sample mean is 7.1 hours. In context: "The 400 students in the sample slept an average of 7.1 hours last night." It would be a mistake to write "Students sleep 7.1 hours," because that claims the sample result is exactly true for all 6,200 students, and the sample alone cannot show that.
Worked example · Sample and population on the AP exam
A library lets patrons borrow videos either in person or through an online system. A librarian randomly selects patrons who borrow videos and asks how they feel about the two methods. What are the sample and the population?
The sample is the patrons the librarian selected. The population is every patron who borrows videos from this library, because that is the group the librarian wants to learn about. It is not "all patrons of the library," because someone who never borrows a video has no opinion about the two borrowing methods, and it is not only the in-person borrowers or only the online borrowers, because the question concerns both methods. Describing the population precisely is half of identifying it.
The investigative question
Every statistical study is organized around an investigative question. It must meet two requirements.
It should have a defined purpose and should not be changed based on the data analysis or results. Deciding what you are asking after you have looked at the data lets you hunt through the numbers until something looks interesting, which makes the conclusion unreliable.
It should be posed so that the required data can be collected and analyzed. A question that cannot be answered with measurable data is not a statistical question.
Worked example · Judging investigative questions
A student council wants to study the new late start time. Decide whether each question is a good investigative question for a statistical study, and fix any that are not.
(a) "Is the late start better?"
(b) "Is the mean number of hours of sleep per school night of students at our school greater than 7?"
(c) "The mean sleep turned out to be 7.4 hours, so was our question really about lunch periods?"
(a) is too vague: "better" is not defined, so it is unclear what to measure. A fix is to name a variable and a parameter, as in (b). (b) is a good question: the variable (hours of sleep per school night), the population (students at this school) and the parameter (the mean) are clear, and the data can be collected with a survey. (c) changes the question after seeing the results, which defeats its purpose. The purpose of the study should be set before the data are collected and kept through the analysis.
Worked example · Why a statistical study is needed
A researcher wants to know the average daily screen time of teenagers 13 to 17 years old in a large country. Explain why a statistical study is appropriate.
The population is all teenagers in that age range in the country. Surveying every one of them would be far too difficult, so the researcher collects data from a sample and uses the sample to learn about the population. The reason a statistical study is needed is that surveying every member of the population is not practical, not that statistics is "always required" and not that it guarantees everyone participates.
Exam focus
A statistical study collects data from a sample (size \(n\)) to answer an investigative question about a larger population (size \(N\)).
Studies are needed when the population is too large or too difficult to measure completely.
Always state the population precisely and answer in context: name the variable, the group and the units.
An investigative question has a defined purpose, is set before the analysis and cannot be changed after seeing the results, and must be answerable with data that can be collected and analyzed.
Practice
A city has 48,000 registered voters. A polling firm selects 1,200 of them and asks whom each one plans to vote for. Identify the population, the sample, \(N\) and \(n\).
Show answer
Population: the 48,000 registered voters in the city, so \(N=48{,}000\). Sample: the 1,200 voters selected, so \(n=1{,}200\).
A quality inspector tests how much weight each of 25 steel cables can hold before breaking, out of a shipment of 800 cables. Explain why the inspector samples instead of testing the whole shipment.
Show answer
Testing a cable to failure destroys it, so testing all 800 cables would leave nothing to use. Collecting data from every item in the population is too difficult (and wasteful), so a sample of 25 is tested and used to learn about the shipment.
A student writes: "The mean score was 82." Rewrite the sentence in context for a random sample of 60 students who took a chemistry exam.
Show answer
"The 60 students in the sample had a mean exam score of 82 points." (It names the group, the variable and the units; a sample mean describes the sample, not automatically all students.)
A researcher collects data on 300 randomly chosen teenagers, finds that average screen time is not far from 5 hours, and then decides the real question was how much time is spent on video games. Explain what is wrong with this approach.
Show answer
The investigative question was changed after looking at the data. The purpose of a study should be defined before data collection and not be altered because of the results; otherwise the analysis can be bent to find something that looks interesting.
Which is a better investigative question for a sample of recent graduates: "Are graduates doing well?" or "Is the mean starting salary of graduates of this college greater than \$50,000?" Explain.
Show answer
The second. It names the variable (starting salary), the parameter (the mean), the population (graduates of this college) and a direction, so the data can be collected and analyzed. "Doing well" is undefined and cannot be measured as stated.
In a study of 150 randomly selected apartments in a city of 90,000 apartments, the mean monthly rent is \$1,640. Write one sentence interpreting this number in context without claiming it is the exact value for all apartments.
Show answer
"The 150 sampled apartments had a mean monthly rent of \$1,640, which we can use as an estimate of the mean monthly rent for all 90,000 apartments in the city."
Variables: observational units, parameters and statistics
Behind every statistical analysis is a table of data, even if no one ever draws it. Each row describes one thing that was observed, and each column records one characteristic of those things. Before choosing a graph or a summary number you must decide what the rows are, what the columns are, and what kind of column each one is: an average of zip codes is meaningless, while an average of heights is not. This lesson names those pieces so you can spot them in any study.
Required content · 1.2.A, 1.2.B, 1.2.C
Learning objectives.
1.2.A. Identify observational units, variables, parameters, and statistics from a statistical study or data set.
1.2.B. Identify types of variables.
1.2.C. Identify types of quantitative variables.
Essential knowledge.
1.2.A.1. An observational unit is an item or individual from which a datum is collected.
1.2.A.2. A variable is a characteristic that may change from one observational unit to another.
1.2.A.3. Data collected on numerical and categorical variables measured on observational units, including photographs, sounds, videos, and text, can convey meaningful information.
1.2.A.4. A parameter is a numerical attribute or summary of the variable of interest for a population.
1.2.A.5. A statistic is a numerical attribute or summary of the variable of interest for a sample. The value of a statistic from a certain sample is often not equal to the unknown value of the population parameter but may provide the basis for making inferences about the population parameter.
1.2.B.1. A categorical variable, also called a qualitative variable, takes on values that are category names or group labels.
1.2.B.2. A quantitative variable, also called a numerical variable, takes on numerical values for a measured or counted quantity and generally has units of measure.
1.2.C.1. A discrete quantitative variable can take on a countable number of values. The number of values may be finite or countably infinite, as with the whole numbers.
1.2.C.2. A continuous quantitative variable can take on an infinite number of possible values within a given interval. The number of values the variable can take on is measurable but not countable. This variable can take on all possible values between any pair of values.
Observational units and variables
An observational unit is an item or individual from which a datum is collected: a person, a turtle, a house, a flight, a tweet. A variable is a characteristic that may change from one observational unit to another. The word variable matters because if every unit had the same value there would be nothing to study.
Here is a small data set from a sea turtle project. The observational units are the turtles (one per row) and there are four variables besides the tag number.
Tag
Species
Shell length (cm)
Eggs laid this season
Nesting beach
T01
Green
98.4
3
North
T02
Loggerhead
91.2
2
South
T03
Green
104.7
4
North
T04
Olive ridley
67.5
1
East
T05
Green
101.3
3
South
Figure 1.2. Every variable is categorical or quantitative; a quantitative variable is discrete (a countable list of values) or continuous (every value in an interval).
Variables are not always numbers recorded in a spreadsheet. Photographs, sounds, videos and text can all be turned into data, because each can be summarized with numerical or categorical variables. A wildlife camera takes a photo (the observational unit) that researchers label by the species it shows (categorical) and the number of animals in it (quantitative). A collection of customer reviews can be summarized by each review's word count (quantitative) and whether the tone is positive, neutral or negative (categorical).
Categorical and quantitative variables
A categorical variable (also called a qualitative variable) takes on values that are category names or group labels. A quantitative variable (also called a numerical variable) takes on numerical values for a measured or counted quantity and generally has units of measure.
The test is whether arithmetic on the values means anything. The mean of the shell lengths is a meaningful number of centimeters; the "mean" of the beach names is not. Be careful with numbers that act as labels: a tag number, a zip code, a jersey number or a student ID is a categorical variable even though it is written with digits, because adding or averaging such numbers tells you nothing. A grade level (9, 10, 11, 12) in a survey of students is usually treated as a category for the same reason.
Discrete and continuous quantitative variables
A quantitative variable is one of two kinds.
A discrete quantitative variable takes a countable number of values. The list may be finite (0, 1, 2, 3 eggs) or go on forever (0, 1, 2, 3, ...), but you could in principle count through the values one by one. Counts are the typical case: eggs laid, siblings, text messages sent.
A continuous quantitative variable can take every value in an interval. The values are measured, not counted, and between any two possible values there is another one. Shell length, time, weight and temperature are continuous: a turtle's shell could be 98.4 cm or 98.41 cm or 98.413 cm. In practice we round measurements, but the variable itself is still continuous.
Parameters and statistics
Two other words describe the numbers a study produces.
A parameter is a numerical attribute or summary of the variable of interest for a population. Its value is a single fixed number, but it is usually unknown.
A statistic is a numerical attribute or summary of the variable of interest for a sample. Its value can be calculated, and it changes from sample to sample.
The value of a statistic from one sample is often not equal to the unknown value of the population parameter. It may still provide the basis for making inferences about that parameter, and the whole second half of the course is the careful theory of how to do that.
Worked example · Identifying units, variables and their types
Using the turtle table above, identify the observational unit and classify each variable.
The observational unit is a single sea turtle. Tag is categorical (an identifier). Species is categorical. Shell length is quantitative and continuous (measured in centimeters). Eggs laid this season is quantitative and discrete (a count: 0, 1, 2, ...). Nesting beach is categorical.
A quick check on the two numerical-looking columns: the mean shell length of the five turtles is \((98.4+91.2+104.7+67.5+101.3)/5=92.62\) cm, a meaningful number, so shell length is quantitative. Averaging tag numbers would have no meaning, so tag is categorical.
Worked example · Parameter or statistic?
A polling organization contacts 1,000 randomly selected U.S. adults. In the sample, 58% say they support a proposed park fee. The organization wants to learn about the proportion of all U.S. adults who support the fee. Identify the variable, the parameter and the statistic.
The variable is whether an adult supports the fee (categorical, with two possible values). The parameter is the proportion of all U.S. adults who support the fee. It is a fixed number that no one knows. The statistic is the sample proportion, 0.58, computed from the 1,000 adults who were contacted. Another random sample of 1,000 adults would almost certainly give a different statistic, such as 0.55 or 0.61, while the parameter would not change. The statistic 0.58 is our best single estimate of the parameter, but we should not claim that exactly 58% of all adults support the fee.
Worked example · Classifying tricky variables
Classify each variable as categorical, discrete quantitative or continuous quantitative: (a) a student's zip code; (b) the number of text messages a student sent yesterday; (c) the time, in seconds, a student takes to run 400 meters; (d) a runner's bib number; (e) the star rating (1 to 5 stars) a customer gives a product.
(a) Categorical: a zip code is a label, and the mean of zip codes means nothing. (b) Discrete quantitative: it is a count with possible values 0, 1, 2, .... (c) Continuous quantitative: time can take any value in an interval, such as 68.42 seconds. (d) Categorical: a bib number identifies a runner and has no numerical meaning. (e) Star rating is a judgment placed on a scale of 1 to 5; it is often treated as a category (ordered), and calling it quantitative is justified only when averaging the ratings is meaningful for the question being asked. On the exam, state the reason you give: a variable is quantitative if its values are measured or counted amounts for which arithmetic makes sense.
Exam focus
An observational unit is the individual from which a datum is collected; a variable is a characteristic that changes from unit to unit.
Categorical: values are labels (including identifiers such as zip codes and ID numbers). Quantitative: measured or counted numbers with units; discrete if countable, continuous if any value in an interval.
A parameter describes a population (fixed, usually unknown); a statistic describes a sample (known, varies from sample to sample).
When asked to classify a variable, give the type and a reason in context.
Practice
A fitness study records, for each of 40 volunteers, the age in years, the type of exercise they chose (run, bike or swim), the number of workouts completed last week, and the minutes needed to run 2 kilometers. Identify the observational unit and classify each variable.
Show answer
The observational unit is a volunteer. Age: quantitative (continuous, since it is a measured time since birth). Type of exercise: categorical. Number of workouts: quantitative and discrete (a count). Minutes to run 2 km: quantitative and continuous.
A researcher counts the number of birds in each of 300 photographs taken by trail cameras. Identify the observational unit and the variable, and classify it.
Show answer
The observational unit is a photograph. The variable is the number of birds in the photograph, which is quantitative and discrete (a count).
A teacher says a student's identification number is a quantitative variable because it is a number. Explain why this is incorrect.
Show answer
An ID number labels each student. It does not measure or count anything, and arithmetic on ID numbers (such as finding their mean) has no meaning, so it is a categorical variable.
In a random sample of 500 voters in a state, 46% support a ballot measure. Identify the parameter and the statistic in context.
Show answer
Parameter: the proportion of all voters in the state who support the measure (a fixed but unknown number). Statistic: the sample proportion, 0.46, computed from the 500 sampled voters.
A different random sample of 500 voters from the same state supports the measure at a rate of 49%. Does this mean the first sample was wrong? Explain using the words parameter and statistic.
Show answer
No. The two samples give two values of the statistic (0.46 and 0.49). Statistics vary from sample to sample, while the parameter, the true proportion for all voters, does not change. Neither value is expected to equal the parameter exactly, but each is an estimate of it.
Customer service messages are collected, and for each message a worker records whether the tone is positive, neutral or negative, and the number of words. Which variable is categorical and which is quantitative?
Show answer
The tone is categorical (labels). The number of words is quantitative (a discrete count).
When the variable is categorical, there are no averages to find. The question is how many observations fall in each category, and what share of the whole that is. This lesson shows how to organize one categorical variable in a table, draw it as a bar chart or a pie chart, and use the table or graph to support claims in context. It ends with the case the exam likes best: comparing two groups that have different sizes.
1.4.B. Justify a claim using categorical one-variable graphical representations.
1.4.C. Compare multiple categorical one-variable tabular and graphical representations.
Essential knowledge.
1.3.A.1. A frequency table shows the number of observational units in each category of a categorical variable.
1.3.A.2. A relative frequency table shows the proportion of observational units in each category of a categorical variable.
1.3.B.1. Percentages, relative frequencies, and ratios all provide the same information as proportions.
1.3.B.2. Counts and relative frequencies of categorical variables reveal information that can be used to justify claims about the variables in context.
1.4.A.1. Bar charts, also called bar graphs, display frequencies (counts) or relative frequencies (proportions) for the categories of a single categorical variable. Each bar on a bar chart represents a category of the categorical variable of interest. The height or length of each bar corresponds to the frequency or relative frequency of the observational units in each category.
1.4.A.2. Pie charts are used to display frequencies (counts) or relative frequencies (proportions) for categorical data. Each slice on a pie chart represents a category of the categorical variable of interest. The area of each slice, as a fraction of the total area, corresponds to the relative frequency of observational units falling within each category. The sum of the slices’ areas together will equal 1, or 100% of the total area.
1.4.B.1. Graphical representations of a categorical variable reveal information that can be used to justify claims about the variable in context.
1.4.C.1. Frequency and relative frequency tables, bar charts, and pie charts can be used to compare two or more data sets in terms of the same categorical variable.
Frequency tables and relative frequency tables
A frequency table shows the number of observational units in each category of a categorical variable. A relative frequency table shows the proportion of observational units in each category: the count divided by the total number of observational units. The relative frequencies of all categories add up to 1 (or 100%, or very close to it if you round).
\[\text{relative frequency of a category}=\frac{\text{count in that category}}{\text{total count}}\]
Percentages, relative frequencies, and ratios all provide the same information as proportions. A proportion of 0.35, a percentage of 35%, and a ratio of 7 to 20 (35 out of every 100 is 7 out of every 20) say the same thing, and so does a statement comparing categories, such as "pizza was chosen \(28/20=1.4\) times as often as burritos."
Figure 1.3. A bar chart of the frequency table: the height of each bar is the count in that category (80 juniors in all). The bars do not touch, because the categories have no numerical order.
Tables and graphs are used to justify claims about the variable in context. A claim such as "pizza is the favorite lunch of juniors" must be supported by the numbers that show it ("28 of the 80 juniors, or 35%, chose pizza, more than any other lunch"), and the claim should name the group and the variable.
Bar charts
A bar chart (or bar graph) displays the frequency (counts) or the relative frequency (proportions) for each category of a single categorical variable. Each bar stands for one category, and the height (or length) of the bar corresponds to the frequency or relative frequency of the observational units in that category. Some guidelines that make bar charts honest:
Label both axes and give the chart a title that names the variable and the group.
Start the frequency axis at 0. A bar's height is the data, so cutting off the bottom of the axis makes small differences look large.
Leave gaps between the bars, since the categories are not points on a number line. Putting the categories in order of height, when they have no natural order, makes the chart easier to read.
Pie charts
A pie chart also displays frequencies or relative frequencies for one categorical variable. Each slice stands for a category, and the area of each slice, as a fraction of the total area, corresponds to the relative frequency of observational units in that category. The slices together make up the whole circle, which is 1, or 100%. A slice with relative frequency \(0.35\) takes up \(0.35\times360^\circ=126^\circ\) of the circle.
Figure 1.4. The same data as a pie chart: each slice's share of the circle equals the category's relative frequency, and the slices together make up 100%.
A pie chart is only appropriate when the categories together make up a whole (every unit falls in exactly one category). It is good for seeing which category is biggest or for comparing one slice with half or a quarter of the circle, but small differences between similar slices are hard to see. A bar chart is almost always better for comparing categories.
Worked example · Building the tables
Twenty-five students were asked how they get to school. The responses were: Bus, Car, Walk, Bus, Bike, Car, Bus, Walk, Car, Bus, Bus, Car, Walk, Bike, Car, Bus, Walk, Car, Bus, Bike, Car, Walk, Bus, Car, Bus. Make a frequency table and a relative frequency table, and write a claim supported by the data.
Tally each category: Bus 9, Car 8, Walk 5, Bike 3 (the total is \(9+8+5+3=25\)). Each relative frequency is the count divided by 25.
Transportation
Frequency
Relative frequency
Percent
Bus
9
\(9/25=0.36\)
36%
Car
8
\(8/25=0.32\)
32%
Walk
5
\(5/25=0.20\)
20%
Bike
3
\(3/25=0.12\)
12%
Total
25
1.00
100%
Claim, in context: "Riding the bus is the most common way these 25 students get to school (9 of 25, or 36%), and together the bus and the car account for 68% of the students." The claim names the group and the variable and cites the numbers that justify it.
Worked example · Drawing and reading the graphs
A school surveyed 80 juniors about their favorite school lunch: pizza 28, burrito 20, salad 12, sandwich 14, other 6. Find the relative frequencies and the pie-chart angles.
The relative frequencies are \(28/80=0.35\), \(20/80=0.25\), \(12/80=0.15\), \(14/80=0.175\) and \(6/80=0.075\), which add to 1. The pie-chart angles are \(0.35(360^\circ)=126^\circ\), \(90^\circ\), \(54^\circ\), \(63^\circ\) and \(27^\circ\), which add to \(360^\circ\). The bar chart above uses the counts as heights, and the pie chart uses these angles. A claim the graphs support: "Pizza and burritos together are the favorite of \(48/80=60\%\) of the juniors surveyed."
Comparing categorical data for two or more groups
Frequency and relative frequency tables, bar charts and pie charts can all be used to compare two or more data sets in terms of the same categorical variable. The key rule is to compare relative frequencies, not counts, whenever the groups have different sizes. Counts depend on how many students were asked as well as on how popular each lunch is.
Figure 1.5. Two groups of different sizes are compared with relative frequencies (proportions), not counts, so the bars are on the same scale.
Worked example · Same variable, two groups of different sizes
The same lunch question was asked of 60 seniors. Their counts: pizza 18, burrito 21, salad 6, sandwich 9, other 6. Compare the lunch preferences of juniors (80 students) and seniors (60 students).
The relative frequencies for seniors are \(18/60=0.30\), \(21/60=0.35\), \(6/60=0.10\), \(9/60=0.15\) and \(6/60=0.10\) (they sum to 1).
Lunch
Juniors (n = 80)
Seniors (n = 60)
Pizza
0.350
0.300
Burrito
0.250
0.350
Salad
0.150
0.100
Sandwich
0.175
0.150
Other
0.075
0.100
A comparison that uses counts would say that more juniors than seniors chose pizza (28 compared with 18) and a nearly equal number chose burritos (20 and 21), but those counts mislead because there are 20 more juniors. Using relative frequencies: pizza is the favorite of juniors (35%) and burrito is the favorite of seniors (35%). A higher share of seniors than juniors prefer burritos (35% compared with 25%), and a smaller share of seniors prefer pizza (30% compared with 35%). In every sentence we named both groups and used a comparison word, as the exam expects.
Worked example · A misleading chart
A bar chart shows the number of customers who chose Plan A (48) and Plan B (52), but the vertical axis starts at 45. The Plan B bar looks more than twice as tall as the Plan A bar. Is the chart fair?
No. With the axis starting at 45 the visible heights are 3 and 7, a ratio of 7 to 3, while the counts differ by only \(52-48=4\) out of 100 customers. The bar heights represent the counts, so the axis must start at 0. Drawn correctly the two bars look nearly equal, which is what the data say.
Exam focus
A frequency table gives counts; a relative frequency table gives proportions (count divided by the total). Percentages, relative frequencies, ratios and proportions carry the same information.
A bar chart has one bar per category, height = count or relative frequency, axis starting at 0. A pie chart has one slice per category, area (angle) proportional to relative frequency, slices summing to 100%.
To justify a claim, cite the counts or relative frequencies and name the group and variable.
To compare groups of different sizes, compare relative frequencies, and write comparison sentences that name both groups.
Practice
Of 40 customers, 14 ordered a latte, 11 drip coffee, 6 espresso, and 9 tea. Make a relative frequency table and state which drink is the most popular, with evidence.
Show answer
Relative frequencies: latte \(14/40=0.35\), drip \(11/40=0.275\), espresso \(6/40=0.15\), tea \(9/40=0.225\) (total 1.00). The latte is the most popular: 35% of the 40 customers ordered one, more than any other drink.
In a survey of 200 people, 90 own a dog, 70 a cat, 10 a bird, 20 fish, and 10 another kind of pet. In a pie chart, what is the central angle for dogs and for cats?
Show answer
Dogs: \(90/200=0.45\), so \(0.45(360^\circ)=162^\circ\). Cats: \(70/200=0.35\), so \(126^\circ\). (Bird \(18^\circ\), fish \(36^\circ\), other \(18^\circ\); the five angles total \(360^\circ\).)
Of 60 students surveyed, 15 said they would like a later start time. Write this result as a proportion, a percentage, and a ratio of "yes" to "no".
Show answer
Proportion \(15/60=0.25\); percentage 25%; 45 said no, so the ratio of yes to no is \(15:45=1:3\).
In section 1, 24 of 40 students prefer morning classes. In section 2, 50 of 100 students prefer morning classes. A student says "more students in section 2 prefer mornings, so mornings are more popular in section 2." Evaluate this claim.
Show answer
The claim compares counts, but the sections have different sizes. In section 1, \(24/40=60\%\) prefer mornings; in section 2, \(50/100=50\%\). A larger share of section 1 prefers mornings, even though section 2 has more students who do.
A bar chart shows two bars labeled 48 and 52 on an axis that begins at 45. Explain why this can mislead a reader and what should be changed.
Show answer
The bar heights should be proportional to the counts, but starting the axis at 45 makes the second bar look more than twice as tall as the first (7 against 3 units) even though the counts differ by about 8%. The axis should start at 0.
A pie chart of how 120 students get to school has a slice for "bus" with a central angle of \(135^\circ\). How many students ride the bus?
Show answer
The slice is \(135/360=0.375\) of the circle, so \(0.375(120)=45\) students ride the bus.
A quantitative variable gives you a whole range of numbers, and the first thing to do with them is look. A graph shows where the values pile up, how far they stretch, and whether anything unusual is going on, all of which a single summary number can hide. This lesson builds the three standard graphs for one quantitative variable: the dotplot, the stem-and-leaf plot and the histogram. The next lesson teaches you how to describe what they show.
Throughout the lesson we use one data set: the commute times, in minutes, of 30 students at a school.
1.5.A.1. Histograms, stem-and-leaf plots, and dotplots provide a visual representation of the distribution of the values of a quantitative variable. These graphs show the frequency or relative frequency of the quantitative variable values or intervals of values and maintain the natural ordering, smallest to largest, of the quantitative variable.
1.5.A.2. A histogram places the observed values of the quantitative variable into ordered intervals, or bins, along the horizontal axis. Each bar represents an interval or bin, and the height of each bar shows the frequency or relative frequency of the observations within that interval. Altering the interval widths, or bin widths, can change the appearance of the histogram. Alternatively, a histogram can be constructed with bins on the vertical axis with bars appearing horizontally.
1.5.A.3. A stem-and-leaf plot splits each value of the quantitative variable into two parts: a “stem” (the first digit or digits) and a “leaf” (usually the single digit after the stem digit or digits). Both stems and leaves are ordered from smallest to largest.
1.5.A.4. A dotplot represents each value of the quantitative variable by a dot. Each dot is placed above the horizontal or beside the vertical axis corresponding to the value of that observation, with nearly identical values stacked on top of each other.
What the three graphs have in common
Histograms, stem-and-leaf plots and dotplots give a visual representation of the distribution of the values of a quantitative variable: which values occur and how often. They show the frequency or relative frequency of the values (or of intervals of values), and they maintain the natural ordering, smallest to largest, of the variable. That is what separates them from a bar chart, whose categories have no order.
Dotplots
A dotplot represents each value of the quantitative variable by a dot. Each dot is placed above the horizontal axis (or beside the vertical axis) at the value of that observation, and nearly identical values are stacked on top of each other. Dotplots are quick to make by hand and show every individual value, which makes them best for small and moderate data sets.
Figure 1.6. Each dot is one student's commute time; equal values stack. The distribution is concentrated between 10 and 30 minutes with a long tail of slower commutes.
In Figure 1.6 the stack of three dots at 15 minutes means three students commute 15 minutes. The distribution is concentrated between about 10 and 30 minutes and has a long tail of longer commutes, with the single dot at 90 well away from the rest.
Stem-and-leaf plots
A stem-and-leaf plot splits each value into two parts: a stem (the first digit or digits) and a leaf (usually the single digit after the stem digits). Both the stems and the leaves are listed in order from smallest to largest, and a key explains how to read them.
Figure 1.7. A stem-and-leaf plot keeps every value. The stem is the tens digit, the leaf is the ones digit, and both are in increasing order. Turned sideways it looks like the histogram of the same data.
The row "2 | 0 0 2 2 5 5 6 8" stands for the eight commute times 20, 20, 22, 22, 25, 25, 26 and 28. Turn the page sideways and the leaves form a histogram, but unlike a histogram the plot keeps every individual value. A stem-and-leaf plot needs a key, and a stem that has no leaves (stems 7 and 8 above) must still be listed so the gap is visible. For data with two digits plus a decimal, such as 6.4 or 6.9, use the whole number as the stem and the decimal as the leaf. When too many values share one stem, you can split each stem into two lines (leaves 0 to 4 and leaves 5 to 9).
Histograms
A histogram places the observed values into ordered intervals, or bins, along the horizontal axis. Each bar represents one bin, and the height of each bar shows the frequency or relative frequency of the observations in that bin. Because the variable is numerical, the bars touch, unlike a bar chart.
Figure 1.8. A histogram with bins of width 10 starting at 0 (each bin includes its left endpoint). The tallest bar, 11 students, is the 10 to under 20 minute bin.
A convention to know: each bin includes its left endpoint and excludes its right endpoint, so a commute of exactly 20 minutes is counted in the bin from 20 up to (but not including) 30. In Figure 1.8 the bins are 10 minutes wide and the counts are 2, 11, 8, 4, 2, 1, 1, 0, 0 and 1 (these add to 30). A histogram can also be drawn with the bins on the vertical axis and horizontal bars. If the bars show relative frequencies instead of counts, the shape is identical and only the vertical scale changes.
Bin width changes the picture
Altering the interval widths, or bin widths, can change the appearance of a histogram. Look at the same 30 values with bins 5 minutes wide and with bins 20 minutes wide.
Figure 1.9. The same 30 commute times with narrow bins (width 5, top) and wide bins (width 20, bottom). Narrow bins show more detail but look ragged; wide bins smooth out the shape and can hide features.
Narrow bins show detail but can look ragged, with small gaps and bumps that are only chance. Wide bins smooth the picture but can hide features: with bins 20 wide, the isolated 90-minute commute is merged into a bar that also holds 60. There is no single correct bin width. Choose one that is wide enough that the shape is not jagged and narrow enough that clusters and gaps still show, and be careful about reading too much into small features.
TI-84: dotplot-like view and histogram
Press STAT, choose 1:Edit and type the 30 values in list L1. Press 2nd and Y= (STAT PLOT), choose Plot1, turn it On, set Type to the histogram icon (third icon in the top row) with Xlist L1 and Freq 1. Press WINDOW and set Xmin = 0, Xmax = 100, Xscl = 10: Xmin is where the first bin starts and Xscl is the bin width. Press GRAPH. Use TRACE to read each bar's bin and count, and change Xscl to see how bin width affects the picture. ZoomStat picks a window automatically but its bins may not start at a convenient number.
Which graph to use
Graph
Best for
Keeps individual values?
Dotplot
Small or moderate data sets; seeing gaps, clusters, outliers
Yes (to the precision of the axis)
Stem-and-leaf
Small data sets (up to about 50 values)
Yes, exactly
Histogram
Any size, especially large data sets
No, only counts in each bin
Worked example · Making a stem-and-leaf plot
Sixteen students' scores on a quiz were 52, 67, 71, 58, 63, 49, 75, 66, 61, 70, 55, 68, 74, 60, 64 and 62. Make a stem-and-leaf plot.
Put the data in order: 49, 52, 55, 58, 60, 61, 62, 63, 64, 66, 67, 68, 70, 71, 74, 75. Use the tens digit as the stem and the ones digit as the leaf.
Stem
Leaves
4
9
5
2 5 8
6
0 1 2 3 4 6 7 8
7
0 1 4 5
Key: \(6\mid3\) means a score of 63. The counts of leaves are \(1+3+8+4=16\), so every value is there. The plot shows that most scores are in the 60s and that the scores trail off a bit toward the lower end.
Worked example · From a frequency table to a histogram
Forty students were asked how many minutes they spent on homework one night. The counts in bins 0 to under 10, 10 to under 20, 20 to under 30, 30 to under 40 and 40 to under 50 minutes were 4, 12, 14, 8 and 2. Find the relative frequencies and draw the histogram described.
The relative frequencies are \(4/40=0.10\), \(12/40=0.30\), \(14/40=0.35\), \(8/40=0.20\) and \(2/40=0.05\) (the sum is 1). The histogram has five touching bars, each 10 minutes wide, with heights 4, 12, 14, 8, 2 for frequency (or 0.10, 0.30, 0.35, 0.20, 0.05 for relative frequency). The highest bar is the 20 to under 30 minute bin, and 35% of the students are in it.
Worked example · The effect of the bin width
In the commute data, how many students are in the bin from 10 up to 20 minutes with bins 10 wide? How does that compare with the bin from 0 up to 20 with bins 20 wide?
With width 10, the bin [10, 20) holds the values 10, 10, 12, 12, 14, 15, 15, 15, 16, 18 and 18, which is 11 students. With width 20, the bin [0, 20) holds those 11 values together with 5 and 8 (the two shorter commutes), which is 13 students. The shape of the picture changes with the bin width: the width-10 histogram has a clear peak in the 10 to 20 bin, while the width-20 histogram has two nearly equal bars (13 and 12) and no clear single peak.
Exam focus
Dotplots, stem-and-leaf plots and histograms show the distribution of one quantitative variable and keep the numerical order.
A histogram has touching bars over bins (left endpoint included), with height = frequency or relative frequency; changing the bin width can change the appearance.
A stem-and-leaf plot needs a key and ordered stems and leaves; list empty stems so gaps show.
Do not use a bar chart for a quantitative variable and do not leave gaps between histogram bars.
Practice
Make a stem-and-leaf plot for 23, 31, 27, 35, 22, 41, 29, 33, 28, 36, 25 and 30.
Show answer
Place the values 8, 10, 12, 19, 20, 21, 29, 30, 30 and 41 in bins of width 10 starting at 0 (each bin includes its left endpoint). How many values are in each bin?
Show answer
\([0,10)\): 8, so 1. \([10,20)\): 10, 12, 19, so 3. \([20,30)\): 20, 21, 29, so 3. \([30,40)\): 30, 30, so 2. \([40,50)\): 41, so 1. The total is \(1+3+3+2+1=10\).
A histogram of 30 values has bars with frequencies 4, 9, 12 and 5. Give the relative frequency for each bar.
Show answer
\(4/30\approx0.133\), \(9/30=0.300\), \(12/30=0.400\), \(5/30\approx0.167\), which add to 1 (up to rounding).
Why is a histogram's bar chart-like appearance not a reason to leave gaps between its bars?
Show answer
The horizontal axis of a histogram is a numerical scale divided into continuous intervals, so adjacent bins touch. A bar chart is for categorical data, whose categories are separate and unordered, so its bars are separated.
A researcher has the exact scores of 14 students and wants to show every score and keep their order. Which graph is best, a histogram or a stem-and-leaf plot, and why?
Show answer
The stem-and-leaf plot (or a dotplot): with only 14 values it shows each score exactly, while a histogram would show only how many fall in each interval.
One student draws a histogram of 400 test scores with bins 1 point wide and says it is too jagged to show a shape. Another uses bins 50 points wide and sees only two bars. What should each student change?
Show answer
The first student should use wider bins so random bumps are smoothed and the overall shape is visible. The second should use narrower bins so the features of the distribution (peaks, gaps, outliers) are not hidden. A middle bin width usually works best.
Describing the distribution of a quantitative variable
A graph is only useful if you can say what it shows. On the AP Statistics exam, "describe the distribution" is one of the most common tasks, and it is also one of the easiest to do incompletely. A complete description covers four things, every time: the shape of the distribution, its center, its variability (spread), and any unusual features such as outliers, gaps or clusters, all in the context of the problem, with units. This lesson defines the vocabulary and shows what a complete description sounds like.
Required content · 1.6.A, 1.6.B
Learning objectives.
1.6.A. Describe distributions of quantitative one-variable graphical representations.
1.6.B. Justify a claim using distributions of quantitative one-variable graphical representations.
Essential knowledge.
1.6.A.1. Descriptions of the distribution of one quantitative variable include shape, center, and variability (spread) as well as any unusual features such as outliers, gaps, or clusters in context.
1.6.A.2. The shape of the distribution of one quantitative variable is skewed to the right (positively skewed) if the right tail (toward larger values) is longer than the left. The shape of the distribution is skewed to the left (negatively skewed) if the left tail (toward smaller values) is longer than the right. The shape of the distribution is approximately symmetric if the left half is approximately the mirror image of the right half.
1.6.A.3. Distributions of one quantitative variable with one main peak are called unimodal. Distributions with two prominent peaks are called bimodal. A distribution in which each frequency or each relative frequency is approximately the same with no prominent peaks is approximately uniform.
1.6.A.4. Outliers for one quantitative variable are data points that are unusually small or large relative to the rest of the data.
1.6.A.5. A gap is a region in a distribution between two values in which there are no observed data.
1.6.A.6. Clusters are concentrations of values usually separated by gaps.
1.6.B.1. Graphical representations of a quantitative variable may reveal information that can be used to justify claims about the variable in context.
Shape
The shape of a distribution describes its overall form. Three ideas are used together.
Skewness. A distribution is skewed to the right (positively skewed) if the right tail, the part toward larger values, is longer than the left. It is skewed to the left (negatively skewed) if the left tail, toward smaller values, is longer than the right. It is approximately symmetric if the left half is approximately the mirror image of the right half. The name tells you where the tail is, not where the peak is: a right-skewed distribution has its peak on the left and a long tail trailing off to the right.
Peaks. A distribution with one main peak is unimodal. A distribution with two prominent peaks is bimodal. A distribution in which each frequency or relative frequency is about the same, with no prominent peaks, is approximately uniform.
Figure 1.10. Five common shapes. A distribution is skewed in the direction of its longer tail: skewed right means the right tail (toward larger values) is longer.
Skewness is common in real data. Incomes, house prices and waiting times are usually skewed right, because a few very large values stretch the right tail. Scores on an easy exam are often skewed left, because most students score near the top and a few score much lower. Bimodal distributions often signal that the data mix two different groups, such as the heights of a group containing both children and adults.
Center and variability
The center is a typical or middle value of the distribution, and the variability (or spread) is how widely the values range around it. At this stage you can estimate both from a graph: the center is roughly where the values balance or where about half lie on either side, and the spread can be described by the range from the smallest to the largest value or by how far the bulk of the data extends. The next lesson gives exact measures (the mean and median for center; the range, interquartile range and standard deviation for spread). Whatever the measure, write the center and spread with units and in context: "most commutes are between about 10 and 30 minutes."
Unusual features: outliers, gaps and clusters
An outlier is a data point that is unusually small or large relative to the rest of the data.
A gap is a region in a distribution between two values in which there are no observed data.
Clusters are concentrations of values, usually separated by gaps.
Figure 1.11. A cluster is a concentration of values; a gap is a region with no observations; outliers are values unusually far from the rest. Describe all of them in context.
Never leave these out. A response that talks about the shape and center of a distribution but ignores an obvious outlier is incomplete, and graders look for it. Outliers are also worth a sentence of explanation when the context suggests one (a data-entry error, or a genuinely unusual case).
Putting it together
A good description has four parts, often remembered as shape, outliers (and gaps, clusters), center and spread, in any order that reads naturally, each tied to the context. A weak description is only a label ("it is skewed right"). A strong one reads like a sentence a reporter could use.
Worked example · A complete description
The histogram of the 30 student commute times has bin counts 2, 11, 8, 4, 2, 1, 1, 0, 0, 1 for bins of width 10 minutes starting at 0. Describe the distribution.
Shape: unimodal and skewed to the right, with the peak in the 10 to 20 minute bin and a long tail toward larger commute times. Center: a typical commute is a little under 30 minutes (the middle of the data falls around the 20 minute mark). Spread: the commute times range from about 5 to 90 minutes, but most students (\(2+11+8=21\) of 30, or 70%) commute less than 30 minutes. Unusual features: one student commutes about 90 minutes, far longer than the rest and a likely outlier; there is a gap from about 70 to 90 minutes. A complete summary in context: "The distribution of commute times for these 30 students is unimodal and skewed right, centered near 20 minutes, with most between 5 and 30 minutes and one outlier near 90 minutes."
Worked example · Two peaks
A museum records the ages of 200 randomly selected visitors one Saturday. The histogram has a tall bar from 5 to 15 years and another tall bar from 35 to 45 years, with few visitors between 20 and 30 and few over 60. Describe the shape and suggest an explanation.
The distribution is bimodal, with one peak around 10 years and one around 40 years, and it has a dip (nearly a gap) between about 20 and 30 years. The two peaks suggest two different groups of visitors, children and their parents or other adults, mixed in one sample. A single center would not describe such data well, so the right description mentions both peaks and the two groups.
Worked example · Justifying a claim from a graph
In the commute histogram, a student claims that most students have a commute under 30 minutes. Is the claim supported?
The bins [0,10), [10,20) and [20,30) hold \(2+11+8=21\) of the 30 students, which is \(21/30=70\%\). A majority is more than half, so the claim is supported: "70% of the sampled students, 21 of 30, have a commute under 30 minutes." A claim is justified by citing the part of the graph that shows it, with counts or proportions.
Worked example · Choosing the likely shape
For each variable, say whether the distribution is more likely to be skewed right, skewed left, approximately symmetric or approximately uniform, and explain: (a) the birth month of 1,000 randomly chosen people; (b) the times, in minutes, that customers wait for a table at a busy restaurant; (c) the scores on a very easy quiz (maximum 20) taken by 80 students.
(a) Approximately uniform: each month has about the same share of births, so the bars would be nearly equal. (b) Skewed right: most waits are short, but a few customers wait much longer, stretching the right tail. (c) Skewed left: most scores are near 20, with a few much lower scores forming a tail on the left. In each case the reason refers to the context.
Exam focus
Describe every quantitative distribution with shape, center, variability, and unusual features (outliers, gaps, clusters), in context with units.
Skew is named for the longer tail. Unimodal, bimodal and uniform describe the number of peaks.
Never ignore an outlier, a gap or a cluster. A single label such as "skewed right" is an incomplete answer.
Justify a claim with numbers read from the graph (counts or proportions), not just a general impression.
Practice
A histogram of hours of sleep for 25 students has bars: 5 to under 6 h: 1 student; 6 to under 7: 2; 7 to under 8: 6; 8 to under 9: 9; 9 to under 10: 7. Describe the shape.
Show answer
The peak is in the 8 to 9 hour bin and the tail extends toward the smaller values, so the distribution is unimodal and skewed to the left. (1 + 2 + 6 + 9 + 7 = 25 students.)
The salaries at a small company are mostly between \$40,000 and \$70,000, but the owner earns \$450,000. Describe the likely shape and identify the unusual feature.
Show answer
The distribution is skewed to the right, and the owner's salary of \$450,000 is an outlier far above the rest.
A histogram of the daily number of customers at a shop has two clear peaks, one near 30 and one near 120. What does this suggest, and why would a single "typical value" be misleading?
Show answer
Bimodal data usually mix two different kinds of days (for example weekdays and weekends). A single typical value near the middle (about 75 customers) would describe almost no actual day, because the data cluster around 30 and 120.
A student describes a distribution of test scores as "skewed right." List what is missing from this description.
Show answer
A complete description also gives the center and the variability (with units and context), and mentions any outliers, gaps or clusters. The answer should also be tied to the context, such as naming the test and the group of students.
The ages of the 11 people in a hiking group are 15, 15, 16, 16, 16, 17, 17, 17, 18, 18 and 45. Describe the unusual feature and give a possible explanation in context.
Show answer
The age 45 is an outlier, much larger than the rest, which are all between 15 and 18. A plausible explanation is that 45 is an adult leader of a group of teenagers.
A graph of exam scores shows no scores between 60 and 70, with many scores between 70 and 100 and a few between 30 and 60. Name the feature between 60 and 70.
Show answer
It is a gap: a region between two values with no observations. The scores above 70 form a cluster, separated from the lower scores by the gap.
A graph gives you a picture; a summary statistic gives you a number you can quote, compare and calculate with. For one quantitative variable, summary statistics come in three families: measures of center (what is typical), measures of position (where a particular value stands in the distribution), and measures of variability (how spread out the values are). This lesson covers center and position. The next lesson covers variability, the effect of changing units, outliers and the choice of summary.
Required content · 1.7.A
Learning objective.
1.7.A. Calculate measures of center and position for quantitative data.
Essential knowledge.
1.7.A.1. Two commonly used measures of center in the distribution of a quantitative variable are the mean and median.
1.7.A.2. The mean is the sum of all the values divided by the number of values and can be found with and without using technology. For a sample, the mean is denoted by \(\bar x\): \(\bar x=\dfrac1n\sum_{i=1}^{n}x_i\), where \(x_i\) represents the \(i\)th data point in the sample and \(n\) represents the number of data values in the sample.
1.7.A.3. The median is the middle value when the data set is ordered from smallest to largest and can be found with and without using technology. One common method for determining the median of a data set with an even number of values is to use the mean of the two middle values. A common method for determining the median of a data set with an odd number of values is to use the value in the middle of all the values.
1.7.A.4. In an ordered data set, the smallest value is the minimum value, and the largest value is the maximum value.
1.7.A.5. The first quartile, denoted by Q1, is the median value of the lower half of the ordered data set from the minimum value to the position of the median. Approximately 25% of the values in the data set are less than or equal to Q1. The third quartile, denoted by Q3, is the median value of the upper half of the ordered data set from the position of the median to the maximum value. Approximately 75% of the values in the data set are less than or equal to Q3. The second quartile, Q2, is also the median of the data set. Q1 and Q3 form the boundaries for the middle 50% of values in an ordered data set.
1.7.A.6. The pth percentile is the value that has p% of the data less than or equal to it when the data set is ordered from smallest to largest. The first and third quartiles are the 25th and 75th percentiles, respectively.
The mean
The mean is the sum of all the values divided by the number of values. For a sample it is written \(\bar x\) ("x-bar"): \[\bar x=\frac{1}{n}\sum_{i=1}^{n}x_i=\frac{x_1+x_2+\cdots+x_n}{n},\] where \(x_i\) is the \(i\)th data point in the sample and \(n\) is the number of data values. The mean is the balance point of the distribution: if you put the values on a seesaw, it balances at \(\bar x\). It can be found with or without technology.
The median
The median is the middle value when the data are ordered from smallest to largest. If \(n\) is odd, the median is the value in the middle position. If \(n\) is even, a common method is to use the mean of the two middle values. Half of the values are less than or equal to the median and half are greater than or equal to it.
In an ordered data set the smallest value is the minimum and the largest is the maximum.
Quartiles and percentiles
The first quartile, \(Q_1\), is the median of the lower half of the ordered data (from the minimum up to the position of the median). About 25% of the values are less than or equal to \(Q_1\). The third quartile, \(Q_3\), is the median of the upper half (from the position of the median up to the maximum). About 75% of the values are less than or equal to \(Q_3\). The second quartile, \(Q_2\), is the median. \(Q_1\) and \(Q_3\) form the boundaries of the middle 50% of the values.
For an odd number of values, the usual convention (and what the TI-84 does) is to leave the median out of both halves. Different textbooks and software treat the middle value slightly differently, so quartiles can differ a little; AP exam questions are written so that the answer does not depend on the method, and you should always show how you found yours.
The pth percentile is the value that has \(p\%\) of the data less than or equal to it when the data are ordered from smallest to largest. The first and third quartiles are the 25th and 75th percentiles. A percentile describes a position, not a score: a student at the 90th percentile of a test did as well as or better than about 90% of the students, whatever the number of points was.
Figure 1.12. The quartiles and median split the ordered data into four groups of about 7 or 8 values each. The mean (triangle) lies to the right of the median because the long right tail pulls it up.
Worked example · Mean, median and quartiles by hand (odd n)
Find the mean, median, \(Q_1\) and \(Q_3\) for 4, 7, 8, 11, 15.
The mean is \((4+7+8+11+15)/5=45/5=9\). The data are already ordered and \(n=5\) is odd, so the median is the middle (third) value, 8. The lower half (leaving out the median) is 4, 7, so \(Q_1=(4+7)/2=5.5\); the upper half is 11, 15, so \(Q_3=(11+15)/2=13\). The minimum is 4 and the maximum is 15. Notice the mean (9) is a little above the median (8), because the largest value (15) is farther from the middle than the smallest.
Worked example · Even number of values
Find the mean, median and quartiles of 3, 5, 9, 12, 14, 20.
The mean is \(63/6=10.5\). With \(n=6\) (even), the median is the mean of the two middle values: \((9+12)/2=10.5\). The lower half is 3, 5, 9, so \(Q_1=5\); the upper half is 12, 14, 20, so \(Q_3=14\). Here the mean and median are equal, which happens in a symmetric data set but can also happen by coincidence.
Worked example · The commute data
The 30 commute times (minutes) from the graphs lesson have a sum of 781. Find the mean, median, quartiles and the position of a 25-minute commute.
\(\bar x=781/30\approx26.03\) minutes. With \(n=30\) the median is the mean of the 15th and 16th values, 20 and 22, so the median is 21 minutes. The lower half is the first 15 values and its median is the 8th value, \(Q_1=15\). The upper half is the last 15 values and its median is the 23rd value, \(Q_3=32\). (The minimum is 5 and the maximum is 90.) So half of the students commute 21 minutes or less, and the middle 50% commute between 15 and 32 minutes.
For the 25-minute commute: 19 of the 30 values are less than or equal to 25, so it is at about the \(19/30\approx63\)rd percentile; roughly 63% of these students commute 25 minutes or less. The mean (26.03) is larger than the median (21): the long right tail, including the 90-minute commute, pulls the mean up.
TI-84: summary statistics
Enter the data in L1 (STAT, 1:Edit). Press STAT, arrow to CALC, choose 1:1-Var Stats, enter the list (2nd 1 for L1) and press ENTER. The screen shows \(\bar x\), \(\Sigma x\), \(\Sigma x^2\), \(S_x\) (sample standard deviation), \(\sigma_x\) (population standard deviation), \(n\), then scroll down for minX, \(Q_1\), Med, \(Q_3\) and maxX. Use \(S_x\), not \(\sigma_x\), when the data are a sample.
What the center tells you
The mean and the median measure different things, and both are useful. The mean uses every value, so it reflects the total (a mean of 26 minutes times 30 students is 781 minutes of commuting). The median depends only on the middle of the ordered list, so it is a better description of a typical value when the distribution is skewed or has outliers. Which to report is a judgment you will practice in the next lesson, after you meet the measures of variability.
Exam focus
\(\bar x=\dfrac{\sum x_i}{n}\) is the mean; the median is the middle of the ordered data (mean of the two middle values if \(n\) is even).
\(Q_1\) and \(Q_3\) are the medians of the lower and upper halves; the pth percentile has \(p\%\) of the data at or below it.
Interpret in context: "half of the students commute 21 minutes or less," "25 minutes is about the 63rd percentile."
On the TI-84, 1-Var Stats gives \(\bar x\), \(S_x\), \(n\), minX, \(Q_1\), Med, \(Q_3\), maxX.
Practice
Find the mean, median, \(Q_1\) and \(Q_3\) of 12, 15, 17, 20, 21, 24 and 29.
Show answer
A student scored at the 90th percentile on a national reading test. Interpret this in context.
Show answer
The student scored as high as or higher than about 90% of the students who took the test (and about 10% scored higher). It describes position in the group, not the percentage of questions answered correctly.
A data set has \(n=40\) ordered values. About how many values are less than or equal to \(Q_1\)? To \(Q_3\)?
Show answer
About 25% of 40, or 10 values, are at or below \(Q_1\); about 75% of 40, or 30 values, are at or below \(Q_3\).
Five numbers have a mean of 12. A sixth number, 18, is added. What is the new mean?
Show answer
The original sum is \(5(12)=60\). The new sum is \(60+18=78\) for 6 numbers, so the new mean is \(78/6=13\).
The mean salary at a company is \$62,000 and the median is \$48,000. What does this suggest about the distribution of salaries, and why?
Show answer
The mean is much larger than the median, which suggests a distribution skewed right: a few very high salaries pull the mean up while the median stays near the middle of the typical salaries.
Variability, units, outliers and choosing a summary
Two data sets can have exactly the same center and still be very different: a bus that always takes 20 minutes and a bus that takes 5 minutes some days and 40 minutes on others both average about 20. The variability (or spread) of a distribution says how much the values differ from each other. This lesson defines the three standard measures of spread, shows what changing units does to every summary statistic, gives two common rules for calling a value an outlier, and then asks the question the exam cares about: which summary should you report, and why?
1.7.F. Justify the selection of a summary statistic for describing quantitative data.
Essential knowledge.
1.7.B.1. Three commonly used measures of variability (or spread) in the distribution of a quantitative variable are the range, interquartile range, and standard deviation.
1.7.B.2. The range is the difference between the maximum data value and the minimum data value.
1.7.B.3. The interquartile range (IQR) is the difference between the third and first quartiles: \(Q_3-Q_1\).
1.7.B.4. The standard deviation is a typical deviation of the data values from their mean and can be found with and without using technology. The sample standard deviation is denoted by \(s\) and calculated by \(s=\sqrt{\dfrac{1}{n-1}\sum(x_i-\bar x)^2}\), where \(x_i\) is the data value, \(\bar x\) is the mean, and \(n\) is the number of data values in the sample. The square of the sample standard deviation, \(s^2\), is called the sample variance.
1.7.C.1. Changing units of measurement affects the values of the calculated statistics.
1.7.D.1. There are many methods for determining potential outliers. Two methods frequently used are as follows:
1.7.D.1.i. An outlier is a value located more than \(1.5\times\text{IQR}\) above the third quartile or more than \(1.5\times\text{IQR}\) below the first quartile.
1.7.D.1.ii. An outlier is a value located more than 2 standard deviations above, or below, the mean.
1.7.E.1. Summary statistics can be used to compare features of two or more independent samples, including center, variability, shape, and outliers.
1.7.F.1. The median and IQR are considered a resistant (or robust) measure of center and measure of variability, respectively, because outliers do not greatly (if at all) affect their values. Because outliers can affect their values greatly, the mean is considered a nonresistant (or non-robust) measure of center, and the range and standard deviation are considered nonresistant (or non-robust) measures of variability.
1.7.F.2. Summary statistics of a quantitative variable may reveal information that can be used to justify claims about the variable in context.
The range and the interquartile range
Three commonly used measures of variability for a quantitative variable are the range, the interquartile range and the standard deviation.
The range is the difference between the maximum and minimum values: \(\text{range}=\max-\min\). It uses only two values and is easily distorted by one extreme observation.
The interquartile range (IQR) is the difference between the third and first quartiles: \(\text{IQR}=Q_3-Q_1\). It is the length of the interval that holds the middle 50% of the data.
For the 30 commute times, the range is \(90-5=85\) minutes and the IQR is \(32-15=17\) minutes.
The standard deviation
The standard deviation is a typical deviation of the data values from their mean. The sample standard deviation is written \(s\): \[s=\sqrt{\frac{1}{n-1}\sum_{i=1}^{n}\left(x_i-\bar x\right)^2},\] where \(x_i\) is a data value, \(\bar x\) is the mean and \(n\) is the number of values. The square of the standard deviation, \(s^2\), is called the sample variance. It can be found with or without technology. The steps by hand: find \(\bar x\); find each deviation \(x_i-\bar x\); square the deviations; add them; divide by \(n-1\); take the square root. The deviations are squared so that those below the mean do not cancel those above it, and the divisor is \(n-1\) (not \(n\)) for a sample.
Figure 1.13. Each arrow is a deviation \(x_i-\bar x\). The standard deviation summarizes the typical size of these arrows: square them, add them, divide by \(n-1\), and take the square root.
An interpretation must be in context: "the number of text messages sent by a student typically differs from the mean of 10 by about 3.4 messages." The standard deviation is zero only when all the values are equal, and it is large when many values are far from the mean.
Changing units
Changing the units of measurement affects the values of the calculated statistics. Two kinds of change matter.
Adding a constant \(c\) to every value shifts the whole distribution. The mean, median, quartiles, minimum and maximum all increase by \(c\), but the range, IQR, standard deviation and variance do not change.
Multiplying every value by a constant \(k\) (for example converting units) stretches the distribution. The center and position measures multiply by \(k\), and the range, IQR and standard deviation multiply by \(|k|\) (the variance multiplies by \(k^2\)).
Converting the commute times from minutes to hours means multiplying by \(1/60\): the mean \(26.03\) minutes becomes \(0.434\) hours, the standard deviation \(18.04\) minutes becomes \(0.301\) hours and the IQR \(17\) minutes becomes \(0.283\) hours.
Outliers: two common rules
There are many methods for identifying potential outliers. Two are used frequently, and a good answer always says which one it uses.
The 1.5 × IQR rule. A value is an outlier if it is more than \(1.5\times\text{IQR}\) above \(Q_3\) or more than \(1.5\times\text{IQR}\) below \(Q_1\). The cutoffs \(Q_1-1.5\,\text{IQR}\) and \(Q_3+1.5\,\text{IQR}\) are called the fences.
The 2-standard-deviation rule. A value is an outlier if it is more than 2 standard deviations above or below the mean.
The rules do not always agree. They are guides for flagging unusual values; the decision about what to do with an outlier depends on the context (an error, a different kind of case, or a real and important extreme).
Worked example · Standard deviation by hand
Five students sent 6, 8, 9, 13 and 14 text messages. Find the standard deviation.
The mean is \(\bar x=50/5=10\). The deviations are \(-4,\,-2,\,-1,\,3,\,4\). The squared deviations are \(16,\,4,\,1,\,9,\,16\), and they sum to 46. Then \[s^2=\frac{46}{5-1}=11.5,\qquad s=\sqrt{11.5}\approx3.39.\] In context: the number of messages a student sent typically differs from the mean of 10 messages by about 3.4 messages.
Worked example · Outliers by two rules
For the 30 commute times, \(\bar x\approx26.03\), \(s\approx18.04\), \(Q_1=15\) and \(Q_3=32\). Which values are outliers by (a) the 1.5 × IQR rule and (b) the 2-standard-deviation rule?
(a) \(\text{IQR}=17\), so \(1.5\,\text{IQR}=25.5\). The fences are \(15-25.5=-10.5\) and \(32+25.5=57.5\). The values 60 and 90 are above 57.5, so there are two outliers: 60 and 90 minutes. (b) \(\bar x\pm2s=26.03\pm36.09\), which gives \(-10.05\) to \(62.12\). Only 90 is outside that interval, so there is one outlier, 90 minutes. The two rules disagree about the 60-minute commute (60 is above the fence of 57.5 but less than 2 standard deviations above the mean), which is why you should name the rule you used.
Worked example · Which statistics are resistant?
Remove the 90-minute commute from the 30 values and the remaining 29 have mean 23.83, median 20, standard deviation 13.64, IQR 16.5 and range 55. Compare these with the full-data values (mean 26.03, median 21, standard deviation 18.04, IQR 17, range 85).
Removing the one outlier changed the mean by about 2.2 minutes and the standard deviation by about 4.4 minutes, and it dropped the range by 30 minutes; the median changed by 1 minute and the IQR by 0.5 minute. The median and IQR are resistant (robust): outliers do not greatly affect them. The mean, standard deviation and range are nonresistant (non-robust): an outlier can change them a great deal.
Figure 1.14. Removing one outlier moves the mean from 26.0 to 23.8 but moves the median only from 21 to 20: the median is resistant, the mean is not.
Choosing and using summary statistics
Summary statistics let us compare features of two or more independent samples: their center, variability, shape and outliers. To justify the choice of a statistic, use resistance and shape:
If the distribution is skewed or has outliers, describe it with the median and IQR, because they are resistant and are not dominated by the tail.
If it is roughly symmetric with no outliers, the mean and standard deviation are appropriate and use all of the data.
Summary statistics can also be used to justify claims about the variable in context, as long as the claim cites the numbers. "Half of these students commute 21 minutes or less, and the middle 50% commute between 15 and 32 minutes" is better than "commutes are around 20 minutes."
Worked example · Comparing two sections numerically
Two sections of a course took the same exam. Section A (15 students) had mean 77.5, standard deviation 7.9, median 78 and IQR 11. Section B (15 students) had mean 77.1, standard deviation 15.4, median 78 and IQR 24. Compare the sections.
The centers are almost identical: the means are 77.5 and 77.1 and both medians are 78. The variability is very different: the scores in Section B are about twice as spread out as in Section A (standard deviation 15.4 compared with 7.9, and IQR 24 compared with 11). So a student's score in Section B is much less predictable than one in Section A. Every sentence names both sections and uses a comparison word.
TI-84: reading spread and checking outliers
1-Var Stats on the list gives \(S_x\) (use this for a sample) and \(Q_1\), \(Q_3\). Compute the fences by hand (or store them) and compare each suspect value. To see outliers, draw a modified boxplot (STAT PLOT, the boxplot icon with the dots; the dots mark values beyond the fences).
Exam focus
Range (max \(-\) min), IQR (\(Q_3-Q_1\)) and standard deviation \(s=\sqrt{\sum(x_i-\bar x)^2/(n-1)}\) measure variability; \(s^2\) is the variance.
Adding a constant shifts center and position measures but not spread; multiplying by \(k\) multiplies center and spread by \(|k|\).
Outlier rules: more than \(1.5\times\text{IQR}\) beyond \(Q_1\) or \(Q_3\), or more than 2 standard deviations from the mean. Say which rule you used.
Median and IQR are resistant; mean, standard deviation and range are not. Use median and IQR for skewed data or data with outliers.
Always interpret in context and compare two groups with sentences that name both.
Practice
Find the standard deviation of 2, 4, 4, 6 and 9.
Show answer
\(\bar x=25/5=5\). Deviations: \(-3,-1,-1,1,4\); squared: \(9,1,1,1,16\); sum \(=28\). \(s^2=28/4=7\), so \(s=\sqrt7\approx2.65\).
A set of 50 delivery times (in minutes) has mean 45, standard deviation 12 and IQR 18. Find the mean, standard deviation and IQR in seconds.
Show answer
Multiply by 60: the mean is 2700 seconds, the standard deviation is 720 seconds and the IQR is 1080 seconds.
A delay of 5 minutes is added to every delivery time in the previous problem. What happens to the mean, median, standard deviation and IQR?
Show answer
The mean and median each increase by 5 minutes. The standard deviation and the IQR do not change, because adding a constant shifts the data but does not change how spread out they are.
A data set has \(Q_1=20\) and \(Q_3=32\). Use the 1.5 × IQR rule to decide whether 55 and 45 are outliers.
Show answer
\(\text{IQR}=12\), \(1.5\times12=18\). Fences: \(20-18=2\) and \(32+18=50\). 55 is above 50, so it is an outlier. 45 is below 50, so it is not.
Exam scores have mean 70 and standard deviation 8. Which of 52 and 88 are outliers by the 2-standard-deviation rule?
Show answer
The interval is \(70\pm16=(54,86)\). Both 52 (below 54) and 88 (above 86) are outliers.
The incomes in a city are strongly skewed right, with a few very large incomes. Which summary statistics should be reported for the center and spread, and why?
Show answer
The median and IQR. They are resistant, so the few very large incomes do not distort them, while the mean and standard deviation would be pulled up by the tail and give a misleading picture of a typical household.
A histogram shows the whole shape of a distribution but takes up a lot of room. When you want to compare several distributions side by side, or spot outliers at a glance, a boxplot is more compact: it shows only five numbers, but they are the right five. This lesson builds the five-number summary, draws boxplots (including the outliers), and uses the relationship between the mean and the median to read skew.
Required content · 1.8.A, 1.8.B
Learning objectives.
1.8.A. Construct quantitative one-variable graphical representations of summary statistics.
1.8.B. Describe quantitative one-variable graphical representations of summary statistics based on the relationship of the mean and the median.
Essential knowledge.
1.8.A.1. A five-number summary is made up of the minimum data value, the first quartile (Q1), the median, the third quartile (Q3), and the maximum data value.
1.8.A.2. A boxplot is a graphical representation of the five-number summary (minimum, first quartile, median, third quartile, maximum). The box represents the middle 50% of data, with a line at the median and the ends of the box corresponding to the quartiles. Lines (“whiskers”) that represent 25% of the data extend from the first quartile to the minimum and from the third quartile to the maximum. If there are outliers in the data, the whiskers extend to the most extreme data values that are not outliers, and outliers are usually denoted with an asterisk or other symbol.
1.8.B.1. If a distribution is relatively symmetric, then the values of the mean and median are relatively close to each other. If a distribution is skewed right, then the value of the mean is usually larger than the median. If the distribution is skewed left, then the value of the mean is usually smaller than the median.
The five-number summary
A five-number summary is made up of the minimum data value, the first quartile (\(Q_1\)), the median, the third quartile (\(Q_3\)), and the maximum data value. It splits the ordered data into four groups with about 25% of the values in each: from the minimum to \(Q_1\), from \(Q_1\) to the median, from the median to \(Q_3\), and from \(Q_3\) to the maximum. For the 30 commute times the five-number summary is 5, 15, 21, 32, 90 minutes.
Boxplots
A boxplot is a graphical representation of the five-number summary. The box represents the middle 50% of the data, with a line at the median and the ends of the box at the quartiles. Lines called whiskers extend from the box toward the extremes. If there are no outliers, the whiskers run from \(Q_1\) down to the minimum and from \(Q_3\) up to the maximum, and each whisker holds the 25% of the data beyond the box. If there are outliers in the data, the whiskers extend to the most extreme data values that are not outliers, and the outliers are plotted separately, usually with an asterisk or another symbol. (This is called a modified boxplot.)
To draw one by hand: (1) find the five-number summary; (2) compute the fences \(Q_1-1.5\,\text{IQR}\) and \(Q_3+1.5\,\text{IQR}\); (3) mark any value outside the fences as an outlier; (4) draw the box and median line; (5) draw each whisker to the most extreme non-outlier value.
Figure 1.15. The box runs from \(Q_1=15\) to \(Q_3=32\) with a line at the median, 21. The whiskers end at the smallest value, 5, and at the largest value that is not an outlier, 55; the values 60 and 90 lie beyond the upper fence (57.5) and are plotted separately.
How to read a boxplot: the median line shows the center, the length of the box is the IQR (variability), the relative lengths of the two whiskers and the two halves of the box show skewness (a longer upper whisker or upper half suggests skew to the right), and separate points show outliers. A boxplot does not show peaks or gaps. A bimodal distribution and a unimodal one can have identical boxplots, so use a histogram or dotplot when the number of peaks matters.
Mean, median and skew
If a distribution is relatively symmetric, the mean and median are relatively close to each other. If the distribution is skewed to the right, the mean is usually larger than the median, because the long right tail pulls the mean up. If it is skewed to the left, the mean is usually smaller than the median.
Figure 1.16. The median (solid line) splits the area in half; the mean (dashed line) is pulled toward the longer tail. Skewed left: mean below median. Symmetric: about equal. Skewed right: mean above median.
For the commute data, the mean is 26.0 and the median is 21 minutes: the mean is larger, consistent with the right skew we saw in the histogram. This is a tendency, not a law, but it is a reliable one for single-peaked distributions and an easy way to support a claim about skewness on the exam: "The mean is greater than the median, so the distribution is probably skewed right."
Worked example · Five-number summary and boxplot with outliers
Find the five-number summary of the 30 commute times, check for outliers and describe the boxplot.
The five-number summary is min 5, \(Q_1=15\), median 21, \(Q_3=32\), max 90. The IQR is 17, so the fences are \(15-25.5=-10.5\) and \(32+25.5=57.5\). The values 60 and 90 are above the upper fence and are outliers, and no value is below the lower fence. The largest value that is not an outlier is 55, so the upper whisker ends at 55. Boxplot: a box from 15 to 32 with a line at 21, a lower whisker down to 5, an upper whisker out to 55, and separate marks at 60 and 90. The upper whisker and the upper half of the box are longer than the lower ones, which fits a distribution skewed to the right.
Worked example · A left-skewed data set
Fifteen quiz scores were 58, 71, 74, 78, 80, 82, 83, 85, 86, 88, 88, 90, 91, 93, 95. Find the five-number summary, any outliers, and compare the mean (82.8) with the median.
The median is the 8th value, 85. The lower half (7 values) has median 78, so \(Q_1=78\); the upper half has median 90, so \(Q_3=90\). The five-number summary is 58, 78, 85, 90, 95. \(\text{IQR}=12\), so the fences are \(78-18=60\) and \(90+18=108\). The score 58 is below 60, so it is an outlier. The lower whisker stops at the next smallest score, 71, and the upper whisker ends at 95. The mean (82.8) is below the median (85), which matches the longer lower tail and the outlier at the low end: the distribution is skewed to the left.
Worked example · What a boxplot says about percentages
A boxplot for the number of minutes 200 students spent on a task has minimum 20, \(Q_1=30\), median 36, \(Q_3=50\), maximum 80 (no outliers). About how many students took between 36 and 50 minutes? Between 50 and 80?
About 25% of the data lie between the median and \(Q_3\), so about \(0.25(200)=50\) students took between 36 and 50 minutes. About 25% lie between \(Q_3\) and the maximum, so about 50 students took between 50 and 80 minutes. Compare the lengths: the upper half of the box (36 to 50) is 14 minutes long and the lower half (30 to 36) is only 6, so the data are more spread out above the median than below it.
TI-84: boxplot
Enter the data in L1. Press 2nd Y= (STAT PLOT), choose Plot1, turn it On, and pick the boxplot icon in the second row (the one with the separate dots shown at the ends) for a modified boxplot, with Xlist L1. Press ZOOM 9 (ZoomStat) and GRAPH, then TRACE to read \(\text{minX}\), \(Q_1\), Med, \(Q_3\) and \(\text{maxX}\) and to see each outlier's value. The plain boxplot icon (without the dots) draws the whiskers all the way to the minimum and maximum, which hides the outliers, so use the modified one.
Exam focus
The five-number summary is min, \(Q_1\), median, \(Q_3\), max. A boxplot shows it: the box covers the middle 50%, the line is the median, and the whiskers (stopping at the most extreme non-outlier) hold about 25% each; outliers get their own marks.
Right skew: mean \(>\) median. Left skew: mean \(<\) median. Symmetric: mean \(\approx\) median.
A boxplot does not show peaks or gaps; use a dotplot or histogram for those.
Support claims about skew or outliers with numbers: the fences, or a comparison of mean and median.
Practice
Find the five-number summary of 7, 9, 11, 12, 14, 15, 18, 22 and 40, and decide whether 40 is an outlier.
Show answer
Median 14; lower half 7, 9, 11, 12 gives \(Q_1=10\); upper half 15, 18, 22, 40 gives \(Q_3=20\). Five-number summary: 7, 10, 14, 20, 40. \(\text{IQR}=10\), fences \(-5\) and \(35\). Since \(40>35\), it is an outlier, and the upper whisker would end at 22.
A boxplot has \(Q_1=12\), median 15 and \(Q_3=25\). What does the position of the median suggest about the shape, and what would you expect for the mean compared with the median?
Show answer
The median is much closer to \(Q_1\) than to \(Q_3\), so the upper part of the data is more spread out: the distribution is likely skewed to the right, and the mean is likely greater than the median.
A distribution is skewed to the left. Is the mean likely to be greater than, less than, or about equal to the median? Explain.
Show answer
Less than. The long left tail of small values pulls the mean toward the left, below the median, which is resistant to the tail.
In a boxplot, about what percent of the data lie between \(Q_1\) and the median? Between the minimum whisker end and \(Q_3\)?
Show answer
About 25% between \(Q_1\) and the median. About 75% between the minimum (when there are no outliers) and \(Q_3\).
A data set has \(Q_1=40\) and \(Q_3=52\). Find the fences used for a boxplot.
Show answer
\(\text{IQR}=12\), \(1.5\times12=18\), so the fences are \(40-18=22\) and \(52+18=70\). Values below 22 or above 70 would be plotted as outliers.
Two histograms are very different (one is unimodal, one bimodal), yet their boxplots look identical. Explain how that is possible.
Show answer
A boxplot shows only the five-number summary, so two distributions with the same minimum, quartiles, median and maximum have the same boxplot even if their peaks differ. A boxplot cannot show the number of peaks or gaps.
Statistics is at its most useful when it compares: one class with another, treated patients with untreated ones, this year with last year. This lesson shows how to compare the distributions of one quantitative variable using graphs and numbers, and introduces the z-score, a way of describing where a single value sits in its own distribution so that values from different distributions can be compared fairly.
1.9.B. Compare multiple quantitative one-variable graphical representations of summary statistics.
1.9.C. Justify a claim using multiple quantitative one-variable graphical representations.
1.9.D. Calculate z-scores with population parameters.
1.9.E. Compare z-scores as measures of relative position for distributions.
Essential knowledge.
1.9.A.1. Graphical representations of a quantitative variable can be used to compare important features between two or more distributions of the same quantitative variable. Histograms, back-to-back stem-and-leaf plots, and dotplots may be used to compare center, variability, shape, outliers, clusters, or gaps in two or more distributions. Boxplots may be used to compare center, variability, outliers, and skewness (or symmetry).
1.9.B.1. A comparison of graphical representations for two or more distributions can include any of the numerical summaries (e.g., mean, standard deviation, etc.).
1.9.C.1. Multiple quantitative one-variable graphical representations may reveal information that can be used to justify claims about the variable in context.
1.9.D.1. A standardized score measures the number of standard deviations a data value falls above or below the mean.
1.9.D.2. A z-score is calculated as \(z=\dfrac{x_i-\mu}{\sigma}\), where \(x_i\) is the data value, \(\mu\) is the population mean, and \(\sigma\) is the population standard deviation. A z-score measures how many standard deviations a data value is above (positive z-score) or below (negative z-score) the mean. When the population mean and standard deviation are unknown, the sample mean and standard deviation may be used to determine a z-score.
1.9.E.1. z-scores may be used to compare relative positions of individual values within a distribution or between distributions.
Comparing distributions with graphs
Graphical representations of a quantitative variable can be used to compare important features of two or more distributions of the same variable.
Histograms, back-to-back stem-and-leaf plots, and dotplots can be used to compare center, variability, shape, outliers, clusters and gaps.
Boxplots can be used to compare center, variability, outliers and skewness (or symmetry).
To compare, put the distributions on the same scale: stacked dotplots or parallel boxplots share one axis, and a back-to-back stem-and-leaf plot shares one set of stems. Here are the scores on the same exam for two sections of a course, 15 students in each (Section A met in person; Section B met online).
Figure 1.17. Stacked dotplots on a common axis make center and spread easy to compare: both sections are centered near 78, but Section B's scores are far more spread out.
A back-to-back stem-and-leaf plot puts the leaves for one group on the left of the stems and the other group on the right.
Section A (leaves)
Stem
Section B (leaves)
4
8
5
5
8 2
6
0 6
9 8 6 5 4 2 0
7
0 3 5 8
8 5 3 1 0
8
0 4 8
2
9
0 4 6
10
0
Key: \(7\mid3\) on the right means a score of 73 in Section B. A boxplot makes the same comparison compactly.
Figure 1.18. Same center (median 78 in each section) but very different spread: Section B's box and whiskers are about twice as wide.
Comparing numerical summaries
A comparison of graphical representations can include any numerical summary: means, medians, standard deviations, IQRs, the five-number summary. For the two sections, Section A has five-number summary 62, 72, 78, 83, 92 and Section B has 48, 66, 78, 90, 100. Both have median 78, but the IQR is 11 for Section A and 24 for Section B, and the range is 30 for A and 52 for B.
Writing a comparison
A comparison has to refer to both distributions in each sentence and use a comparison word (higher, lower, more variable, wider, similar). Listing the features of one group and then the other, without connecting them, is not a comparison. Cover shape, center, variability and unusual features, and tie each to the context.
Worked example · A complete comparison
Compare the exam scores in Section A and Section B.
Center: the typical score is about the same in the two sections: both medians are 78 points. Variability: the scores in Section B are much more spread out than in Section A (IQR 24 points compared with 11 points, and range 52 compared with 30). Shape: Section A's scores are roughly symmetric and clustered between about 70 and 85, while Section B's scores are spread fairly evenly from the high 40s to 100. Unusual features: neither section has outliers, but Section B has both the lowest (48) and the highest (100) scores. So a student in Section B is more likely to score very high or very low than a student in Section A, even though the middle score is the same.
z-scores: where does a value stand?
A standardized score measures the number of standard deviations a data value falls above or below the mean. The z-score of a data value \(x_i\) is \[z=\frac{x_i-\mu}{\sigma},\] where \(\mu\) is the population mean and \(\sigma\) is the population standard deviation. A positive z-score means the value is above the mean and a negative z-score means it is below the mean; \(|z|\) tells how many standard deviations away it is. When the population mean and standard deviation are unknown, the sample mean and sample standard deviation may be used to determine a z-score: \(z=(x_i-\bar x)/s\).
Because a z-score is a count of standard deviations, it has no units, and it can be used to compare relative positions of individual values within a distribution or between distributions.
Figure 1.19. A 1280 on the first exam and a 29 on the second sit \(1.10\) and \(1.45\) standard deviations above their means. The second score is the more impressive relative to its own distribution.
A z-score of 0 means the value equals the mean. Values with \(|z|\) greater than 2 are unusual in many (not all) data sets, which is the basis of the 2-standard-deviation outlier rule from the last lesson.
Worked example · Comparing scores from different exams
Maya scored 1280 on a college-entrance exam with \(\mu=1050\) and \(\sigma=210\). Jonas scored 29 on a different exam with \(\mu=21\) and \(\sigma=5.5\). Who did better relative to the students who took each exam?
Maya: \(z=\dfrac{1280-1050}{210}=\dfrac{230}{210}\approx1.10\). Jonas: \(z=\dfrac{29-21}{5.5}=\dfrac{8}{5.5}\approx1.45\). Jonas's score is about 1.45 standard deviations above the mean of his exam, and Maya's is about 1.10 standard deviations above the mean of hers, so Jonas did better relative to his group, even though 29 is a smaller number than 1280. Comparing raw scores across different scales would be meaningless.
Worked example · A z-score from sample statistics
For the 30 commute times, \(\bar x\approx26.03\) and \(s\approx18.04\). Find the z-scores of the 60-minute and 90-minute commutes.
\(z_{60}=\dfrac{60-26.03}{18.04}\approx1.88\) and \(z_{90}=\dfrac{90-26.03}{18.04}\approx3.55\). The 90-minute commute is about 3.55 standard deviations above the mean, which is very unusual in this data set; the 60-minute commute is 1.88 standard deviations above the mean, which is not more than 2 and so is not an outlier by the 2-standard-deviation rule (although the 1.5 × IQR rule flags it).
Worked example · Finding a data value from a z-score
Scores on a test have mean 500 and standard deviation 100. What score has a z-score of \(-1.3\)?
\(z=\dfrac{x-500}{100}=-1.3\), so \(x=500+(-1.3)(100)=370\). A score of 370 is 1.3 standard deviations below the mean.
Worked example · Comparing relative height
A 17-year-old boy is 1.82 m tall; boys that age have mean height 1.75 m and standard deviation 0.07 m. A 17-year-old girl is 1.72 m tall; girls that age have mean 1.65 m and standard deviation 0.06 m. Who is taller relative to their group?
Boy: \(z=(1.82-1.75)/0.07=1.00\). Girl: \(z=(1.72-1.65)/0.06\approx1.17\). The girl is 1.17 standard deviations above the mean of the girls, and the boy is 1.00 standard deviations above the mean of the boys, so she is taller relative to her group, although the boy is taller in meters.
Exam focus
To compare distributions, use the same scale; mention shape, center, variability and unusual features, and write sentences that refer to both groups with comparison words.
Histograms, dotplots and back-to-back stemplots show shape, clusters, gaps and outliers; boxplots show center, spread, outliers and skew (not peaks).
\(z=\dfrac{x-\mu}{\sigma}\) (or \(\dfrac{x-\bar x}{s}\) from a sample) counts standard deviations from the mean; compare z-scores to compare relative position across different distributions.
Interpret a z-score in context: "is 1.45 standard deviations above the mean score on that exam."
Practice
A value of 71 comes from a distribution with mean 64 and standard deviation 3.5. Find and interpret its z-score.
Show answer
\(z=(71-64)/3.5=2.0\). The value is 2 standard deviations above the mean.
Scores have mean 72 and standard deviation 8. What score has a z-score of 1.25?
Show answer
\(x=72+1.25(8)=82\).
Anna scored 84 on a test with mean 78 and standard deviation 4. Ben scored 91 on a different test with mean 80 and standard deviation 10. Who did better relative to their class?
Show answer
Anna: \(z=(84-78)/4=1.5\). Ben: \(z=(91-80)/10=1.1\). Anna did better relative to her class, since her score is 1.5 standard deviations above the mean and Ben's is 1.1.
A student says that a z-score of \(-2\) means the value is 2 points below the mean. Correct the statement.
Show answer
A z-score of \(-2\) means the value is 2 standard deviations below the mean. The number of points depends on the standard deviation: for example, with \(\sigma=5\) it would be 10 points below.
Team A's daily sales (in thousands of dollars) have five-number summary 12, 15, 20, 24, 30, and Team B's have 10, 16, 20, 32, 48. Compare the two teams.
Show answer
Both teams have the same median, 20 thousand dollars, so their typical days are alike. Team B is more variable: its IQR is 16 thousand compared with 9 thousand for Team A, and its range is 38 compared with 18. Team B's distribution is also more skewed to the right, with a longer upper whisker (32 to 48) than lower whisker (10 to 16).
Why can a z-score be used to compare values from two distributions with different units?
Show answer
A z-score is a number of standard deviations. The units of the value and of the standard deviation cancel, so it is unitless, and it describes relative position within each group.
The investigative question revisited and data collection
So far we have only described data we were handed. This lesson steps back to the beginning of a study, where the most important decisions are made: what exactly are we asking, how will the data be gathered, and what will the answer be allowed to say? You will learn the three parts of a well-built investigative question, the difference between a census, an experiment and an observational study, and what random selection and random assignment each make possible.
1.10.A. Determine the components of an investigative question within a statistical study.
1.10.B. Identify a census.
1.10.C. Identify an experiment.
1.10.D. Identify an observational study.
1.10.E. Justify the appropriateness of generalizations for a statistical study.
Essential knowledge.
1.10.A.1. The first component of an investigative question should guide the data collection process and should be phrased in terms of the variable(s) of interest in the study.
1.10.A.2. The second component of an investigative question should guide the data analysis choice.
1.10.A.2.i. In the case of a hypothesis test, the investigative question should make clear the parameter and the direction of the alternative hypothesis (i.e., not equal, greater than, less than, association, not independent).
1.10.A.2.ii. In the case of a confidence interval, the investigative question should make clear the parameter and the goal of estimation of that parameter within a range of potential values.
1.10.A.3. The third component of an investigative question should indicate the type(s) of conclusion(s) applicable from the study. The investigative question should provide the population to which the conclusions will be applicable and, in the case of an experiment that uses random assignment, a cause-and-effect conclusion.
1.10.B.1. A census consists of recording information from all items or individuals in a population.
1.10.C.1. An experiment is a study in which a researcher assigns conditions, or treatments, to experimental units to explore an investigative question of interest about the population.
1.10.C.2. The experimental unit is the observational unit to which the treatment is assigned. When experimental units consist of people, they are sometimes referred to as subjects or participants.
1.10.C.3. An explanatory variable, or factor, is a variable whose different categories, or levels, are imposed on the experimental units. The different categories, or levels, of the explanatory variable are called treatments. When there is more than one explanatory variable, the combinations of the categories, or levels, of the explanatory variables are called treatments.
1.10.C.4. A response variable is an outcome measured on each experimental unit after the treatment has been administered.
1.10.D.1. An observational study is a study where treatments are not imposed. The researcher records the values of the variables of interest in order to explore an investigative question of interest.
1.10.D.2. A prospective study is one in which the observational units of study are selected at a point in time, and data are gathered both at that time and into the future.
1.10.D.3. A retrospective study is one in which the observational units of study are selected at a point in time and data from the past are gathered.
1.10.D.4. A survey is an observational study in which the data are collected from humans using a standard set of questions.
1.10.D.5. A confounding variable in an observational study provides an alternative explanation for the observed relationship between the explanatory and response variables determined in the study, thereby reducing the possibility of concluding a causal relationship between the explanatory and response variables of interest. To be a confounding variable, a variable must be associated with both the explanatory variable and the response variable.
1.10.E.1. A sample is considered random when all observational units in the sample are selected from the population using some type of random mechanism, such as a random number generator.
1.10.E.2. When observational units, or experimental units, in a sample are randomly selected from a population, it is appropriate to make generalizations about the entire population of individuals from which the sample was selected.
1.10.E.3. A sample is not randomly selected when observational units are deliberately chosen or volunteer themselves to be in the sample.
1.10.E.4. When observational units, or experimental units, in a sample are not randomly selected from a population, it is appropriate to make generalizations only about a population of individuals that are similar to those used in the study.
The three components of an investigative question
An investigative question for a specific study has three components.
The variable(s) of interest. The first component should guide the data collection process and should be phrased in terms of the variable or variables of interest in the study.
The analysis. The second component should guide the data analysis choice. For a hypothesis test, the question should make clear the parameter and the direction of the alternative hypothesis (not equal, greater than, less than, association, not independent). For a confidence interval, it should make clear the parameter and the goal of estimating that parameter within a range of plausible values.
The conclusion. The third component should indicate the type or types of conclusion that apply from the study. It should name the population to which the conclusions can be applied, and, for an experiment that uses random assignment, a cause-and-effect conclusion.
Worked example · Writing the three components
A student government wants to know whether the proportion of students at their school who ride the bus is greater than 40%. A random sample of 150 of the school's 1,800 students will be surveyed. Write the investigative question and identify its three components.
Question: "Is the proportion of all students at our school who ride the bus greater than 0.40?" (1) The variable of interest is whether a student rides the bus (categorical), which tells us what to ask each sampled student. (2) The parameter is the proportion \(p\) of the school's students who ride the bus, and the question points in one direction (greater than 0.40), so the analysis is a one-sided hypothesis test about a proportion. (3) The sample is random, so the conclusion can be applied to the population of all students at this school, and because it is a survey, not an experiment, it cannot be a cause-and-effect conclusion.
Census, experiments and observational studies
A census consists of recording information from all items or individuals in a population. A census is possible only for a small or accessible population (every student in one classroom, for example); for most questions it is too costly or difficult, which is why we sample.
Most studies that use a sample are one of two types, and the key question is whether the researcher imposes conditions on the units.
Figure 1.20. The deciding question: did the researcher impose the treatments? If yes, it is an experiment; if the researcher only recorded what happened, it is an observational study.
Experiments. An experiment is a study in which a researcher assigns conditions, or treatments, to experimental units to explore an investigative question about the population. The vocabulary:
The experimental unit is the observational unit to which the treatment is assigned. When the units are people they are often called subjects or participants.
An explanatory variable, or factor, is a variable whose different categories, or levels, are imposed on the experimental units. The levels of the explanatory variable are the treatments. When there is more than one explanatory variable, the combinations of levels are the treatments.
A response variable is an outcome measured on each experimental unit after the treatment has been given.
Observational studies. An observational study is one in which treatments are not imposed. The researcher records the values of the variables of interest in order to explore the question. There are several kinds:
A prospective study selects the units at one point in time and gathers data both then and into the future.
A retrospective study selects the units at one point in time and gathers data from the past.
A survey is an observational study in which data are collected from people using a standard set of questions.
Confounding in observational studies
Because an observational study cannot assign who gets what, other differences between the groups may offer an alternative explanation for what we see. A confounding variable in an observational study provides an alternative explanation for the observed relationship between the explanatory and response variables, which reduces the possibility of concluding that one causes the other. To be a confounding variable, a variable must be associated with both the explanatory variable and the response variable.
For example, suppose a study finds that students who eat breakfast have higher grades. Hours of sleep could be a confounder: students who sleep more may both eat breakfast more often and do better in school. A confounder must be linked to both variables; a variable that affects only the grades does not, by itself, explain why breakfast and grades are related.
What a study can generalize to
The conclusions we can draw depend on how the units were chosen. A sample is random when all observational units in it are selected from the population using some random mechanism, such as a random number generator.
When units in a sample are randomly selected from a population, it is appropriate to make generalizations about the entire population from which the sample was selected.
A sample is not random when units are deliberately chosen or volunteer themselves. When the sample is not random, it is appropriate to make generalizations only about a population of individuals similar to those in the study.
Combining this with how treatments are given (which the experimental design lesson covers in detail) gives the standard picture of what a study can conclude.
Units randomly selected
Units not randomly selected
Treatments randomly assigned
Can generalize to the population and conclude cause and effect
Cause and effect, but only for units similar to those in the study
No random assignment (observational)
Can generalize to the population, but only an association (no cause and effect)
Neither: only an association, only for similar units
Worked example · Experiment or observational study?
Classify each study and name the type: (a) 60 volunteers are randomly assigned either a new diet or their usual diet, and weight change is recorded after 12 weeks; (b) researchers read the medical records of 500 adults to compare lung disease rates for smokers and nonsmokers; (c) researchers choose 2,000 five-year-olds and follow them until age 18, recording daily screen time and grades; (d) 800 adults answer a poll about a proposed law; (e) every one of the 28 students in a class is measured for height.
(a) Experiment: the researchers assign the diet. (b) Observational, retrospective: past data are gathered and nothing is imposed. (c) Observational, prospective: the children are selected now and data are gathered into the future. (d) Observational, a survey (standard questions asked of people). (e) A census of the class, since all of the individuals in the population (the class) are measured.
Worked example · Parts of an experiment
A teacher randomly assigns 40 students to either study with flashcards or reread their notes, and compares quiz scores. Identify the experimental unit, the explanatory variable, the treatments and the response variable.
The experimental units are the 40 students (the objects to which the treatments are assigned). The explanatory variable (factor) is the study method, with two levels, and those two levels are the treatments: flashcards and rereading. The response variable is the quiz score, which is measured on each student after the treatment. Because the treatments are assigned randomly, the study can support a cause-and-effect conclusion about the effect of study method on quiz score for students like these.
Worked example · Scope of a conclusion
(a) A random sample of 500 registered voters in a state is polled. (b) A school posts a link and 40 students who choose to respond are used. For each, what population can the results be applied to?
(a) The voters were randomly selected, so the conclusions apply to all registered voters in the state. (b) The sample is a volunteer sample, so it is not random, and the results apply only to students similar to those who responded, not to the whole school.
Exam focus
A good investigative question names the variable(s) (guiding data collection), the parameter and direction or goal (guiding the analysis), and the population and type of conclusion.
Census: every unit. Experiment: the researcher assigns treatments (explanatory variable = factor, levels = treatments, response variable). Observational study: nothing imposed (survey, prospective, retrospective).
A confounding variable is associated with both the explanatory and the response variable.
Random selection lets you generalize to the population; a nonrandom sample generalizes only to similar individuals. Random assignment allows cause-and-effect conclusions.
Practice
A researcher wants to know whether the mean time teenagers spend on homework is less than 2 hours, using a random sample from one school district. State the parameter and the direction of the alternative hypothesis, and identify the population to which the conclusion applies.
Show answer
The parameter is the mean time \(\mu\) spent on homework by all teenagers in the district. The alternative hypothesis is \(\mu<2\) hours (one-sided, less than). The conclusion applies to all teenagers in the district, since the sample is random.
Classify as experiment, prospective observational study, retrospective observational study or census: researchers record the age at which every one of the 120 employees of a company started working there.
Show answer
A census: information is recorded from every individual in the population (all 120 employees).
In a study of 300 adults, researchers ask them about past exercise habits and then record their current blood pressure. Is this an experiment or an observational study? Why?
Show answer
An observational study (and retrospective for the exercise data): the researchers did not assign anyone to exercise levels; they recorded values.
A researcher randomly assigns 90 plants to receive no fertilizer, fertilizer A, or fertilizer B and measures growth. Identify the experimental units, the explanatory variable, the treatments and the response variable.
Show answer
Experimental units: the 90 plants. Explanatory variable: the type of fertilizer (three levels). Treatments: no fertilizer, fertilizer A, fertilizer B. Response variable: the growth of the plant.
A study finds that people who own a pet live longer, on average, than people who do not. Suggest a possible confounding variable and explain why it is one.
Show answer
One possibility is general health or exercise level (for example, healthier, more active people may be more likely to own a dog and also live longer). To be a confounder it must be associated with both pet ownership and life span, giving an alternative explanation for the relationship.
A radio station asks listeners to call in and says that 78% of callers favor a new stadium. For what population can the result be generalized?
Show answer
The callers volunteered, so the sample is not random. The result can be generalized only to people similar to those who called in, not to the whole city.
A conclusion about a population is only as good as the sample it comes from. The rest of the course depends on one idea: if the sample is chosen with a random mechanism, then probability tells us how far the sample is likely to be from the population, and inference is possible. This lesson describes the four standard random sampling methods, shows how to choose a simple random sample, and explains how to decide which method fits a given situation.
Required content · 1.11.A, 1.11.B
Learning objectives.
1.11.A. Identify a sampling method given a description of a study.
1.11.B. Justify the appropriateness of a sampling method.
Essential knowledge.
1.11.A.1. Sampling without replacement is a sampling strategy in which an observational unit from a population can be selected only once. The observational unit is not returned to the population before subsequent selections of observational units are made, so there is no chance that the observational unit can be selected again.
1.11.A.2. Sampling with replacement is a sampling strategy in which an observational unit from the population can be selected more than once. The observational unit is returned to the population before subsequent selections of observational units are made, so it is possible that the observational unit could be selected again.
1.11.A.3. In a simple random sample (SRS) of size n, every sample of the size n has the same chance of being selected. This method is the basis for many types of sampling mechanisms. There are several procedures to obtain a simple random sample; for example, using a random number generator or randomly selecting numbered slips of paper.
1.11.A.4. A stratified random sample involves the division of all individuals in a population into non-overlapping groups, called strata, based on one or more shared attributes or characteristics (homogeneous grouping). Within each stratum a simple random sample is selected, and the selected individuals are combined to form one sample.
1.11.A.5. A cluster random sample involves the division of a population into smaller groups, called clusters. Ideally, each cluster mirrors the heterogeneity of the population, with clusters similar to one another. A simple random sample of clusters is selected from the population to form the sample of clusters. Data are collected from all observational units in each of the selected clusters.
1.11.A.6. A systematic random sample is a method in which sample members from a population are selected according to a random starting point and a fixed, periodic interval between successive sampling units.
1.11.B.1. Each random sampling method has different characteristics that make it more appropriate for sampling populations depending on the question being investigated.
With and without replacement
Sampling without replacement means an observational unit can be selected only once: after a unit is chosen it is not returned to the population before the next selection, so there is no chance it can be chosen again. Sampling with replacement returns each selected unit to the population, so it is possible for the same unit to be selected more than once. Most real surveys sample without replacement (you do not interview the same person twice). When the sample is a small part of the population, the two ways behave almost identically, which is the reason for the "10% condition" you will meet in inference.
Simple random sample
In a simple random sample (SRS) of size \(n\), every sample of size \(n\) has the same chance of being selected. It is the basis for the other methods. Two common ways to choose one: write each unit's number on a slip of paper, mix thoroughly and draw \(n\) slips; or number the units and use a random number generator. On the TI-84, `randIntNoRep(1, N, n)` (MATH, PRB, 8:randIntNoRep) returns \(n\) different integers from 1 to \(N\) in random order; on a computer, a random sample function does the same.
Stratified random sample
A stratified random sample divides all the individuals in the population into non-overlapping groups called strata, based on one or more shared attributes or characteristics, so that the individuals in each stratum are alike (homogeneous grouping). Within each stratum a simple random sample is selected, and the selected individuals are combined into one sample. Strata might be grade levels, age groups, or regions. The strata should be groups that differ from one another on the variable of interest.
Cluster random sample
A cluster random sample divides the population into smaller groups called clusters. Ideally each cluster mirrors the heterogeneity of the whole population, so the clusters are similar to one another. A simple random sample of clusters is selected, and data are collected from every observational unit in each selected cluster. Clusters might be city blocks, classrooms or hospitals.
Systematic random sample
A systematic random sample selects members according to a random starting point and a fixed, periodic interval between successive units: for example, a random start and then every 15th unit.
Figure 1.21. Each grid is a population of 48 units; green squares are chosen. Stratified: a random sample within each row-group (strata). Cluster: whole randomly chosen groups (here, pairs of columns) with every unit in them. Systematic: a random start, then every fifth unit.
The easiest way to keep the methods apart is to ask what is random and what is certain. Stratified: every stratum is represented, with a random sample from each. Cluster: only some clusters are represented, but everyone within a chosen cluster is surveyed.
Choosing a method
Each random sampling method has characteristics that make it more appropriate for sampling certain populations, depending on the question being investigated.
Method
A good fit when...
Simple random sample
a complete list of the population exists and the population is fairly uniform; a simple baseline
Stratified
the population has groups that differ on the variable of interest (grades, regions), and you want each group represented and a more precise estimate
Cluster
the units come in natural groups that are alike one another, and it is cheaper or easier to survey whole groups (blocks, classrooms)
Systematic
the units come in an ordered list or line (an assembly line, a roster) and a random start with a fixed interval is easy to carry out
A systematic sample is not an SRS: after the random start the sample is fixed, so some groups of \(n\) units cannot occur together. Still, it is considered random because the start is chosen randomly.
Worked example · Selecting a simple random sample
A club has 200 members, numbered 1 to 200. Choose a simple random sample of 5. The calculator command `randIntNoRep(1,200,5)` returns 137, 24, 188, 92, 5. Which members are selected?
Members numbered 5, 24, 92, 137 and 188 are in the sample. Since the command returns distinct numbers, no member is chosen twice (sampling without replacement), and every group of 5 members had the same chance of being selected, which is what makes it a simple random sample. If a repeated number had appeared with a method that samples with replacement, you would simply discard it and draw again when you need distinct people.
Worked example · Which sampling method?
Identify the method used in each study. (a) A school lists students by grade (9, 10, 11, 12) and randomly selects 15 from each grade. (b) A researcher randomly selects 8 of a city's 40 blocks and surveys every household on those 8 blocks. (c) An inspector picks a random start among the first 10 items on an assembly line and then tests every 10th item. (d) All 300 employees are numbered and a random number generator picks 40.
(a) Stratified: the grades are the strata and an SRS is chosen in each. (b) Cluster: the blocks are the clusters, a random sample of clusters is chosen, and all households in them are surveyed. (c) Systematic: a random start and a fixed interval of 10. (d) Simple random sample: every set of 40 employees is equally likely.
Worked example · Systematic sampling
A list has \(N=600\) customers and a sample of \(n=40\) is wanted. Describe a systematic sample.
The interval is \(k=N/n=600/40=15\). Choose a random starting number from 1 to 15, say 7, and then select every 15th customer: 7, 22, 37, 52, and so on, up to \(7+39(15)=592\), giving exactly 40 customers. Every customer had a chance \(1/15\) of being the one chosen in his or her group of 15, but only 15 different samples are possible, so it is not a simple random sample.
Worked example · Why stratify?
A county has five towns whose household incomes differ greatly. The county wants to estimate the mean household income. Why might a stratified sample be better than a simple random sample?
A simple random sample could, by chance, include too many households from the richest or the poorest town and give a poor estimate. If the towns are the strata, the sample guarantees that every town is represented, and since the households within a town have similar incomes, the estimates from the strata vary less. Stratifying works best when the strata differ on the variable being studied and the units within each stratum are alike.
Exam focus
SRS: every sample of size \(n\) is equally likely. Stratified: SRS within each stratum (homogeneous groups). Cluster: SRS of clusters, then all units in each chosen cluster (clusters are alike each other). Systematic: random start, then a fixed interval \(k=N/n\).
Use a random mechanism (random number generator, `randIntNoRep`) to choose the units, and say how.
Justify the method with the situation: stratify when groups differ on the variable; cluster when groups are alike and whole groups are convenient; systematic for ordered lists or lines.
Sampling without replacement means a unit can be chosen only once.
Practice
A high school has 1,000 students: 400 freshmen, 300 sophomores, 200 juniors and 100 seniors. A stratified sample of 50 students uses grades as strata and takes a number proportional to the size of each grade. How many students come from each grade?
Show answer
The sample is 5% of the population: freshmen \(0.05(400)=20\), sophomores 15, juniors 10, seniors 5 (a total of 50). Within each grade an SRS of that size is selected.
Explain the difference between a stratified random sample and a cluster random sample.
Show answer
In a stratified sample the population is divided into groups that are alike inside (strata) and a random sample is taken from every stratum. In a cluster sample the population is divided into groups that each resemble the whole population (clusters), a random sample of some clusters is chosen, and everyone in the chosen clusters is surveyed.
A list of 900 voters is to be sampled with \(n=30\) using a systematic sample. What is the interval and how is the start chosen?
Show answer
The interval is \(k=900/30=30\). Choose a random start from 1 to 30 and then take every 30th voter on the list.
A teacher says: "I stood at the door and picked the first 10 students who came in, so I have a random sample." Is the teacher right? Why or why not?
Show answer
No. The first 10 students are a convenience sample, chosen by arrival order rather than by a random mechanism, so the method is not random and the sample may not represent the whole class (for example, early arrivals may be more punctual or may differ in other ways).
Describe how to use a calculator to select a simple random sample of 6 students from a class of 80 numbered 1 to 80.
Show answer
Number the students 1 to 80, then use `randIntNoRep(1,80,6)` to generate six different integers. The students with those numbers form the sample. (If you use `randInt` and a number repeats, discard it and draw again.)
A researcher wants to study the diet of the people living in a city that has 60 neighborhoods, each similar to the others in income and age. Interviewing everyone in a few randomly chosen neighborhoods would be cheaper than traveling across the whole city. Which method is this and why is it reasonable?
Show answer
This is a cluster random sample. It is reasonable because the neighborhoods (clusters) are alike one another and each reflects the whole city, and it is cheaper to survey all of the people in a few clusters.
A random sample is the best protection against a sample that misrepresents the population, but random selection is not enough by itself. A random method applied to the wrong list, a question worded to push an answer, or a survey that only some chosen people answer can still produce results that are consistently wrong. This lesson names the common sources of bias, shows how to describe the direction of the error, and explains why a bigger sample does not fix a biased method.
Required content · 1.12.A
Learning objective.
1.12.A. Identify potential sources of bias in sampling methods.
Essential knowledge.
1.12.A.1. Bias in a sampling method is a systematic error in the sampling procedure that results in a statistic being consistently larger or consistently smaller than the parameter the statistic is used to estimate.
1.12.A.2. Voluntary response bias is a bias that may occur when a sample consists entirely of volunteers.
1.12.A.3. Undercoverage bias may occur when the sampling method fails to include part of the population or a part of the population is less likely to be selected based on the sampling method.
1.12.A.4. Nonresponse bias may occur because of a failure to obtain responses from some individuals chosen to be sampled. The respondents and nonrespondents could differ significantly in ways that are important for the study.
1.12.A.5. Response bias may occur when responses to a survey or measurements of observational units tend to differ from the “true” value in one direction. Examples include questions that are confusing or leading (question wording bias) or self-reported responses.
1.12.A.6. Nonrandom sampling methods (e.g., samples chosen by convenience or voluntary response) introduce potential bias because they do not use random chance to select the individuals.
What bias is
Bias in a sampling method is a systematic error in the sampling procedure that results in a statistic being consistently larger or consistently smaller than the parameter it is used to estimate. Bias is not the same as the ordinary chance variation between random samples. Every sample statistic differs a little from the parameter; a biased method misses in the same direction almost every time.
Figure 1.22. Each dot is the sample percentage from one simulated sample. Bias means the estimates are systematically too high (or too low), not just that individual samples differ.
In the figure each dot is the percentage computed from one sample. With an unbiased method the dots scatter evenly around the true value; with a biased method they pile up on one side of it. Taking a larger sample makes the dots in each panel cluster more tightly, but it does not move the center, so a biased method gets a precise but wrong answer.
On the AP exam a complete answer about bias names the type of bias, explains how it affects the sample, and says whether the statistic will probably be too high or too low compared with the parameter. A claim about bias without a direction is not enough.
Types of bias
Type
What goes wrong
Example
Voluntary response bias
The sample consists entirely of volunteers, who tend to have stronger opinions
A radio station asks listeners to call in
Undercoverage bias
The sampling method fails to include part of the population, or part of it is less likely to be selected
A phone survey that dials only landlines
Nonresponse bias
Individuals chosen for the sample do not respond, and the respondents differ from the nonrespondents in important ways
A mail survey with a low return rate
Response bias
Responses or measurements tend to differ from the "true" value in one direction: confusing or leading questions (question wording bias), or self-reported answers
"Don't you agree that taxes are too high?"; asking people how much they exercise
Nonrandom methods
Samples chosen by convenience (whoever is easiest to reach) or by voluntary response are nonrandom methods. They introduce potential bias because they do not use random chance to select the individuals: the people who are easy to reach or who choose to answer may differ from everyone else. Notice the difference between undercoverage (some people had no chance to be chosen) and nonresponse (people were chosen but did not answer).
Worked example · Voluntary response
A radio station asks listeners to call in to say whether they support a new tax, and 78% of the 1,200 callers oppose it. Is this a good estimate of the proportion of all voters in the city who oppose the tax?
No. This is voluntary response bias: the people who call in are those who care most strongly, and people who oppose a tax are often more motivated to call. The sample may not represent the voters in the city. The sample proportion of 0.78 is probably too high compared with the true proportion of voters who oppose the tax. The large number of callers does not help, because the method is biased.
Worked example · Undercoverage with a direction
To estimate the proportion of adults in a city who own a smartphone, a researcher randomly dials landline phone numbers and calls adults who answer. Describe the bias and its likely direction.
The method has undercoverage bias: adults without a landline have no chance of being selected. People who have no landline tend to be younger, and younger adults are more likely to own a smartphone. The sample will therefore be missing many smartphone owners, so the estimated proportion is probably too low.
Worked example · Nonresponse
A store emails a satisfaction survey to 500 randomly chosen customers; 60 reply. Explain why the result may be biased and in which direction.
This is nonresponse bias: 440 of the chosen customers did not respond. People who had a bad experience may be more motivated to reply, so the respondents may differ from the nonrespondents in satisfaction. The percentage of satisfied customers among the 60 respondents is therefore probably too low as an estimate of the satisfaction of all 500 customers. The argument must say how respondents differ from nonrespondents and which way that pushes the estimate.
Worked example · Response bias
(a) A survey asks, "Don't you agree that the city should stop wasting money on parks?" (b) A study asks 100 students how many hours they study per week and records the answers. Identify the bias in each.
(a) Question wording bias (a type of response bias): the leading words push respondents to agree, so the percentage who favor cutting park funding is probably too high. (b) Response bias from self-reported data: students may exaggerate how much they study to look responsible, so the mean reported hours is probably too high. A neutral question and, when possible, an actual measurement would reduce the bias.
Exam focus
Bias is a systematic error that makes a statistic consistently too high or too low; a larger sample does not remove it.
Know the four types: voluntary response, undercoverage, nonresponse, response (wording and self-reporting). Convenience and voluntary response samples are nonrandom.
A complete bias answer names the type, explains the mechanism in context, and states the direction (too high or too low).
Do not confuse bias with natural sample-to-sample variability, and do not confuse undercoverage with nonresponse.
Practice
A student newspaper posts an online poll asking, "Do you support the new dress code?" and reports the percentage of the 300 students who clicked a response. Identify the type of bias and its likely direction.
Show answer
Voluntary response bias: only students who care enough to click respond, and students who dislike a new rule are usually more motivated to respond. The reported support is probably too low.
A researcher selects a random sample of students from the list of students enrolled in on-campus classes to find the mean number of hours per week students work at a job. Why might the estimate be biased, and which way?
Show answer
Undercoverage: students who take only online classes are not on the list and cannot be selected, and they probably work more hours. The estimated mean is probably too low.
A random sample of 400 residents is mailed a survey about a new park, and 70 return it. Explain how nonresponse could bias the result.
Show answer
Only 17.5% responded. The respondents may feel more strongly about the park (for example, those who dislike the park may respond more often) than the nonrespondents, so their percentage may not match that of all 400 residents. To justify a direction, argue about which group is more likely to respond.
Which is more serious for bias: a voluntary response sample of 5,000 or a random sample of 200? Explain.
Show answer
The voluntary sample, in general. Increasing the sample size does not reduce bias, because the problem is how the units were chosen. A random sample of 200 may vary more from the true value, but its errors are not systematically in one direction.
Rewrite the question "Wouldn't you say that the unfair school lunch prices should be lowered?" as a neutral question.
Show answer
"Do you think school lunch prices should be lowered, kept the same, or raised?" The new version does not suggest the answer, so it avoids question wording bias.
A survey uses a random number generator to choose students from a complete list, and every chosen student answers. Does this guarantee the estimate will not differ from the true value? Explain.
Show answer
No. A random method with full response avoids systematic bias, but the sample statistic still varies from sample to sample, so it will usually not equal the parameter exactly. Random selection removes bias; it does not remove sampling variability.
An experiment is the only kind of study that can show that one thing causes another. What gives an experiment that power is not the size of the sample or the care with which the data were measured, but how the treatments were assigned. This lesson lists the elements of a well-designed experiment, describes the three standard designs (completely randomized, randomized block and matched pairs), and explains exactly which conclusions a well-designed experiment supports and why.
Required content · 1.13.A, 1.13.B, 1.13.C, 1.13.D
Learning objectives.
1.13.A. Identify elements of a well-designed experiment.
1.13.B. Identify experimental designs.
1.13.C. Justify the appropriateness of a particular experimental design.
1.13.D. Justify the appropriateness of the conclusions based on a well-designed experiment.
Essential knowledge.
1.13.A.1. A well-designed experiment should include the following:
1.13.A.1.i. Comparisons of at least two treatment groups, one of which could be a control group
1.13.A.1.ii. Random assignment of treatments to experimental units
1.13.A.1.iii. Replication
1.13.A.1.iv. Direct control of potential extraneous sources of variation in the response
1.13.A.2. A control group is a collection of experimental units that are created for comparison. A control group may be given a treatment different from the treatment of interest to determine if the treatment of interest has an effect (e.g., a treatment with an inactive substance, a placebo, may be given).
1.13.A.3. The placebo effect is the difference between the average response to a placebo and the average response to no treatment.
1.13.A.4. In a single-blind, also called single-masked, experiment, participants do not know which treatment they are receiving, but members of the research team who interact with them know which treatment each participant is receiving, or vice versa.
1.13.A.5. In a double-blind, also called double-masked, experiment, neither the participants nor the members of the research team who interact with them know which treatment each participant is receiving.
1.13.A.6. An extraneous source of variation, also referred to as an extraneous variable, is a variable that is known (or believed) to affect the response but is not an explanatory variable being studied.
1.13.A.7. The purpose of random assignment is to create treatment groups that are as similar as possible with respect to extraneous sources of variation. If random assignment is successful, the respective distributions of each extraneous variable will be approximately the same for all the treatment groups.
1.13.A.8. A confounding variable in an experiment is a variable that is related to the explanatory variable in such a way that it is difficult to determine which variable, explanatory or confounding, is influencing the change in the response variable. However, in a well-designed experiment, the potential for confounding variables is reduced.
1.13.A.9. Replication within an experiment means more than one experimental unit is assigned to each treatment.
1.13.A.10. Direct control in an experiment means keeping the settings of certain potential extraneous sources of variation in the response variable the same from experimental unit to experimental unit.
1.13.B.1. In a completely randomized design, treatments are assigned to experimental units completely at random. Often the number of experimental units assigned to each treatment will be the same, but the sample sizes in each treatment do not have to be the same.
1.13.B.2. A blocking variable is a source of extraneous variation in the response variable. In a randomized block design, the experimental units are first grouped according to similar values of a blocking variable. These groups are called blocks. Units within the same block are homogeneous with respect to the blocking variable. After the blocks are formed, the treatments are randomly assigned to experimental units within each block so that all treatments occur within every block.
1.13.B.3. The purpose of blocking is to separate the variation in the response caused by the blocking variable from the rest of the extraneous variation in the response. Blocking allows for more precise comparisons of the response across the treatments. Within a block, the treatments can be compared without having to worry about variation in the response caused by changes in the blocking variable.
1.13.B.4. A matched pairs design is a randomized block design with only two treatments. Experimental units are arranged in pairs by matching on one or more extraneous sources of variation in the response variable. Each pair receives both treatments by randomly assigning one treatment to one member of the pair and the other treatment to the second member of the pair. Alternatively, each experimental unit may get both treatments while the order of the treatments is randomized.
1.13.C.1. One experimental design may be more appropriate than another experimental design based on the goals of the investigative study, the characteristics of the population, and the sample and variables involved.
1.13.D.1. Using random assignment of treatments to experimental units allows for cause-and-effect conclusions between the explanatory and the response variables because the potential for confounding variables is reduced.
1.13.D.2. Depending on the experimental unit, it may be unethical or difficult to randomly select experimental units to participate in an experiment. In that case, the study’s experimental units are obtained from volunteers and will represent the population of experimental units similar to those who participated in the study.
Elements of a well-designed experiment
A well-designed experiment should include:
Comparison of at least two treatment groups, one of which could be a control group.
Random assignment of treatments to experimental units.
Replication.
Direct control of potential extraneous sources of variation in the response.
Comparison and the control group. A control group is a collection of experimental units created for comparison. It may receive a treatment different from the treatment of interest, to find out whether the treatment of interest has an effect: for example an inactive substance, a placebo. The placebo effect is the difference between the average response to a placebo and the average response to no treatment; people often improve simply because they believe they are being treated.
Blinding. In a single-blind (single-masked) experiment, the participants do not know which treatment they are receiving, but members of the research team who interact with them do (or the reverse). In a double-blind (double-masked) experiment, neither the participants nor the members of the research team who interact with them know which treatment each participant receives. Blinding keeps expectations from influencing the responses or how they are measured.
Extraneous variables and confounding. An extraneous source of variation (extraneous variable) is a variable that is known or believed to affect the response but is not an explanatory variable being studied. A confounding variable in an experiment is related to the explanatory variable in such a way that it is difficult to tell which of the two is influencing the change in the response. In a well-designed experiment the potential for confounding is reduced.
Random assignment. The purpose of random assignment is to create treatment groups that are as similar as possible with respect to extraneous sources of variation. If random assignment is successful, the distribution of each extraneous variable is approximately the same in all the treatment groups, so differences in the response are not explained by those variables. Random assignment is done with a random mechanism: a random number generator, drawing numbered slips, or the flip of a coin.
Replication means that more than one experimental unit is assigned to each treatment. With replication we can see how much the response varies from unit to unit and can tell a real difference between treatments from chance variation.
Direct control means keeping the settings of certain potential extraneous sources of variation the same from experimental unit to experimental unit (the same soil, the same time of day, the same equipment).
Completely randomized design
In a completely randomized design the treatments are assigned to the experimental units completely at random. Often the same number of units is assigned to each treatment, but the groups do not have to be the same size.
Figure 1.23. In a completely randomized design all the experimental units are randomly assigned to the treatments, then the response in the groups is compared.
Randomized block design
A blocking variable is a source of extraneous variation in the response that we can identify ahead of time. In a randomized block design the experimental units are first grouped, according to similar values of a blocking variable, into blocks; units within a block are homogeneous with respect to the blocking variable. After the blocks are formed, the treatments are randomly assigned to units within each block, so that every treatment occurs in every block.
Figure 1.24. In a randomized block design the units are first grouped into blocks that are alike on a blocking variable. Treatments are then randomly assigned within each block, so every treatment appears in every block.
The purpose of blocking is to separate the variation in the response caused by the blocking variable from the rest of the extraneous variation. It allows more precise comparisons of the treatments: within a block, treatments can be compared without worrying about changes in the response caused by the blocking variable. (Blocking is to experiments what stratifying is to sampling.)
Matched pairs
A matched pairs design is a randomized block design with only two treatments. The units are arranged in pairs by matching on one or more extraneous sources of variation, and within each pair one unit gets one treatment and the other gets the other, decided at random. Alternatively, each experimental unit may receive both treatments, with the order of the treatments randomized.
Figure 1.25. A matched pairs design is a randomized block design with blocks of size two: within each pair, a coin flip decides which unit gets which treatment (or each unit receives both treatments in random order).
Worked example · A completely randomized design
A gardener wants to know whether a new fertilizer increases tomato yield compared with the usual fertilizer. Thirty tomato plants are available. Describe a completely randomized design.
Number the plants 1 to 30. Use `randIntNoRep(1,30,15)` to choose 15 plants at random to receive the new fertilizer; the other 15 receive the usual fertilizer (the control group). Each treatment is given to 15 plants, so the experiment is replicated. Use direct control: the same soil mix, the same amount of water and sunlight, and the same planting date for all the plants. After a set time, measure the yield of each plant in kilograms (the response variable) and compare the two groups. The random assignment spreads other differences among the plants (such as natural vigor) roughly evenly across the two groups.
Worked example · Choosing a block
A school compares two reading apps with 60 students. Reading ability strongly affects reading scores. Describe a randomized block design and explain why it is better than a completely randomized design here.
Block the students by reading level: 20 low, 20 middle and 20 high. Within each block, randomly assign 10 students to App 1 and 10 to App 2, so every treatment appears in every block. Comparing the apps within a block removes the large differences between a strong and a weak reader from the comparison. A completely randomized design could, by bad luck, put more strong readers in one group; blocking guarantees balance on reading level and gives a more precise comparison. The blocking variable (reading level) is a source of variation, not a treatment.
Worked example · A matched pairs design
A coach wants to compare two types of running shoes using 20 runners. Describe a matched pairs design.
Each runner will run a timed mile in both types of shoes, so each runner is a "pair" with himself or herself, and runner-to-runner differences in speed are removed from the comparison. For each runner, flip a coin to decide which shoes are worn first, to prevent the order (for example, fatigue) from favoring one shoe type. Record the difference in the two times for each runner (the response) and analyze the 20 differences.
Worked example · Placebo and blinding
A drug company tests a new medicine for headaches in 200 volunteers. Explain how a placebo and a double-blind design improve the experiment.
Half of the volunteers, chosen at random, get the new medicine and half get a placebo that looks the same. The placebo group controls for the placebo effect: some people feel better just because they are treated. In a double-blind design neither the volunteers nor the doctors who rate their headaches know who received which pill. That prevents participants' expectations and the evaluators' hopes from affecting the reported pain, so a difference in pain relief can be credited to the medicine itself.
What can be concluded
Using random assignment of treatments to experimental units allows cause-and-effect conclusions between the explanatory and the response variable, because the potential for confounding variables is reduced: the groups are alike on average in every other way. If the response differs between groups by more than we would expect from chance alone, the treatment is the plausible explanation.
Random assignment is not random selection. Random assignment says who gets which treatment; random selection says who is in the study. Depending on the experimental unit, it may be unethical or difficult to randomly select units for an experiment (you cannot randomly select people and force them into a trial). In that case the units are obtained from volunteers and represent the population of experimental units similar to those who participated in the study.
One design may be more appropriate than another depending on the goals of the study, the characteristics of the population, and the sample and the variables involved. When you justify a design on the exam, tie your reasoning to those features of the situation.
Worked example · Justifying the conclusion
In a study, 80 volunteers are randomly assigned to meditate daily or not, and after 8 weeks the meditators have significantly lower blood pressure. What can be concluded, and about whom?
Because the volunteers were randomly assigned to the treatments, the groups are expected to be similar on other variables, so the study supports the conclusion that meditation caused the lower blood pressure. Because the participants were volunteers, not a random sample, the conclusion applies only to people similar to those who volunteered, not to everyone. The exam answer should cite random assignment for the causal claim and the volunteer sample for the limit on generalization.
Exam focus
A well-designed experiment has at least two treatment groups (possibly a control/placebo), random assignment, replication and direct control.
Designs: completely randomized; randomized block (group by a blocking variable, then randomize within blocks); matched pairs (blocks of two, or each unit gets both treatments in random order).
Random assignment \(\Rightarrow\) cause-and-effect conclusions; random selection \(\Rightarrow\) generalization to the population. Do not mix up the two.
Blinding (single or double) and placebos guard against the placebo effect and biased measurement.
Practice
Describe how to randomly assign 40 mice to two diets using a random number generator.
Show answer
Number the mice 1 to 40. Use `randIntNoRep(1,40,20)` to choose 20 mice for Diet A; the remaining 20 get Diet B. This is a completely randomized design with replication (20 mice per treatment).
What is the purpose of random assignment in an experiment?
Show answer
To create treatment groups that are as similar as possible on extraneous variables, so the distributions of those variables are about the same in each group and differences in the response can be attributed to the treatments rather than to confounding variables.
A researcher compares two exercise programs for 90 adults. Age strongly affects fitness. Explain how blocking by age (under 30, 30 to 50, over 50) would work.
Show answer
Group the adults into three age blocks of 30. Within each block, randomly assign 15 people to each program. Each program then appears in every age block, and the comparison within each block is not affected by age.
What is the difference between a single-blind and a double-blind experiment?
Show answer
In a single-blind experiment, either the participants do not know their treatment (or the evaluators do not), but the other group knows. In a double-blind experiment neither the participants nor the researchers who interact with them or evaluate them know which treatment each participant received.
A study randomly assigns 50 volunteers to a new teaching method or the usual method and finds that scores are significantly higher with the new method. Can we conclude that the new method causes higher scores for all students everywhere? Explain.
Show answer
We can conclude that the new method caused the higher scores for participants like the volunteers, because treatments were randomly assigned. We cannot generalize to all students because the participants were volunteers and not a random sample of all students.
A student says, "Random assignment means we randomly picked the participants from the population." Correct the statement.
Show answer
Random assignment means treatments were assigned to the experimental units at random. Picking the participants from the population at random is random selection, which allows generalization to the population; random assignment allows cause-and-effect conclusions.
Unit 1 practice · 10 problems
Unit 1 practice: Exploring One-Variable Data and Collecting Data
Ten problems covering the whole unit: three multiple-choice questions in the style of Section I and seven free-response problems. Work each one on paper before revealing the answer: the reveal shows the key steps, not just the number.
A fitness app records, for each user: user ID number, age (years), average daily steps, hours of sleep per night, favorite activity (run, bike, swim, or walk), and number of workouts last week. Identify the individuals and classify each variable as categorical, quantitative discrete, or quantitative continuous.
Show answer
The individuals are the app's users. User ID is categorical (an identifier: averaging IDs means nothing). Favorite activity is categorical. Age and hours of sleep are quantitative and continuous (any value in a range is possible). Average daily steps and number of workouts last week are quantitative and discrete: they are counts. The test: if the average of the values would mean something, the variable is quantitative.
The distribution of household incomes in a city is strongly skewed right with several very high values. Which pair of statistics is the better summary of center and spread?
The mean and standard deviation are pulled toward the extreme high incomes, so they are not resistant and would misrepresent a typical household and the typical spread.
The median and IQR are resistant to outliers and skew, so they describe the center and spread of the bulk of the data. This is the standard choice for a skewed distribution.
The mean is pulled toward the long right tail. Mixing a non-resistant center with a resistant spread is also inconsistent: choose both from the same family.
The median is a good choice, but the standard deviation uses the mean and squared deviations, so it is inflated by the extreme incomes. Pair the median with the IQR.
A histogram of the sale prices (thousands of dollars) of 40 homes in a town has bars of height 14, 12, 7, 4, 2, and 1 over the intervals 100–200, 200–300, 300–400, 400–500, 500–600, and 600–700. Describe the shape of the distribution, state which interval contains the median, and explain whether the mean is greater than, less than, or about equal to the median.
Show answer
The distribution is unimodal and skewed right: the peak is in the 100–200 interval and the frequencies trail off in a long tail toward the expensive homes, with no gaps. The first bar holds 14 homes and the first two hold 26, so the 20th and 21st values, the median for \(n = 40\), fall in the 200–300 interval. The mean is greater than the median: the long right tail pulls the mean toward the high values (using bar midpoints, the mean is roughly \(277.5\) thousand dollars), while the median is resistant.
Nine quiz scores are 3, 7, 8, 9, 10, 11, 12, 15, 26. (a) Find the five-number summary and decide whether 26 is an outlier by the \(1.5\times\text{IQR}\) rule. (b) How do the mean and median change if 26 is removed?
Show answer
(a) The median is 10. The lower half (3, 7, 8, 9) has median \(Q_1=7.5\) and the upper half (11, 12, 15, 26) has median \(Q_3=13.5\), so the five-number summary is 3, 7.5, 10, 13.5, 26 and \(\text{IQR}=6\). The fences are \(7.5-9=-1.5\) and \(13.5+9=22.5\). Since \(26\gt22.5\), 26 is an outlier (and the upper whisker stops at 15). (b) The mean falls from \(101/9=11.2\) to \(75/8=9.4\), a change of 1.8, while the median falls only from 10 to 9.5. The median is resistant to the outlier; the mean is not.
Five-number summaries (minimum, \(Q_1\), median, \(Q_3\), maximum) for the final exam scores of two classes: Class A: 60, 72, 78, 85, 96. Class B: 45, 60, 72, 88, 98. Compare the distributions of the scores in the two classes.
Show answer
Class A's median (78) is higher than Class B's (72), so a typical student in A scored higher. Class B's scores are much more variable: its IQR is \(88-60=28\) compared with \(85-72=13\) for A, and its range is 53 compared with 36. Three quarters of the students in A scored above 72 (\(Q_1\)), but only half of those in B did (the median of B is 72). Class B also has the highest scores (maximum 98 and \(Q_3=88\) against 96 and 85 in A), so it has both more weak and more very strong performances. Neither distribution can be shown to have outliers from the five-number summary alone.
A school divides its students by grade level and then randomly selects 25 students from each grade to take a survey. Which type of sample is this?
In a simple random sample every group of students of the given size has the same chance to be chosen. Here the sample is forced to contain exactly 25 from each grade, so not every group is possible.
The population is divided into groups (strata) by grade, and a random sample is taken from every stratum. This is a stratified random sample.
In a cluster sample, whole groups are chosen at random and everyone in them is surveyed. Here individuals are chosen from every grade, not whole grades.
A systematic sample selects every \(k\)th individual after a random start. Nothing here involves a fixed interval.
A local radio station asks listeners to call in and say whether the city should build a new stadium; 78% of the 1,200 callers say yes. Name the type of bias, explain how it affects the result, and describe a better way to estimate the proportion of all city residents in favor.
Show answer
This is a voluntary response sample, which suffers from voluntary response bias: people with strong opinions (and radio listeners with the time to call) are far more likely to respond, so the callers are not representative of all residents and the 78% cannot be trusted as an estimate for the city. A large sample does not repair this. A better method is to take a simple random sample of residents (for example from a list of addresses), follow up with nonrespondents, and use neutral wording.
A gardener has 40 seedlings and wants to compare two fertilizers, A and B, by their effect on height after six weeks. Describe a completely randomized design, including how to carry out the randomization with a calculator, and explain why random assignment is important.
Show answer
The experimental units are the 40 seedlings, the treatments are fertilizers A and B, and the response variable is height after six weeks. Number the seedlings 01 to 40, generate 20 distinct random integers with randIntNoRep(1, 40, 20); those seedlings receive fertilizer A and the other 20 receive fertilizer B. Grow all under the same conditions and then compare mean heights. Random assignment tends to balance other variables, such as the seedlings' initial size or the sunlight each receives, between the groups, so that a difference in heights can be attributed to the fertilizers rather than to confounding variables.
Fifty volunteers are recruited for a study of a new sleep app, and 25 are randomly assigned to use the app while the other 25 do not. The app group sleeps significantly longer on average. What conclusion is justified, and what is not?
Show answer
Because the volunteers were randomly assigned, any difference not due to chance can be attributed to the app: there is convincing evidence that the app caused longer sleep for people like these volunteers. Because the volunteers were not randomly selected from a larger population, the conclusion cannot be generalized to all adults (or all app users); it applies only to people like the volunteers.
Which of the following is a statistic (rather than a parameter)?
This describes a characteristic of the whole population of students, so it is a parameter.
This describes the entire population of voters in the state, so it is a parameter.
This is computed from a sample of 400 voters, so it is a statistic (\(\hat p\)) used to estimate the population proportion.
All packages shipped this year form the population, so this is a parameter (\(\sigma\)).
Two categorical variables: tables, graphs, frequencies
Most interesting questions involve two variables at once. Do younger adults get their news from different sources than older adults? Is a patient's treatment related to whether they recover? When both variables are categorical, the data are summarized in a two-way table, and the question becomes whether the distribution of one variable changes across the categories of the other. This lesson shows how to build and read two-way tables, how to calculate joint, marginal and conditional relative frequencies, and how to use them (and a few graphs) to decide whether two variables are associated. It also lays the groundwork for conditional probability later in the unit.
2.1.A. Compare tabular and graphical representations for the relationship between two categorical variables.
2.1.B. Justify a claim using tabular and graphical representations for the distributions of two categorical variables.
2.2.A. Calculate summary statistics from two-way tables.
2.2.B. Compare summary statistics for two categorical variables.
2.2.C. Justify a claim using summary statistics for two categorical variables.
Essential knowledge.
2.1.A.1. A two-way table, also called a contingency table, can be used to summarize and compare data for two categorical variables. The entries in the cells of the table can be frequencies (i.e., counts) or relative frequencies (i.e., proportions).
2.1.A.2. Side-by-side bar charts, segmented bar charts, and mosaic plots are examples of graphs used to display the relationship between two categorical variables. In these graphs, the frequency or relative frequency of each category, or level, of one of the categorical variables is displayed for each category of the other categorical variable.
2.1.A.3. Graphical representations of two categorical variables can be used to compare the relationship of one categorical variable across the levels of the other categorical variable and determine whether the two variables are associated.
2.1.B.1. Tabular and graphical representations for the distributions of two categorical variables may reveal information that can be used to justify claims about the variable in context.
2.2.A.1. A joint relative frequency in a two-way table is a cell frequency divided by the total for the entire table.
2.2.A.2. A marginal relative frequency in a two-way table is a row total divided by the total for the entire table or a column total divided by the total for the entire table.
2.2.A.3. A conditional relative frequency is a relative frequency computed by restricting to a particular level, or category of interest. A conditional relative frequency can be a cell frequency in a row divided by the total for that row or it can be a cell frequency in a column divided by the total for that column.
2.2.B.1. Summary statistics for two categorical variables can be used to compare distributions for evidence of association between the two variables.
2.2.C.1. Summary statistics for two categorical variables may reveal information that can be used to justify claims about the variables in context.
Two-way tables
A two-way table, also called a contingency table, summarizes data for two categorical variables. One variable is displayed along the rows and the other along the columns, and each cell holds the number of observational units (the frequency) with that combination of categories. The entries may instead be relative frequencies (proportions).
Suppose 300 adults were asked for their age group and their main source of news.
Age group
Online
TV
Print
Total
18 to 34
90
35
5
130
35 to 54
50
40
10
100
55 and over
20
35
15
70
Total
160
110
30
300
The row totals and the column totals are on the "margins" of the table, and the grand total 300 is in the corner.
Three kinds of relative frequency
Dividing a count by a total gives a relative frequency, but which total you divide by changes the meaning. There are three kinds.
A joint relative frequency is a cell frequency divided by the total for the entire table. It describes the proportion of all the units that have both characteristics. For example, \(90/300=0.30\): 30% of all the adults are 18 to 34 and get their news mostly online.
A marginal relative frequency is a row total divided by the total for the entire table, or a column total divided by the total for the entire table. It describes one variable alone. For example, \(130/300\approx0.433\) of the adults are 18 to 34, and \(160/300\approx0.533\) get their news mostly online.
A conditional relative frequency is a relative frequency computed by restricting to a particular level, or category, of interest: a cell frequency in a row divided by the total for that row, or a cell frequency in a column divided by the total for that column. For example, among the 18 to 34 group, \(90/130\approx0.692\) mostly get news online.
The phrase "of those who...", "among...", or "given that..." in a question signals a conditional relative frequency, and the group named after those words is the denominator.
Graphs for two categorical variables
Side-by-side bar charts, segmented bar charts and mosaic plots display the relationship between two categorical variables. In each, the frequency or relative frequency of each category of one variable is displayed for each category of the other.
Figure 2.1. A segmented bar chart of the conditional distributions of news source within each age group. The segments are different in the three bars, which is evidence that age group and news source are associated.
In a segmented bar chart each bar is one category of one variable (here, an age group), and the segments within the bar show the conditional relative frequencies of the other variable, so every bar adds to 100%. A mosaic plot also makes the width of each column proportional to the size of its group.
Figure 2.2. In a mosaic plot the width of each column is proportional to the size of the group, and the heights within it show the conditional distribution of news source. It shows the group sizes and the association at once.
Association
Graphical representations of two categorical variables can be used to compare the distribution of one variable across the categories of the other and to determine whether the two variables are associated. Two categorical variables are associated when the conditional distributions of one variable are different for different categories of the other. If the conditional relative frequencies are essentially the same in every row, there is no evidence of an association.
In the news data, the conditional distributions of news source differ a lot across age groups (69% of the youngest group mostly get news online but only 29% of the oldest group do), so age group and news source appear to be associated. Be careful with the word: an association between the variables does not mean that one causes the other, and the strength of the evidence depends on how the data were collected and on the sample size.
Worked example · Joint, marginal and conditional relative frequencies
Use the news table to find (a) the proportion of all adults who are 55 and over and mostly use print; (b) the proportion of all adults who are 55 and over; (c) the proportion of those 55 and over who mostly use print; (d) the proportion of print users who are 55 and over.
(a) Joint: \(15/300=0.05\). (b) Marginal: \(70/300\approx0.233\). (c) Conditional (restricting to the 70 adults 55 and over): \(15/70\approx0.214\). (d) Conditional (restricting to the 30 print users, a column): \(15/30=0.50\). Parts (c) and (d) use the same cell, 15, but different totals, and they answer different questions: 21% of the older adults prefer print, but half of the print users are older adults.
Worked example · Do the conditional distributions differ?
Find the conditional distribution of news source for each age group and decide whether the variables appear to be associated.
Divide each row's cells by its row total: for 18 to 34, \(90/130=0.692\), \(35/130=0.269\), \(5/130=0.038\); for 35 to 54, \(0.50\), \(0.40\), \(0.10\); for 55 and over, \(20/70=0.286\), \(35/70=0.50\), \(15/70=0.214\). Each row sums to 1 (up to rounding). The distributions are quite different: online is the most common source for the two younger groups but TV is the most common source for the oldest group, and the share using print rises with age. The variables are associated, and this conclusion supports a claim such as "older adults are less likely than younger adults to get most of their news online."
Worked example · No association
In a survey, 80 of 100 men and 160 of 200 women said they own a smartphone. Is smartphone ownership associated with gender?
The conditional relative frequencies of owning a smartphone are \(80/100=0.80\) for men and \(160/200=0.80\) for women. They are the same, so the conditional distributions do not differ (and the same is true for not owning, 0.20 for both). Gender and smartphone ownership are not associated in these data. Notice that women outnumber men and own more phones (160 against 80), so counts alone would suggest a difference; relative frequencies, using each group's own total, show there is none.
Exam focus
A two-way table gives counts for combinations of two categorical variables; the margins are the totals.
Joint = cell \(\div\) table total. Marginal = row or column total \(\div\) table total. Conditional = cell \(\div\) the total of the row or column you are restricted to ("of those who...").
Compare the conditional distributions: if they differ, the variables are associated; if they are about the same, no association. Use relative frequencies, not counts.
Segmented bar charts and mosaic plots show the conditional distributions; association is not causation.
Practice
In the news table, find the joint relative frequency of "35 to 54" and "TV", and the marginal relative frequency of TV.
Show answer
Joint: \(40/300\approx0.133\). Marginal (column total 110): \(110/300\approx0.367\).
Among adults who mostly get news online, what proportion are 18 to 34?
Show answer
Restrict to the 160 online users: \(90/160=0.5625\), about 56%.
Of the 100 adults aged 35 to 54, what proportion mostly watch TV? Compare that with the proportion for all 300 adults.
Show answer
\(40/100=0.40\) for the 35 to 54 group, compared with \(110/300\approx0.367\) overall, so this age group is slightly more likely than adults overall to use TV as the main source.
A hospital records whether patients received treatment A or B and whether they recovered. Treatment A: 90 recovered, 30 did not. Treatment B: 140 recovered, 60 did not. Compute the conditional relative frequency of recovery for each treatment and say whether treatment and recovery appear to be associated.
Show answer
Treatment A: \(90/120=0.75\). Treatment B: \(140/200=0.70\). The recovery rates differ a little (75% against 70%), so there is a small association in these data; whether it is meaningful requires further analysis (and an experiment would be needed to claim A causes better recovery).
Why is it incorrect to conclude that treatment B is more effective than treatment A in the previous problem because 140 is greater than 90?
Show answer
The groups have different sizes (200 and 120), so counts are not comparable. The correct comparison uses the relative frequencies: 70% and 75% recovered.
A segmented bar chart for two variables shows bars with almost identical segments for every category of the explanatory variable. What does that suggest?
Show answer
The conditional distributions of the response variable are about the same for every category of the explanatory variable, which suggests the two variables are not associated.
Some probabilities are easy to calculate and some are not. If you cannot figure out an exact answer, or if you want to check one, you can simulate the random process: imitate it with random digits or a calculator thousands of times and see how often the event happens. This lesson defines the language of probability (random process, outcome, event), shows how to design and report a simulation, and explains why a simulation estimate gets better as the number of trials grows.
Required content · 2.3.A
Learning objective.
2.3.A. Estimate probabilities using simulations.
Essential knowledge.
2.3.A.1. A random process generates results that are determined by chance.
2.3.A.2. An outcome is the result of one trial of a random process.
2.3.A.3. An event is a collection of outcomes.
2.3.A.4. Simulation is a way to model random events such that simulated outcomes closely match real-world outcomes. All possible outcomes are associated with a value to be determined by chance. Record the counts of simulated outcomes and the count total.
2.3.A.5. The probability of an outcome or event is its long-run relative frequency, that is, its relative frequency over a large number of trials.
2.3.A.6. The relative frequency of an outcome or event determined from empirical data can be used to estimate the actual, or true, probability of that outcome or event.
2.3.A.7. The law of large numbers states that for independent trials, as the number of trials increases, the long-run relative frequency of the outcome or event gets closer and closer to a single value.
Random processes, outcomes and events
A random process generates results that are determined by chance: flipping a coin, rolling a die, selecting a student at random, a free throw. An outcome is the result of one trial of a random process. An event is a collection of outcomes. Rolling a die has six outcomes (1 through 6); the event "an even number" is the collection of outcomes \(\{2,4,6\}\).
Probability as long-run relative frequency
The probability of an outcome or event is its long-run relative frequency, that is, its relative frequency over a large number of trials. Relative frequencies from observed (empirical) data can be used to estimate the true probability of an outcome or event.
The law of large numbers states that for independent trials, as the number of trials increases, the long-run relative frequency of the outcome or event gets closer and closer to a single value.
Figure 2.3. The proportion of heads bounces around early (a few flips) and settles closer and closer to 0.5 as the number of flips grows. This is the law of large numbers: long-run relative frequency approaches the probability.
Two cautions follow. First, the law of large numbers is about the long run: a handful of trials can be far from the truth. Second, it does not say that the short run "evens out." After five heads in a row, the next flip is still heads with probability 0.5; the coin has no memory, and the proportion of heads settles toward 0.5 because the early imbalance is swamped by thousands of later flips, not because tails becomes more likely.
How to design a simulation
Simulation is a way to model random events so that simulated outcomes closely match real-world outcomes. All possible outcomes are associated with values to be determined by chance. Record the counts of simulated outcomes and the count total. A complete simulation describes five things:
The model. State the assumption you are making about the random process (such as "each free throw is made with probability 0.7, independently of the others").
Assign random digits (or random numbers) to outcomes in the right proportion: 7 of the 10 digits 0 to 9 for a 70% event.
One trial. Say what one repetition consists of, including how many digits it uses and when it stops.
Repeat for many trials and record the result of each.
Estimate the probability as the number of trials in which the event occurred divided by the total number of trials, and state the conclusion in context.
Digits can come from a random digit table or from a calculator command such as `randInt(0,9,4)` (4 random digits from 0 to 9) or `randInt(1,4)` (one random integer from 1 to 4).
Worked example · Estimating the chance of at least three of four free throws
A basketball player makes 70% of her free throws, each independent of the others. Estimate the probability that she makes at least 3 of her next 4.
Model: each shot is made with probability 0.7. Assignment: digits 0, 1, 2, 3, 4, 5, 6 mean "made" (7 of 10 digits) and 7, 8, 9 mean "missed." One trial: generate 4 digits and count how many are in 0 to 6. Repeat: ten trials produced
Trial
Digits
Shots made
1
7 2 9 4
2
2
3 6 4 8
3
3
3 7 5 6
3
4
8 9 3 4
2
5
8 5 8 1
2
6
3 7 2 8
2
7
3 6 0 5
4
8
6 7 1 2
3
9
5 6 5 5
4
10
3 5 6 6
4
Estimate: at least 3 shots were made in trials 2, 3, 7, 8, 9 and 10, which is 6 of 10 trials, so the estimated probability is \(6/10=0.60\). In context: "We estimate that there is about a 60% chance she makes at least 3 of her next 4 free throws." Ten trials is far too few to be reliable. A computer repeated the simulation 10,000 times and found the event in 6,524 trials, an estimate of about 0.652, which is much more trustworthy.
Worked example · Simulating the number of boxes
A cereal company puts one of four equally likely prizes in each box. Describe a simulation to estimate the average number of boxes you must buy to collect all four prizes, and interpret some results.
Let the digits 1, 2, 3, 4 stand for the four prizes and ignore digits 0 and 5 to 9 (or use `randInt(1,4)`). One trial: keep generating digits until all of 1, 2, 3 and 4 have appeared; record how many digits were needed. Six trials needed 23, 10, 7, 7, 5 and 9 boxes, so the mean of those six trials is \(61/6\approx10.2\) boxes. A computer ran 20,000 trials and the mean number of boxes was about 8.29. The few-trial estimate (10.2) was off by almost two boxes, while the 20,000-trial estimate is close to the theoretical value of about 8.33; this is the law of large numbers at work.
Worked example · Probability of at least one girl
Assume each child born is equally likely to be a boy or girl, independently. Describe a simulation to estimate the probability that a family with three children has at least one girl.
Use `randInt(0,1,3)` to generate three digits for the three children, where 0 means boy and 1 means girl. One trial is one set of three digits; the event of interest is that at least one digit is a 1. Eight trials gave 011, 000, 000, 010, 111, 110, 101 and 001, and the event occurred in 6 of the 8 trials, so the estimate is \(6/8=0.75\). In context: "about a 75% chance that a family with three children has at least one girl." (The exact value is \(1-(1/2)^3=0.875\); with only eight trials the estimate is rough, and with thousands of trials it would be close to 0.875.)
Worked example · What the law of large numbers does not say
A fair coin has landed heads six times in a row. A friend says, "Tails is due." Evaluate.
The flips are independent: the coin does not remember its previous results, so the probability of tails on the next flip is still 0.5. The law of large numbers says that the proportion of heads approaches 0.5 in the long run, which happens because the first six flips become a smaller and smaller part of the total, not because future flips compensate for the past.
Exam focus
A random process produces outcomes by chance; an event is a collection of outcomes.
The probability of an event is its long-run relative frequency. A simulation estimate is (number of trials with the event) \(\div\) (number of trials).
A simulation write-up: model, digit assignment, one trial, repeat many times, estimate in context.
Law of large numbers: for independent trials, long-run relative frequency approaches a single value. It does not mean past results are "made up for" later.
Practice
A spinner lands on blue 20% of the time. Describe how to use random digits to simulate one spin.
Show answer
Assign two of the ten digits (for example 0 and 1) to blue and the other eight (2 through 9) to the other colors. Generate one random digit per spin and record blue if it is 0 or 1.
Describe a simulation to estimate the probability that in a group of 3 randomly chosen people, at least 2 have birthdays in the same month, assuming the 12 months are equally likely.
Show answer
Use `randInt(1,12,3)` to generate three months. One trial is one set of three integers; the event occurs if at least two of the integers are equal. Repeat many times, and divide the number of trials with a repeated integer by the total number of trials.
In a simulation of 50 trials, the event occurred 18 times. Estimate the probability and say how you could make the estimate more reliable.
Show answer
\(18/50=0.36\). The estimate would be more reliable if the number of trials were increased (for example to 1,000 or more), because long-run relative frequency approaches the true probability.
A fair coin is flipped 10 times and lands heads 7 times. A student says the coin must be unfair. What does the law of large numbers say about this?
Show answer
Ten flips is a very small number of trials, and a result of 7 heads is not unusual for a fair coin. The law of large numbers describes behavior over a large number of trials; the proportion of heads in a few flips can be far from 0.5 purely by chance.
An event has probability 0.3. After 100 independent trials in which it happened 24 times, a student predicts that it must happen more often in the next 100 trials to "catch up." Is this correct?
Show answer
No. The trials are independent, so the chance of the event in each future trial is still 0.3. The relative frequency tends toward 0.3 because earlier results are diluted by the many later trials, not because the process adjusts.
What are the outcomes and one event when a fair six-sided die is rolled?
Show answer
The outcomes are the six faces 1, 2, 3, 4, 5, 6. One event is "the roll is greater than 4," which is the collection of outcomes \(\{5,6\}\).
Introduction to probability and mutually exclusive events
Simulation estimates a probability; the rules of probability let us calculate it exactly when the outcomes are equally likely or when events can be combined in simple ways. This lesson covers the sample space, the probability of an event and of its complement, the joint probability of two events, and the special case of mutually exclusive events. These are the building blocks for conditional probability, independence and the distributions that follow.
Required content · 2.4.A, 2.5.A
Learning objectives.
2.4.A. Calculate probabilities for events and their complements.
2.5.A. Justify why two events are mutually exclusive (or disjoint) using joint probability.
Essential knowledge.
2.4.A.1. The sample space of a random process is the set of all possible nonoverlapping outcomes. The probability of the sample space is 1.
2.4.A.2. If all outcomes in the sample space are equally likely, then the theoretical probability that an event \(E\) will occur is \(\dfrac{\text{number of outcomes in event }E}{\text{total number of outcomes in the sample space}}\). The probability of event \(E\) occurring is written as \(P(E)\).
2.4.A.3. The probability of an event is a number between 0 and 1, inclusive.
2.4.A.4. The probability of the complement of an event \(E\), which can be written as \(E'\), \(\bar E\), or \(E^C\) (i.e., the probability of “not \(E\)”), is equal to \(1-P(E)\).
2.5.A.1. The probability that events \(A\) and \(B\) both will occur, sometimes called the joint probability, is the probability of the intersection of \(A\) and \(B\). Joint probability is defined as \(P(A\cap B)\).
2.5.A.2. Two events are mutually exclusive, or disjoint, if they cannot occur at the same time. This means that if two events are mutually exclusive, then \(P(A\cap B)=0\).
Sample space and theoretical probability
The sample space of a random process is the set of all possible, nonoverlapping outcomes. The probability of the sample space is 1: some outcome must occur. If all outcomes in the sample space are equally likely, then the theoretical probability that an event \(E\) occurs is \[P(E)=\frac{\text{number of outcomes in event }E}{\text{total number of outcomes in the sample space}}.\] The probability of an event is a number between 0 and 1, inclusive. An event that cannot happen has probability 0; an event that is certain has probability 1.
Figure 2.4. The sample space for two fair dice has 36 equally likely outcomes. Each cell shows the sum; the six shaded cells are the event "the sum is 7."
The complement of an event
The complement of an event \(E\) is the event that \(E\) does not occur. It can be written \(E'\), \(\bar E\) or \(E^C\), and its probability (the probability of "not \(E\)") is \[P(E^C)=1-P(E).\] The complement rule is a shortcut for any event described with "at least one": the complement of "at least one" is "none," which is often easier to count.
Joint probability and mutually exclusive events
The probability that events \(A\) and \(B\) both occur is called the joint probability. It is the probability of the intersection of \(A\) and \(B\), written \(P(A\cap B)\) or \(P(A\text{ and }B)\).
Two events are mutually exclusive (or disjoint) if they cannot occur at the same time. If two events are mutually exclusive, then \(P(A\cap B)=0\). Conversely, you can show two events are mutually exclusive by showing their joint probability is 0.
Figure 2.5. Left: mutually exclusive (disjoint) events share no outcomes, so the joint probability is 0. Right: events that can happen together overlap, and the overlap is the joint probability \(P(A\cap B)\).
Be careful to keep "mutually exclusive" separate from "independent," which comes in a later lesson. Mutually exclusive events cannot happen together, so if one occurs you know the other did not, which means that knowing one event gives you a lot of information about the other. Events that can happen together (such as drawing a heart and drawing a king) are not mutually exclusive.
Worked example · Two dice
Two fair dice are rolled. Find (a) the probability that the sum is 7; (b) the probability that the sum is 10 or more; (c) the probability that the sum is not 7.
The sample space has \(6\times6=36\) equally likely ordered outcomes. (a) The sum is 7 for \((1,6),(2,5),(3,4),(4,3),(5,2),(6,1)\), which is 6 outcomes: \(P=6/36=1/6\). (b) A sum of 10, 11 or 12: \((4,6),(5,5),(6,4)\) for 10, \((5,6),(6,5)\) for 11, and \((6,6)\) for 12, which is 6 outcomes: \(P=6/36=1/6\). (c) By the complement rule, \(P(\text{not }7)=1-1/6=5/6\).
Worked example · The complement shortcut
A fair coin is flipped three times. What is the probability of at least one head?
"At least one head" is awkward to list, but its complement, "no heads" (all tails), has a single outcome, TTT, out of the 8 equally likely outcomes. So \(P(\text{no heads})=1/8\) and \(P(\text{at least one head})=1-1/8=7/8\). In context: there is an 87.5% chance of getting at least one head in three flips.
Worked example · Mutually exclusive or not?
One card is drawn from a standard deck of 52 cards. Let \(A\) be "the card is a heart," \(B\) "the card is a spade" and \(C\) "the card is a king." Are \(A\) and \(B\) mutually exclusive? Are \(A\) and \(C\)?
\(A\) and \(B\): a single card cannot be both a heart and a spade, so \(P(A\cap B)=0\) and the events are mutually exclusive. \(A\) and \(C\): the king of hearts is both a heart and a king, so \(P(A\cap C)=1/52\), which is not 0, and the events are not mutually exclusive. (Using \(P(A\cup B)=P(A)+P(B)-P(A\cap B)\), a later lesson, the probability of a heart or a king is \(13/52+4/52-1/52=16/52\).)
Worked example · A table of outcomes
A bag contains 5 red, 3 blue and 2 green marbles. One marble is drawn at random. Find \(P(\text{red})\), \(P(\text{not red})\) and decide whether "red" and "blue" are mutually exclusive.
There are 10 marbles, all equally likely to be chosen. \(P(\text{red})=5/10=0.5\), and \(P(\text{not red})=1-0.5=0.5\) (blue or green: \(3/10+2/10\)). A marble cannot be both red and blue, so "red" and "blue" are mutually exclusive, and \(P(\text{red and blue})=0\).
Exam focus
Sample space: all possible, nonoverlapping outcomes; its probability is 1. For equally likely outcomes, \(P(E)=\dfrac{\text{outcomes in }E}{\text{outcomes in the sample space}}\), and \(0\le P(E)\le1\).
Complement: \(P(E^C)=1-P(E)\). Use it for "at least one."
Joint probability \(P(A\cap B)\): both occur. Events are mutually exclusive if \(P(A\cap B)=0\).
Do not confuse mutually exclusive (cannot happen together) with independent (covered later).
Practice
Two fair dice are rolled. Find the probability that the sum is even.
Show answer
There are 18 even sums out of 36 equally likely outcomes, so \(P=18/36=1/2\).
A fair die is rolled twice. Find the probability of getting a 6 at least once.
Show answer
Complement: no 6 on either roll has probability \((5/6)(5/6)=25/36\), so \(P(\text{at least one 6})=1-25/36=11/36\approx0.306\).
If \(P(A)=0.35\), what is the probability of the complement of \(A\)?
Show answer
\(P(A^C)=1-0.35=0.65\).
Events \(A\) and \(B\) have \(P(A)=0.4\), \(P(B)=0.3\) and \(P(A\cap B)=0\). What can you conclude about \(A\) and \(B\)?
Show answer
Because the joint probability is 0, the events are mutually exclusive (disjoint): they cannot occur together.
A card is drawn from a standard deck. Are the events "a face card (J, Q, K)" and "a red card" mutually exclusive? Justify with a probability.
Show answer
No. There are 6 red face cards, so \(P(\text{face and red})=6/52\), which is not 0, so the events can occur together.
A student claims, "If two events are mutually exclusive, they are independent." Explain, using the fact about their joint probability, why this is a poor way to think about them.
Show answer
Mutually exclusive events cannot both happen, so if one occurs the other certainly does not. That is the opposite of independence, where knowing one event gives no information about the other (unless one of the events has probability 0).
Probabilities change when you learn something new. The chance that a randomly chosen adult mostly gets news online is one number; the chance that a randomly chosen 18 to 34 year old does is a different, higher one. A conditional probability is the probability of an event given that you know another event has happened. This lesson defines it, connects it to the conditional relative frequencies from two-way tables, and gives the multiplication rule for the probability that two events both occur.
Required content · 2.6.A
Learning objective.
2.6.A. Calculate conditional probabilities.
Essential knowledge.
2.6.A.1. The probability that event \(A\) will occur given that event \(B\) has occurred is called a conditional probability and is written as \(P(A\mid B)\). Conditional probability is defined as \(P(A\mid B)=\dfrac{P(A\cap B)}{P(B)}\).
2.6.A.2. The general multiplication rule states that the probability that events \(A\) and \(B\) both will occur is equal to the probability that event \(A\) will occur multiplied by the conditional probability that event \(B\) will occur given that event \(A\) has occurred. The multiplication rule is defined as \(P(A\cap B)=P(A)\cdot P(B\mid A)\).
Conditional probability
The probability that event \(A\) occurs given that event \(B\) has occurred is called a conditional probability, written \(P(A\mid B)\) and read "the probability of \(A\) given \(B\)." It is defined as \[P(A\mid B)=\frac{P(A\cap B)}{P(B)}.\] Knowing that \(B\) happened shrinks the sample space to \(B\); the conditional probability asks what fraction of \(B\) is also in \(A\). From a two-way table of counts, \(P(A\mid B)\) is the count in the cell for "both" divided by the total for the row or column of \(B\), exactly the conditional relative frequency of the last lesson. For equally likely outcomes, \(P(A\mid B)\) is the fraction of the outcomes in \(B\) that are also in \(A\).
Notice that \(P(A\mid B)\) and \(P(B\mid A)\) are different things. The probability that a person who has the flu has a fever is high; the probability that a person with a fever has the flu is much lower. When you read a conditional probability, the event after the bar is the group you are restricted to, and it is the denominator.
The general multiplication rule
Rearranging the definition gives the general multiplication rule: the probability that events \(A\) and \(B\) both occur is the probability that \(A\) occurs multiplied by the conditional probability that \(B\) occurs given that \(A\) has occurred. \[P(A\cap B)=P(A)\cdot P(B\mid A).\] It works for any two events, including dependent ones, and it is the rule behind a tree diagram: each branch carries a probability (conditional on the branches before it), and multiplying along a path gives the joint probability of that path.
Figure 2.6. A tree diagram: the first branches give P(A) and P(B); the second branches give the conditional probabilities. Multiplying along a path gives a joint probability, such as \(P(A\cap\text{defective})=0.60(0.02)=0.012\).
Worked example · Conditional probability from a table
In the news survey of 300 adults, 130 are 18 to 34, 160 mostly get news online, and 90 are both. Find \(P(\text{online}\mid 18\text{ to }34)\) and \(P(18\text{ to }34\mid\text{online})\).
\(P(\text{online and }18\text{ to }34)=90/300=0.30\) and \(P(18\text{ to }34)=130/300\approx0.433\), so \[P(\text{online}\mid18\text{ to }34)=\frac{0.30}{0.433}\approx0.692.\] This is the same as \(90/130\), the fraction of the 18 to 34 group who are online. Reversing the question, \(P(18\text{ to }34\mid\text{online})=\dfrac{90/300}{160/300}=\dfrac{90}{160}=0.5625\). The two conditional probabilities are different because they restrict to different groups (130 young adults, or 160 online users).
Worked example · The multiplication rule with a tree
A factory has two machines. Machine A makes 60% of the items and 2% of its items are defective. Machine B makes 40% of the items and 5% of its items are defective. An item is chosen at random. Find (a) the probability that it came from machine A and is defective; (b) the probability that it is defective; (c) the probability that it came from machine A given that it is defective.
(a) \(P(A\cap\text{defective})=P(A)\cdot P(\text{defective}\mid A)=0.60(0.02)=0.012\). (b) The item is defective by one of two paths that cannot occur together: machine A and defective (0.012) or machine B and defective, \(0.40(0.05)=0.020\). So \(P(\text{defective})=0.012+0.020=0.032\). (c) Using the definition of conditional probability, \[P(A\mid\text{defective})=\frac{P(A\cap\text{defective})}{P(\text{defective})}=\frac{0.012}{0.032}=0.375.\] Although machine A makes 60% of the items, only 37.5% of the defective items come from it, because machine B's defect rate is higher.
Worked example · Without replacement
A bag has 4 red and 6 blue marbles. Two marbles are drawn one after the other without replacement. Find the probability that both are red.
\(P(\text{first red})=4/10\). Given that the first was red, 3 red marbles remain among 9, so \(P(\text{second red}\mid\text{first red})=3/9\). By the general multiplication rule, \(P(\text{both red})=\dfrac{4}{10}\cdot\dfrac{3}{9}=\dfrac{12}{90}\approx0.133\). The second probability depends on the first draw, which is why the general rule (with a conditional probability) is needed.
Exam focus
\(P(A\mid B)=\dfrac{P(A\cap B)}{P(B)}\). The event after the bar is the group you restrict to (the denominator). In a two-way table it is the cell divided by the row or column total.
General multiplication rule: \(P(A\cap B)=P(A)\cdot P(B\mid A)\). Multiply along branches of a tree diagram.
\(P(A\mid B)\ne P(B\mid A)\) in general: say clearly which group you are conditioning on.
On the exam, show the formula, the values you substitute, and the answer in context.
Practice
In a school, 40% of students play a sport and 25% play a sport and are in the band. Find the probability that a student is in the band given that the student plays a sport.
Show answer
In the news survey (300 adults), 110 mostly watch TV and 35 of them are 18 to 34. Find \(P(18\text{ to }34\mid\text{TV})\).
Show answer
\(35/110\approx0.318\).
For the factory in the lesson, find the probability that an item came from machine B given that it is defective.
Show answer
\(P(B\mid\text{defective})=\dfrac{0.40(0.05)}{0.032}=\dfrac{0.020}{0.032}=0.625\), which is \(1-0.375\) as it must be.
A student says "\(P(\text{rain}\mid\text{clouds})\) and \(P(\text{clouds}\mid\text{rain})\) are the same thing." Explain why this is wrong.
Show answer
The first restricts to cloudy days and asks what fraction have rain; the second restricts to rainy days and asks what fraction are cloudy. Almost every rainy day is cloudy, but many cloudy days are dry, so the probabilities are generally different.
Of the students in a class, 60% have a laptop. Among those with a laptop, 80% bring it to class. Find the probability that a randomly chosen student has a laptop and brings it.
Show answer
Two events are independent when knowing that one occurred does not change the probability of the other. Independence is what makes it legitimate to multiply probabilities of separate trials, and it is a claim you can test with data. This lesson gives the definition and the test for independence, the multiplication rule for independent events, and the addition rule for the probability that at least one of two events occurs (a union).
Required content · 2.7.A
Learning objective.
2.7.A. Calculate probabilities for independent events and for the union of two events.
Essential knowledge.
2.7.A.1. Events \(A\) and \(B\) are independent if and only if knowing whether event \(A\) has occurred (or will occur) does not change the probability that event \(B\) will occur. When events \(A\) and \(B\) are independent, then \(P(A\mid B)=P(A)\) and \(P(B\mid A)=P(B)\).
2.7.A.2. The probability that event \(A\) or event \(B\) (or both) will occur is the probability of \(A\) union \(B\). The probability of the union is defined as \(P(A\cup B)\).
2.7.A.3. \(P(A\cup B)=P(A)+P(B)-P(A\cap B)\).
Independent events
Events \(A\) and \(B\) are independent if knowing whether \(A\) occurs does not change the probability that \(B\) occurs. In symbols, \(A\) and \(B\) are independent if and only if \[P(A\mid B)=P(A)\qquad\text{(equivalently }P(B\mid A)=P(B)\text{).}\] Because the general multiplication rule says \(P(A\cap B)=P(A)\cdot P(B\mid A)\), independence turns it into the multiplication rule for independent events: \[P(A\cap B)=P(A)\cdot P(B)\quad\text{if }A\text{ and }B\text{ are independent.}\] This also works as a test: to decide whether two events are independent, check whether \(P(A\cap B)=P(A)\cdot P(B)\), or whether \(P(A\mid B)=P(A)\). If the equality fails, the events are dependent. The rule extends to more than two independent events: the probability that all of them occur is the product of their probabilities.
Independence is usually assumed for separate flips of a coin, separate rolls of a die, or sampling with replacement; and it is a reasonable approximation for random samples that are small compared with the population (the 10% condition you will use later).
The addition rule and unions
The event "\(A\) or \(B\)" (at least one of the two occurs) is the union of \(A\) and \(B\), written \(A\cup B\). In statistics, "or" is inclusive: it includes the case where both occur. The addition rule is \[P(A\cup B)=P(A)+P(B)-P(A\cap B).\] We subtract the joint probability because outcomes in both events were counted twice, once in \(P(A)\) and once in \(P(B)\). If \(A\) and \(B\) are mutually exclusive, then \(P(A\cap B)=0\) and the rule simplifies to \(P(A\cup B)=P(A)+P(B)\).
"At least one" problems
For independent trials, the probability of at least one success is easiest with the complement: \(P(\text{at least one})=1-P(\text{none})\), and \(P(\text{none})\) is a product of the probabilities of failing each time.
Worked example · Testing independence from a table
In the news survey of 300 adults (Lesson 2.1), 160 mostly get news online, 130 are 18 to 34, and 90 are both. Are "mostly online" and "18 to 34" independent?
\(P(\text{online})=160/300\approx0.533\) and \(P(\text{online}\mid18\text{ to }34)=90/130\approx0.692\). These are not equal, so the events are not independent: knowing that a person is 18 to 34 raises the probability that they mostly get news online. (Equivalently, \(P(\text{online})\cdot P(18\text{ to }34)\approx0.533(0.433)=0.231\), but the joint probability is \(90/300=0.30\).)
Worked example · Independent events and the multiplication rule
A basketball player makes 70% of her free throws, with shots independent of each other. Find the probability that (a) she makes her next three; (b) she misses at least one of her next three.
(a) \(P(\text{three makes})=0.7\times0.7\times0.7=0.343\). (b) "Misses at least one" is the complement of "makes all three," so \(P=1-0.343=0.657\). Compare the simulation estimate of 0.652 in Lesson 2.2 for "at least 3 of 4": different event, same method.
Worked example · The addition rule
At a school, 50% of students take a music class (\(M\)), 40% take an art class (\(A\)), and 20% take both. Find the probability that a student takes music or art, and decide whether the events are independent.
\(P(M\cup A)=0.50+0.40-0.20=0.70\), so 70% take at least one of the two. For independence, \(P(M)\cdot P(A)=0.50(0.40)=0.20\), which equals \(P(M\cap A)=0.20\), so the events are independent. (Check: \(P(A\mid M)=0.20/0.50=0.40=P(A)\).)
Worked example · At least one of five
A multiple-choice test has 5 questions, each with 5 choices. A student guesses on every question. Find the probability of getting at least one correct, assuming guesses are independent.
\(P(\text{wrong on one question})=4/5=0.8\), so \(P(\text{all five wrong})=0.8^5=0.32768\) and \(P(\text{at least one correct})=1-0.32768=0.67232\approx0.672\). In context: there is about a 67% chance that pure guessing gets at least one question right.
Worked example · A union from a table
In the news survey, find the probability that a randomly chosen adult is 18 to 34 or mostly gets news online.
\(P(18\text{ to }34)=130/300\), \(P(\text{online})=160/300\), \(P(\text{both})=90/300\), so \(P(18\text{ to }34\text{ or online})=\dfrac{130+160-90}{300}=\dfrac{200}{300}\approx0.667\). Adding the two row and column totals would count the 90 people in both categories twice, so we subtract them once.
Exam focus
Independent: \(P(A\mid B)=P(A)\), or \(P(A\cap B)=P(A)P(B)\). Test it with numbers; if either equality fails the events are dependent.
Addition rule: \(P(A\cup B)=P(A)+P(B)-P(A\cap B)\), where "or" includes both. Mutually exclusive: just add.
At least one: \(1-P(\text{none})\).
Do not confuse independent with mutually exclusive: mutually exclusive events with positive probabilities are never independent.
Practice
\(P(A)=0.5\), \(P(B)=0.3\), and \(A\) and \(B\) are independent. Find \(P(A\cap B)\) and \(P(A\cup B)\).
Show answer
\(P(A)=0.4\), \(P(B)=0.5\) and \(P(A\cup B)=0.6\). Find \(P(A\cap B)\) and decide whether \(A\) and \(B\) are independent.
Show answer
\(P(A\cap B)=0.4+0.5-0.6=0.3\). Since \(P(A)P(B)=0.20\ne0.30\), the events are not independent.
A fair coin is flipped four times. Find the probability of at least one head.
Show answer
\(1-(1/2)^4=1-1/16=15/16\approx0.938\).
In a survey, 80 of 100 men and 160 of 200 women own a smartphone (Lesson 2.1). Are gender and ownership independent? Justify.
Show answer
\(P(\text{owns}\mid\text{man})=0.80\) and \(P(\text{owns}\mid\text{woman})=0.80\), both equal to the overall \(P(\text{owns})=240/300=0.80\), so the events are independent.
Events \(A\) and \(B\) are mutually exclusive and \(P(A)=0.3\), \(P(B)=0.2\). Find \(P(A\cup B)\) and say whether the events are independent.
Show answer
\(P(A\cup B)=0.3+0.2=0.5\). They are not independent: \(P(A\cap B)=0\), but \(P(A)P(B)=0.06\ne0\); if \(A\) occurs, \(B\) certainly does not.
A machine part has a 2% chance of failing in a year and parts fail independently. A device has 10 such parts. Find the probability that no part fails in a year.
Show answer
So far, probabilities have been attached to events. A random variable attaches a number to each outcome of a random process, which lets us describe the whole pattern of chance with a table, a graph or a formula, and summarize it with a mean and a standard deviation. This lesson defines discrete random variables and their probability distributions, shows how to use them to find probabilities, and describes what a distribution looks like.
Required content · 2.8.A
Learning objective.
2.8.A. Construct a probability distribution for a discrete random variable.
Essential knowledge.
2.8.A.1. A random variable is a variable whose values have numerical outcomes that result from a random phenomenon.
2.8.A.2. A probability distribution for a discrete random variable shows the probability associated with every possible value of the random variable. The sum of the probabilities over all possible values of a discrete random variable is 1.
2.8.A.3. A discrete probability distribution can be determined using the rules of probability or estimated with a simulation.
2.8.A.4. A discrete probability distribution can be represented as a graph, table, or function showing the probabilities associated with values of a random variable.
2.8.A.5. A cumulative probability distribution can be represented as a table or function and shows the probability of being less than or equal to each value of the discrete random variable.
Random variables
A random variable is a numerical value that is assigned to each outcome of a random process (or to the result of a random sample or experiment). It is usually named with a capital letter such as \(X\); a particular value is written with a lowercase letter such as \(x\). A random variable is discrete if its possible values can be listed (usually counts: 0, 1, 2, 3, ...). A random variable is continuous if it can take any value in an interval (heights, times, weights). This lesson concerns discrete random variables; the normal distribution later in the unit is a continuous one.
Examples: \(X\) = the number of cars in a randomly chosen household; \(X\) = the number of heads in three flips of a coin; \(Y\) = the amount won in a raffle.
Probability distributions
The probability distribution of a discrete random variable lists every possible value together with its probability. It can be given as a table, a probability histogram or a formula. Two requirements must hold: every probability is between 0 and 1, and the probabilities add to 1. Here is the distribution of \(X\), the number of cars in a household.
\(x\)
0
1
2
3
4
\(P(X=x)\)
0.08
0.35
0.38
0.14
0.05
The probabilities add to \(0.08+0.35+0.38+0.14+0.05=1\), so this is a valid distribution. The same information in graphical form is a probability histogram, with a bar at each value whose height is its probability.
Figure 2.7. A probability histogram of a discrete random variable: each bar is the probability of one value, and the heights add to 1.
Finding probabilities
Because the values of a discrete random variable are mutually exclusive, the probability that \(X\) falls in a set of values is the sum of the individual probabilities. The probability of "\(X\) is at least 2" is \(P(X\ge2)=P(2)+P(3)+P(4)\). By the complement rule, \(P(X\ge1)=1-P(X=0)\).
The cumulative distribution gives \(P(X\le x)\), the running total of the probabilities, and is useful for "at most" questions.
Figure 2.8. The cumulative distribution gives \(P(X\le x)\). It steps up at each possible value and reaches 1 at the largest value.
Describing a distribution
As with a distribution of data (Unit 1), describe the shape (symmetric or skewed, unimodal or bimodal), center and variability of a probability distribution, and mention unusual features. The cars distribution is roughly symmetric around 1.7 with a peak at 2 and a small right tail; the next lesson shows how to compute its mean and standard deviation.
Worked example · Checking and using a distribution
Use the cars distribution to find (a) \(P(X\ge2)\); (b) \(P(X\le1)\); (c) \(P(1\le X\le3)\); (d) the probability that a household has more than 4 cars.
(a) \(P(X\ge2)=0.38+0.14+0.05=0.57\). (b) \(P(X\le1)=0.08+0.35=0.43\) (the cumulative probability at 1). (c) \(P(1\le X\le3)=0.35+0.38+0.14=0.87\). (d) Five or more cars is not a possible value, so the probability is 0. As a check on (a) and (b): \(0.57\) and \(0.43\) are complements, \(0.57+0.43=1\).
Worked example · Building a distribution
A fair coin is flipped three times and \(X\) is the number of heads. Give the probability distribution of \(X\).
The sample space has 8 equally likely outcomes. \(X=0\) for TTT (1 outcome), \(X=1\) for HTT, THT, TTH (3), \(X=2\) for HHT, HTH, THH (3), and \(X=3\) for HHH (1). So
\(x\)
0
1
2
3
\(P(X=x)\)
1/8
3/8
3/8
1/8
The probabilities sum to 1, and the distribution is symmetric with its center at 1.5.
Worked example · A missing probability
The probability distribution of \(X\), the number of times a student is late in a week, is given below. Find \(k\) and then \(P(X\ge3)\).
\(x\)
0
1
2
3
4
\(P(X=x)\)
0.40
0.30
0.20
\(k\)
0.04
The probabilities must add to 1: \(0.40+0.30+0.20+k+0.04=1\), so \(k=1-0.94=0.06\). Then \(P(X\ge3)=0.06+0.04=0.10\).
Worked example · Discrete or continuous?
Classify each random variable as discrete or continuous: (a) the number of text messages you receive in an hour; (b) the time a bus takes to arrive; (c) the number of free throws made out of 10.
(a) Discrete (a count: 0, 1, 2, ...). (b) Continuous (a time can be any value in an interval). (c) Discrete (0 through 10).
Exam focus
A random variable assigns a number to each outcome; a discrete one has countable values, a continuous one takes any value in an interval.
A probability distribution lists the values and their probabilities; each probability is between 0 and 1 and the probabilities sum to 1.
\(P(X\in\text{set})\) is a sum; use complements for "at least" and the cumulative distribution for "at most."
Describe a distribution by shape, center, variability and unusual features, in context.
Practice
The distribution of \(X\), the number of pets in a household, has \(P(0)=0.30\), \(P(1)=0.35\), \(P(2)=0.20\), \(P(3)=0.10\) and \(P(4)=k\). Find \(k\) and \(P(X\ge2)\).
Show answer
Classify as discrete or continuous: the weight of a randomly chosen apple; the number of apples in a bag.
Show answer
The weight is continuous; the number of apples is discrete.
A student claims "since \(P(X=2)=0.38\) is the largest probability, 2 is the mean of the distribution." Is this correct in general?
Show answer
No. The value with the largest probability is the mode. The mean takes every value and its probability into account, and for a skewed distribution it differs from the mode (the next lesson calculates it: for the cars distribution it is 1.73).
A distribution of chance can be summarized by two numbers, just as a distribution of data can. The mean (or expected value) of a random variable is its long-run average, and its standard deviation measures the typical distance of a value from that mean. These are parameters: fixed numbers that describe a probability distribution or a population. This lesson shows how to calculate and interpret both for a discrete random variable, using the cars distribution and a raffle.
Required content · 2.9.A, 2.9.B
Learning objectives.
2.9.A. Calculate the mean and standard deviation for a discrete random variable.
2.9.B. Interpret the mean and standard deviation for a discrete random variable.
Essential knowledge.
2.9.A.1. A numerical value measuring a characteristic of a probability distribution of a random variable, or a population, is a parameter. The value of a parameter is a single, fixed value.
2.9.A.2. The expected value (or mean) of a probability distribution is a parameter and is denoted by \(E(X)\) or \(\mu_X\). For a discrete random variable \(X\), the expected value is calculated as \(\mu_X=\sum x_i\cdot P(x_i)\), where \(x_i\) is the possible value of the random variable and \(P(x_i)\) is the probability of the possible value of the random variable. The expected value can be interpreted as the long-run average outcome of the random variable. The discrete random variable can only take on values that are countable or finite.
2.9.A.3. The standard deviation of a probability distribution is a parameter represented by \(SD(X)\) or \(\sigma_X\). For a discrete random variable \(X\), the standard deviation is calculated as \(\sigma_X=\sqrt{\sum(x_i-\mu_X)^2\cdot P(x_i)}\), where \(x_i\) is the possible value of the random variable, \(\mu_X\) is the mean, and \(P(x_i)\) is the probability of the possible value of the random variable. The standard deviation can be interpreted as the typical deviation of the values of the random variable from the mean value (or expected value) of the random variable over the long run. The square of the standard deviation of a random variable is called the variance of the random variable and is denoted as \(V(X)\) or \(\sigma_X^2\).
2.9.B.1. The mean and standard deviation for the probability distribution of a discrete random variable should be interpreted in the context of a specific population.
Parameters
A numerical value that measures a characteristic of a probability distribution (or of a population) is a parameter. The value of a parameter is a single, fixed value, even though it is often unknown. Parameters are written with Greek letters, such as \(\mu\) (mean) and \(\sigma\) (standard deviation). Statistics computed from a sample (\(\bar x\), \(s\)) are used to estimate them.
Expected value
The expected value (or mean) of a discrete random variable \(X\) is written \(E(X)\) or \(\mu_X\). It is a probability-weighted average of the possible values: \[\mu_X=\sum x_i\cdot P(x_i).\] Multiply each possible value by its probability and add. The expected value is interpreted as the long-run average outcome of the random variable: if the random process were repeated many times, the average of the results would get close to \(\mu_X\), by the law of large numbers. The expected value does not have to be a possible value of \(X\) (the mean number of cars, 1.73, is not a whole number), and it need not be the most likely value.
Figure 2.9. The mean \(\mu_X=1.73\) (triangle) is the balance point of the probability histogram: the long-run average number of cars per household.
Standard deviation and variance
The standard deviation of a discrete random variable is \[\sigma_X=\sqrt{\sum(x_i-\mu_X)^2\cdot P(x_i)},\] and its square, \(\sigma_X^2\), is the variance \(V(X)\). The calculation mirrors the standard deviation of data: find each value's deviation from the mean, square it, weight it by the probability, add, and take the square root. The standard deviation is interpreted as the typical deviation of the values of the random variable from the mean over the long run.
Interpreting in context
The mean and standard deviation should always be interpreted in the context of the specific population or random process: say "the mean number of cars per household, in the long run" rather than just "the mean is 1.73." A good interpretation of the standard deviation says that the values typically differ from the mean by about that amount.
Worked example · Mean and standard deviation of the cars distribution
Find the mean and standard deviation of \(X\), the number of cars per household, with \(P(0)=0.08\), \(P(1)=0.35\), \(P(2)=0.38\), \(P(3)=0.14\), \(P(4)=0.05\), and interpret them.
\(\mu_X=0(0.08)+1(0.35)+2(0.38)+3(0.14)+4(0.05)=0+0.35+0.76+0.42+0.20=1.73\). For the standard deviation, the terms \((x-1.73)^2P(x)\) are \(0.2394\), \(0.1865\), \(0.0277\), \(0.2258\) and \(0.2576\), which add to \(\sigma_X^2=0.9371\), so \(\sigma_X=\sqrt{0.9371}\approx0.968\). Interpretation: in the long run, households have a mean of 1.73 cars, and the number of cars in a household typically differs from the mean by about 0.97 cars.
Worked example · A fair price for a raffle ticket
A raffle sells tickets for \$2. Each ticket has a 1% chance to win \$100, a 4% chance to win \$10 and a 95% chance to win nothing. Let \(X\) be the net gain to a ticket buyer (prize minus the \$2 cost). Find and interpret the mean and standard deviation.
The net gains are \(98\) (with probability 0.01), \(8\) (0.04) and \(-2\) (0.95). \(\mu_X=98(0.01)+8(0.04)+(-2)(0.95)=0.98+0.32-1.90=-0.60\). The variance is \(0.01(98.6)^2+0.04(8.6)^2+0.95(-1.4)^2=97.22+2.96+1.86=102.04\), so \(\sigma_X=\sqrt{102.04}\approx10.10\). Interpretation: over many tickets, a buyer loses an average of \$0.60 per ticket (the expected value is negative, so the raffle is not a fair bet for the buyer). The standard deviation of about \$10.10 says that a single ticket's net gain typically differs from that mean by about \$10, which is large relative to the mean because most tickets lose \$2 and a few win a lot.
Worked example · Three coin flips
Find the mean and standard deviation of the number of heads in three flips of a fair coin (distribution: 1/8, 3/8, 3/8, 1/8 for 0, 1, 2, 3 heads).
\(\mu=0(1/8)+1(3/8)+2(3/8)+3(1/8)=12/8=1.5\). \(\sigma^2=(1.5)^2(1/8)+(0.5)^2(3/8)+(0.5)^2(3/8)+(1.5)^2(1/8)=0.28125+0.09375+0.09375+0.28125=0.75\), so \(\sigma=\sqrt{0.75}\approx0.866\). The mean is a "long-run average" of 1.5 heads per three flips, a value that is impossible on any single set of three flips.
Worked example · Expected value as a decision tool
A game costs \$5 to play. You roll a fair die and win \$12 if you roll a 6, and nothing otherwise. Is the game favorable to the player?
Net gain: \(+7\) with probability \(1/6\) and \(-5\) with probability \(5/6\). \(\mu=7(1/6)-5(5/6)=7/6-25/6=-18/6=-3\). The player expects to lose \$3 per play in the long run, so the game is unfavorable. (Check the other way: the expected prize is \(12(1/6)=2\), and \(2-5=-3\).)
Calculator
TI-84: enter the values in `L1` and the probabilities in `L2`, then `STAT` > `CALC` > `1-Var Stats L1,L2`. The calculator reports \(\bar x\), which is \(\mu_X\), and the population standard deviation \(\sigma x\), which is \(\sigma_X\) (use the \(\sigma x\) line, not \(Sx\)).
Exam focus
\(\mu_X=\sum x_iP(x_i)\): the long-run average. It need not be a possible value.
\(\sigma_X=\sqrt{\sum(x_i-\mu_X)^2P(x_i)}\): typical deviation from the mean; variance is \(\sigma_X^2\).
Interpret in context, with units: "in the long run, the mean ... per ...; values typically differ from the mean by about ...."
A negative expected net gain means a game is unfavorable to the player in the long run.
Practice
A random variable has \(P(0)=0.2\), \(P(1)=0.5\), \(P(2)=0.3\). Find the mean and standard deviation.
Show answer
\(\mu=0+0.5+0.6=1.1\). \(\sigma^2=0.2(1.21)+0.5(0.01)+0.3(0.81)=0.242+0.005+0.243=0.49\), so \(\sigma=0.7\).
A \$1 lottery ticket pays \$500 with probability 0.001 and nothing otherwise. Find the expected net gain per ticket and interpret it.
Show answer
Net gain is \(499\) with probability 0.001 and \(-1\) with probability 0.999: \(\mu=0.499-0.999=-0.50\). In the long run a player loses about 50 cents per ticket.
The number of defects \(X\) on a part has \(\mu_X=0.6\) and \(\sigma_X=0.8\). Interpret both in context.
Show answer
In the long run, a part has a mean of 0.6 defects. The number of defects on a part typically differs from 0.6 by about 0.8 defects.
A game costs \$3 and pays \$10 if a fair coin lands heads twice in two flips, otherwise nothing. Find the expected net gain.
Show answer
\(P(\text{HH})=1/4\). Net: \(+7\) with probability \(1/4\), \(-3\) with probability \(3/4\): \(\mu=1.75-2.25=-0.50\), a loss of \$0.50 per play on average.
Explain why the mean of a random variable can be a value that the random variable can never take.
Show answer
The mean is a long-run average weighted by probabilities, not a typical single outcome. The mean number of heads in three flips is 1.5, but a single set of three flips gives 0, 1, 2 or 3 heads.
Two random variables have the same mean 10, but \(\sigma_X=1\) and \(\sigma_Y=6\). What does that say?
Show answer
The values of \(X\) are typically close to 10, while the values of \(Y\) are typically much farther from 10: \(Y\) is much more variable even though its long-run average is the same.
Many situations count how many times something happens in a fixed number of tries: free throws made out of 10, defective items in a batch of 20, patients who respond to a treatment out of 50. When the tries are independent and each has the same probability of success, the count has a binomial distribution. This lesson gives the conditions for a binomial random variable, the probability formula, the mean and standard deviation, and how to use the calculator.
2.10.A. Justify why a random variable is or is not a binomial random variable.
2.10.B. Calculate the mean and standard deviation for a binomial distribution.
2.10.C. Interpret the mean, standard deviation, and probabilities for a binomial distribution.
2.10.D. Estimate probabilities of binomial random variables using data from a simulation.
2.10.E. Calculate probabilities for a binomial distribution.
Essential knowledge.
2.10.A.1. A binomial random variable, X, is a discrete random variable that counts the number of successes in repeated independent trials, n, that have only two possible outcomes (success or failure), with the probability of success p and the probability of failure 1−p.
2.10.B.1. If a random variable is binomial, its mean, \(\mu_X\), is \(np\) and its standard deviation, \(\sigma_X\), is \(\sqrt{np(1-p)}\).
2.10.C.1. The mean, standard deviation, and probabilities for a binomial distribution should be interpreted in context.
2.10.D.1. A probability distribution can be constructed using the rules of probability or estimated with a simulation.
2.10.E.1. The probability that a binomial random variable, \(X\), has exactly \(x\) successes for \(n\) independent trials, when the probability of success is \(p\), is calculated as \(P(X=x)=\dbinom{n}{x}p^{x}(1-p)^{n-x}\), \(x=0,1,2,\dots,n\). This is called the binomial probability function.
When is a variable binomial?
A binomial random variable \(X\) is a discrete random variable that counts the number of successes in \(n\) repeated trials, where:
each trial has only two possible outcomes, success or failure;
the trials are independent (the result of one does not change the probabilities for the others);
the number of trials \(n\) is fixed in advance;
the probability of success \(p\) is the same on every trial (and the probability of failure is \(1-p\)).
Counting successes in \(n\) independent trials with the same \(p\) is the signal. A free throw shooter who attempts 10 shots (each made with probability 0.7, independently) gives a binomial variable with \(n=10\) and \(p=0.7\). Drawing cards without replacement from a small deck is not binomial, because the probabilities change from draw to draw. When a random sample is small compared with a large population (less than about 10% of it), the trials are close enough to independent that the binomial model is used.
The binomial probability function
The probability that \(X\) has exactly \(x\) successes in \(n\) trials, with success probability \(p\), is \[P(X=x)=\binom{n}{x}p^{x}(1-p)^{n-x},\qquad x=0,1,2,\dots,n.\] Here \(p^x(1-p)^{n-x}\) is the probability of any one particular arrangement with \(x\) successes and \(n-x\) failures (by the multiplication rule for independent events), and \(\binom{n}{x}=\dfrac{n!}{x!(n-x)!}\) counts the number of different arrangements.
Figure 2.10. The distribution of the number of free throws made in 10 attempts when each is made with probability 0.7. The shaded bars (8, 9 and 10) add up to \(P(X\ge8)\approx0.383\).
Mean and standard deviation
If \(X\) is binomial with \(n\) trials and success probability \(p\), then \[\mu_X=np\qquad\text{and}\qquad\sigma_X=\sqrt{np(1-p)}.\] They are interpreted like any random variable's parameters: \(np\) is the long-run average number of successes in \(n\) trials. A binomial distribution is symmetric when \(p=0.5\), skewed right when \(p\) is small and skewed left when \(p\) is large.
Other ways to build the distribution
A probability distribution can be constructed using the rules of probability (as the formula does) or estimated with a simulation: assign digits to success and failure in proportion to \(p\), generate \(n\) of them for one trial, count the successes, and repeat many times.
Worked example · Exactly 8 of 10
A free throw shooter makes 70% of her shots, independently. Find the probability that she makes exactly 8 of 10, and the probability that she makes at least 8.
\(X\) is binomial with \(n=10\) and \(p=0.7\). \(P(X=8)=\binom{10}{8}(0.7)^8(0.3)^2=45(0.05764801)(0.09)=0.2335\). For "at least 8", add \(P(8)+P(9)+P(10)=0.2335+0.1211+0.0282=0.3828\). In context: there is about a 23% chance she makes exactly 8, and about a 38% chance she makes 8 or more.
Worked example · Mean and standard deviation
For the shooter above, find the mean and standard deviation of the number of free throws made in 10 attempts and interpret them.
\(\mu_X=np=10(0.7)=7\) and \(\sigma_X=\sqrt{10(0.7)(0.3)}=\sqrt{2.1}\approx1.45\). In the long run she makes an average of 7 of her 10 attempts, and the number made typically varies from 7 by about 1.45 shots.
Worked example · At least one
Each of 8 independent tests has a 10% chance of a false positive. Find the probability of at least one false positive. Then find the probability of exactly 3 correct answers when a student guesses on 5 five-choice questions.
For at least one false positive, \(X\) is binomial with \(n=8\) and \(p=0.1\), and the complement is easiest: \(1-P(X=0)=1-0.9^8=1-0.4305=0.5695\). For the guesser, \(n=5\) and \(p=0.2\): \(P(X=3)=\binom{5}{3}(0.2)^3(0.8)^2=10(0.008)(0.64)=0.0512\).
Worked example · Is it binomial?
Decide whether each is binomial. (a) The number of heads in 12 flips of a fair coin. (b) The number of aces in a 5-card hand dealt from a standard deck. (c) The number of rolls of a die needed to get the first 6.
(a) Yes: two outcomes, independent, \(n=12\), \(p=0.5\). (b) No: cards are dealt without replacement, so the trials are not independent and the probability of an ace changes (a good approximation only for large populations). (c) No: the number of trials is not fixed; the variable counts trials until a success rather than successes in a fixed number of trials.
Calculator
TI-84: `2nd` `VARS` (DISTR) > `binompdf(n,p,x)` gives \(P(X=x)\); `binomcdf(n,p,x)` gives \(P(X\le x)\). For "at least 8 of 10": `1-binomcdf(10,0.7,7)` \(=0.3828\). Show the formula or the calculator command with its inputs on the exam.
Exam focus
Binomial: fixed \(n\), two outcomes, independent trials, same \(p\); \(X\) counts successes.
State the conditions, then the answer in context. A simulation can estimate the same distribution.
Practice
A fair coin is flipped 6 times. Find the probability of exactly 2 heads.
Show answer
\(\binom62(0.5)^6=15/64\approx0.234\).
A quality inspector finds that 5% of items are defective. In a random sample of 12 items, find the probability that none is defective and the probability that at least 2 are.
Show answer
\(P(0)=0.95^{12}\approx0.540\). \(P(X\ge2)=1-P(0)-P(1)\approx1-0.540-0.341=0.118\) (the calculator gives 0.1184).
For \(n=12\) and \(p=0.05\), find the mean and standard deviation of the number of defective items.
Show answer
Explain why the number of hearts in a 5-card hand dealt from a standard deck is not exactly binomial.
Show answer
The cards are dealt without replacement, so the trials are not independent and the probability of a heart changes after each card.
Describe a simulation to estimate the probability of exactly 3 correct answers when a student guesses on 4 five-choice questions.
Show answer
Use digits 0 and 1 for "correct" (probability 0.2) and 2 to 9 for wrong. One trial is four random digits (for example `randInt(0,9,4)`); count the digits that are 0 or 1. Repeat many times; the estimate is the fraction of trials with exactly 3 such digits. (The exact value is \(4(0.2)^3(0.8)=0.0256\).)
Normal curves, the empirical rule and probabilities
The bell-shaped normal distribution is the most important model in statistics. Many measurements (heights, weights, test scores, measurement errors) have distributions that are close to normal, and a large part of inference rests on it. This lesson describes the normal curve, the standard normal distribution and the empirical rule, and shows how to find the probability that a normal random variable falls in an interval by finding an area under the curve. The next lesson goes the other way, from an area to a boundary.
Required content · 2.11.A, 2.11.B, 2.11.C, 2.11.D
Learning objectives.
2.11.A. Describe a normal distribution.
2.11.B. Calculate the mean and standard deviation for a normal distribution.
2.11.C. Calculate percentages from a normal distribution using the empirical rule.
2.11.D. Calculate the probability that a particular value lies within a given interval of a normal distribution.
Essential knowledge.
2.11.A.1. A continuous random variable is a variable that can take on any value within a specified domain. Every interval within the domain has a probability associated with it.
2.11.A.2. Many continuous random variables are well-modeled by a normal distribution.
2.11.A.3. A normal distribution can be described as a continuous, unimodal, bell-shaped, and symmetric curve.
2.11.A.4. A normal curve can be used to model a distribution of data and a continuous random variable.
2.11.A.5. The normal distribution, or the normal curve, is identified by two parameters, the mean, \(\mu\), and the standard deviation, \(\sigma\). The smaller the standard deviation, the taller and more concentrated the normal curve is around its mean. The larger the standard deviation, the shorter and less concentrated the normal curve is around its mean.
2.11.B.1. A standard normal distribution is a normal distribution with mean \(\mu=0\) and standard deviation \(\sigma=1\).
2.11.C.1. The empirical rule can be used to estimate the area of a region under the graph of the normal distribution curve. For a normal distribution, approximately 68% of observations are within 1 standard deviation of the mean, approximately 95% of observations are within 2 standard deviations of the mean, and approximately 99.7% of observations are within 3 standard deviations of the mean. This is called the empirical rule, or the 68–95–99.7 rule.
2.11.D.1. If the distribution of a random variable is approximately normal, the probability that the random variable takes on values within a particular interval of the random variable is determined by the area under the normal curve within that interval. The total probability or area under the normal curve is 1.
Continuous random variables
A continuous random variable can take any value within a specified domain (an interval of numbers), such as the weight of a tomato. Its probabilities are described by a curve, and every interval of values has a probability given by the area under the curve over that interval. The total area under the curve is 1. Because a single value has no width, the probability that a continuous variable equals one exact value is 0, so \(P(X\lt a)\) and \(P(X\le a)\) are the same.
The normal curve
A normal distribution is described by a continuous, unimodal, bell-shaped, symmetric curve. Many continuous random variables are well modeled by a normal distribution, and a normal curve can be used to model either a distribution of data or a continuous random variable. It is identified by two parameters: the mean \(\mu\), which is the center and line of symmetry, and the standard deviation \(\sigma\), which sets the spread. The notation \(N(\mu,\sigma)\) describes it: "\(X\) is \(N(150,12)\)" means \(X\) is normal with mean 150 and standard deviation 12.
The smaller the standard deviation, the taller and more concentrated the curve is around its mean; the larger the standard deviation, the shorter and less concentrated the curve is.
Figure 2.11. The smaller the standard deviation, the taller and more concentrated the normal curve is around its mean; the larger the standard deviation, the shorter and more spread out.
The standard normal distribution is the normal distribution with mean \(\mu=0\) and standard deviation \(\sigma=1\). Any normal value can be converted to a z-score, \(z=\dfrac{x-\mu}{\sigma}\), which counts how many standard deviations \(x\) is above or below the mean; the z-score of a value from a normal distribution is a value from the standard normal distribution.
The empirical rule
For a normal distribution, approximately 68% of the observations are within 1 standard deviation of the mean, approximately 95% are within 2 standard deviations, and approximately 99.7% are within 3 standard deviations. This is the empirical rule, or the 68-95-99.7 rule, and it can be used to estimate areas under a normal curve without technology.
Figure 2.12. Approximately 68% of the values in a normal distribution are within 1 standard deviation of the mean, 95% within 2, and 99.7% within 3 (the 68–95–99.7 rule).
Probabilities from areas
If the distribution of a random variable is approximately normal, the probability that it takes a value in an interval is the area under the normal curve over that interval. To find it: (1) sketch the curve and shade the region; (2) state the model, \(N(\mu,\sigma)\); (3) calculate with technology, for example `normalcdf(lower,upper,μ,σ)` on the TI-84, or use the z-score and a standard normal table; (4) state the answer in context.
Figure 2.13. The probability that a tomato weighs less than 165 g is the shaded area under the normal curve to the left of 165. Total area under the curve is 1.
Worked example · The empirical rule
Tomato weights are approximately normal with mean 150 g and standard deviation 12 g. Use the empirical rule to estimate (a) the proportion of tomatoes weighing between 126 g and 174 g; (b) the proportion weighing more than 162 g.
(a) 126 and 174 are 2 standard deviations below and above the mean (\(150\pm24\)), so about 95% of tomatoes weigh between 126 g and 174 g. (b) 162 is 1 standard deviation above the mean; 68% are within 1 standard deviation, so 32% are outside, half in each tail: about 16% weigh more than 162 g.
Worked example · The area to the left of a value
Using \(N(150,12)\), find the probability that a randomly chosen tomato weighs less than 165 g.
\(z=\dfrac{165-150}{12}=1.25\). With the calculator, `normalcdf(-1E99,165,150,12)` \(=0.8944\) (the standard normal table gives 0.8944 for \(z=1.25\)). So \(P(X\lt165)\approx0.894\): about 89% of tomatoes weigh less than 165 g.
Worked example · The area between two values and in the tail
Using \(N(150,12)\), find (a) \(P(140\lt X\lt170)\) and (b) \(P(X\gt174)\).
(a) \(z\) for 140 is \(-0.833\) and for 170 is \(1.667\). `normalcdf(140,170,150,12)` \(=0.7499\), about 0.750. (b) 174 is exactly 2 standard deviations above the mean, so `normalcdf(174,1E99,150,12)` \(=0.0228\): about 2.3% of tomatoes weigh more than 174 g, consistent with the empirical rule's \((1-0.95)/2=0.025\).
Worked example · Standardizing to a z-score
SAT-type scores are modeled as \(N(500,100)\). A student scores 640. Find the z-score and the proportion of students who scored lower.
\(z=\dfrac{640-500}{100}=1.4\): the score is 1.4 standard deviations above the mean. The area to the left of \(z=1.4\) under the standard normal curve is 0.9192, so about 92% of students scored below 640.
Calculator
TI-84: `2nd` `VARS` (DISTR) > `normalcdf(lower, upper, μ, σ)` gives \(P(\text{lower}\lt X\lt\text{upper})\). Use `-1E99` for "no lower limit" and `1E99` for "no upper limit" (`1E99` is typed with `2nd` `,` for the E). Leave off \(\mu\) and \(\sigma\) to use the standard normal. Always write the model and the inputs as part of your answer.
Exam focus
Normal: continuous, unimodal, bell-shaped, symmetric; determined by \(\mu\) and \(\sigma\). Larger \(\sigma\) means shorter and wider.
Standard normal: \(\mu=0\), \(\sigma=1\); \(z=(x-\mu)/\sigma\).
Empirical rule: 68%, 95%, 99.7% within 1, 2, 3 standard deviations.
Probability = area under the curve; total area is 1; \(P(X=a)=0\). Sketch, shade, name the model, calculate, answer in context.
Practice
Adult heights are \(N(70,3)\) inches. Find the probability that a randomly chosen adult is taller than 76 inches.
Show answer
\(z=(76-70)/3=2\), so \(P(X\gt76)=0.0228\), about 2.3%.
Scores on an exam are approximately \(N(500,100)\). Find \(P(400\lt X\lt600)\).
Show answer
Both limits are 1 standard deviation from the mean, so the probability is about 0.683 (68% by the empirical rule).
Bolts have lengths approximately normal with mean 20 mm and standard deviation 2 mm. Use the empirical rule to estimate the proportion of bolts between 16 mm and 24 mm, and the proportion longer than 26 mm.
Show answer
16 and 24 are \(20\pm4\), within 2 standard deviations: about 95%. 26 is 3 standard deviations above the mean, and 99.7% are within 3, so about \(0.3\%/2=0.15\%\) are longer than 26 mm.
A bus arrival time is \(N(30,5)\) minutes. Find the probability that it arrives in less than 25 minutes.
Show answer
\(z=-1\), so \(P(X\lt25)=0.1587\), about 16%.
Two normal curves have the same mean. Curve A has \(\sigma=2\) and curve B has \(\sigma=5\). Which is taller, and why?
Show answer
Curve A is taller and more concentrated around the mean. Total area is 1 for both, so the curve with the smaller standard deviation must be taller to pack the same area into a narrower range.
A student says the probability that a tomato weighs exactly 150 g is the height of the curve at 150. Explain the error.
Show answer
For a continuous random variable, probability is area, not height. A single value has no width, so \(P(X=150)=0\); only intervals have positive probability.
Normal distribution: boundaries and comparing values
Sometimes the area is known and the boundary is what you need: the score a student needs to be in the top 10%, or the weights that bound the middle 95% of tomatoes. This lesson works backward from an area to an interval, using technology or z-scores with a standard normal table, and then uses percentiles and z-scores to compare values from different normal distributions.
Required content · 2.11.E, 2.11.F
Learning objectives.
2.11.E. Calculate the associated intervals and areas of a normal distribution.
2.11.F. Compare measures of relative position for distributions.
Essential knowledge.
2.11.E.1. The boundaries of an interval associated with a given area in a normal distribution can be determined using technology or using z-scores and a standard normal table.
2.11.E.2. Intervals associated with a given area in a normal distribution can be determined by assigning appropriate inequalities to the boundaries of the intervals. To determine the intervals, \(p\) is defined as a number between 0 and 100, \(x_a\) is the lower bound, and \(x_b\) is the upper bound on a normal distribution.
2.11.E.2.i. \(P(X<x_a)=\dfrac{p}{100}\) means that the lowest \(p\)% of the values lie to the left of \(x_a\).
2.11.E.2.ii. \(P(x_a<X<x_b)=\dfrac{p}{100}\) means that \(p\)% of the values lie between \(x_a\) and \(x_b\).
2.11.E.2.iii. \(P(X>x_b)=\dfrac{p}{100}\) means that the highest \(p\)% of the values lie to the right of \(x_b\).
2.11.E.2.iv. To determine the most extreme \(p\)% of values on both sides requires dividing the area associated with \(p\)% into two equal areas on either extreme of the distribution: \(P(X<x_a)=\tfrac12\cdot\dfrac{p}{100}\) and \(P(X>x_b)=\tfrac12\cdot\dfrac{p}{100}\) mean that half of the \(p\)% most extreme values lie to the left of \(x_a\) and half of the \(p\)% most extreme values lie to the right of \(x_b\).
2.11.F.1. Percentiles and proportions may be used to compare relative positions of individual values within a normal distribution or between normal distributions.
From an area to a boundary
The boundaries of an interval associated with a given area in a normal distribution can be determined using technology (`invNorm` on the TI-84) or using z-scores and a standard normal table. On the calculator, `invNorm(area, μ, σ)` returns the value with that area to its left. In the table method, find the area in the body of the table, read off the \(z\), and then convert with \(x=\mu+z\sigma\).
Intervals are described by assigning the right inequalities to the boundaries. Let \(p\) be a number between 0 and 100, \(x_a\) the lower bound and \(x_b\) the upper bound.
\(P(X\lt x_a)=\dfrac{p}{100}\): the lowest \(p\)% of values lie to the left of \(x_a\). Use `invNorm(p/100, μ, σ)`.
\(P(x_a\lt X\lt x_b)=\dfrac{p}{100}\): the middle \(p\)% of values lie between \(x_a\) and \(x_b\). The remaining \((100-p)\)% is split equally between the two tails, so \(x_a=\) `invNorm((1-p/100)/2, μ, σ)` and \(x_b=\) `invNorm(1-(1-p/100)/2, μ, σ)`.
\(P(X\gt x_b)=\dfrac{p}{100}\): the highest \(p\)% of values lie to the right of \(x_b\). Use `invNorm(1-p/100, μ, σ)`, because the area to the left of \(x_b\) is \(1-p/100\).
The most extreme \(p\)% on both sides: divide the area into two equal tails, \(P(X\lt x_a)=\tfrac12\cdot\dfrac p{100}\) and \(P(X\gt x_b)=\tfrac12\cdot\dfrac p{100}\).
Figure 2.14. Intervals associated with a given area: the lowest 20% of values (left of a cutoff), the middle 95% (between two cutoffs), and the most extreme 10% (5% in each tail).
Percentiles and comparing positions
A percentile is the proportion of values at or below a given value, so the area to the left of a value in a normal distribution is its percentile (as a proportion). Percentiles and proportions can be used to compare the relative positions of individual values within a normal distribution or between normal distributions. To compare values from different distributions, convert each to a z-score (or a percentile): the larger z-score is farther above its own mean in standard-deviation units, so it is the relatively better score.
Worked example · The top 10%
Tomato weights are \(N(150,12)\). A grocer sells only the heaviest 10% as "jumbo." What is the minimum weight of a jumbo tomato?
The highest 10% means \(P(X\gt x_b)=0.10\), so the area to the left of \(x_b\) is 0.90. \(z=\) `invNorm(0.90)` \(=1.2816\), and \(x_b=150+1.2816(12)=165.4\). A tomato must weigh about 165.4 g or more to be jumbo. (Calculator: `invNorm(0.9,150,12)` \(=165.38\).)
Worked example · The lowest 20% and the middle 95%
For the same distribution find (a) the cutoff for the lowest 20% and (b) the interval containing the middle 95%.
(a) `invNorm(0.20,150,12)` \(=139.9\): the lowest 20% of tomatoes weigh less than about 139.9 g. (b) The tails together hold 5%, so 2.5% lies in each tail: `invNorm(0.025,150,12)` \(=126.5\) and `invNorm(0.975,150,12)` \(=173.5\). The middle 95% weigh between about 126.5 g and 173.5 g. (The empirical rule's \(150\pm24\) is a rounded version of \(150\pm1.96(12)\).)
Worked example · The most extreme 10%
For the same distribution, find the boundaries of the most extreme 10% of tomatoes, 5% on each side.
\(P(X\lt x_a)=0.05\) gives \(x_a=\) `invNorm(0.05,150,12)` \(=130.3\), and \(P(X\gt x_b)=0.05\) gives \(x_b=\) `invNorm(0.95,150,12)` \(=169.7\). The most extreme 10% are lighter than 130.3 g or heavier than 169.7 g.
Worked example · Comparing scores
Maya scored 640 on a test with scores \(N(500,100)\). Jon scored 31 on a different test with scores \(N(25,5)\). Who did relatively better?
Maya: \(z=(640-500)/100=1.4\), percentile about 0.919. Jon: \(z=(31-25)/5=1.2\), percentile about 0.885. Maya's score is 1.4 standard deviations above her mean and Jon's is 1.2 above his, so Maya did relatively better: she scored higher than about 92% of her test takers, Jon about 88.5% of his.
Calculator
TI-84: `2nd` `VARS` > `invNorm(area, μ, σ)` returns the value with that area to the left. For an upper tail, enter \(1-\) the tail area. For the middle \(p\)%, use \(\frac12(1-p/100)\) and \(1-\frac12(1-p/100)\). Say what the area to the left represents when you show the command.
Exam focus
`invNorm` takes the area to the left and returns the value; for a top \(p\)% use \(1-p/100\).
Middle \(p\)%: split \((100-p)\)% equally into two tails. Most extreme \(p\)%: each tail has half of \(p\)%.
Table method: find the area, read \(z\), convert with \(x=\mu+z\sigma\).
Compare values in different normal distributions with z-scores or percentiles.
Practice
Scores are \(N(70,8)\). What score is needed to be in the top 10%?
Show answer
`invNorm(0.90,70,8)` \(=80.25\), so about 80.3 or higher.
For scores \(N(70,8)\), find the interval that contains the middle 90% of scores.
Show answer
Each tail holds 5%: `invNorm(0.05,70,8)` \(=56.8\) and `invNorm(0.95,70,8)` \(=83.2\). The middle 90% lie between about 56.8 and 83.2.
A tomato weight is \(N(150,12)\). Find the proportion of tomatoes under 130 g, and decide whether a 130 g tomato would be considered unusual.
Show answer
\(z=-1.67\), \(P(X\lt130)=0.048\). About 4.8% are lighter, so it is fairly low but not extremely rare; it is below the 5th percentile.
A student scores 82 on a test with mean 70 and standard deviation 8, and 85 on another with mean 75 and standard deviation 5. Which performance is stronger relative to the class?
Show answer
First test: \(z=12/8=1.5\). Second test: \(z=10/5=2.0\). The second performance is stronger relative to its class.
The 90th percentile of a normal distribution is 165.4 and the mean is 150. Find the standard deviation.
Show answer
The 90th percentile has \(z=1.2816\), so \(\sigma=(165.4-150)/1.2816\approx12.0\).
Explain why, for a normal distribution, \(P(X\lt x_a)=0.025\) and \(P(X\gt x_b)=0.025\) give the middle 95%.
Show answer
The total area outside the middle interval is \(0.025+0.025=0.05\), so the area between the boundaries is \(1-0.05=0.95\); by symmetry the boundaries are equally far from the mean.
Sampling distributions and the central limit theorem
A sample statistic, such as a sample mean, changes from sample to sample. If we know how it behaves over many samples, we can say how far a single sample's statistic is likely to be from the truth, and that is the basis of every confidence interval and significance test in the rest of the course. This lesson defines a sampling distribution, shows how to simulate one, introduces the closely related randomization distribution for experiments, and states the central limit theorem.
Required content · 2.12.A
Learning objective.
2.12.A. Describe sampling distributions with simulations.
Essential knowledge.
2.12.A.1. A sampling distribution of a statistic is the distribution of values of the statistic for all possible samples of a given size from a given population.
2.12.A.2. The sampling distribution of a statistic can be simulated by repeatedly generating a large number of random samples from the population assuming known value(s) for the parameter(s). The value of the statistic is determined and recorded for each sample. The resulting distribution of the sample statistic values approximates the sampling distribution of the statistic.
2.12.A.3. A randomization distribution is the distribution of a statistic generated by simulation from repeatedly randomly reallocating, or reassigning, the response values to treatment groups. The value of the statistic is determined and recorded for each reallocation, or reassignment. The resulting distribution of the statistic values approximates the sampling distribution of the statistic.
2.12.A.4. The central limit theorem (CLT) states that the sampling distribution of a mean of a random sample has a shape that can be approximated by a normal distribution. The larger the sample is, the better the approximation will be.
Sampling distributions
Take a random sample of size \(n\) from a population and compute a statistic, such as the sample mean \(\bar x\) or the sample proportion \(\hat p\). Take another random sample and the statistic will differ. The sampling distribution of a statistic is the distribution of the values of the statistic for all possible samples of a given size from a given population. It is a theoretical distribution; it describes how the statistic varies from sample to sample, which is exactly the sampling variability we need to quantify.
Simulating a sampling distribution
The sampling distribution of a statistic can be simulated: repeatedly generate a large number of random samples of the same size from a population, assuming known values for the parameters; compute and record the value of the statistic for each sample; and examine the resulting distribution of statistic values, which approximates the sampling distribution. The simulation steps are (1) state the population and its parameters, (2) take a random sample of size \(n\), (3) compute the statistic and record it, (4) repeat many times, (5) describe the shape, center and variability of the recorded values.
Randomization distributions
In a randomized experiment there is no population to sample from; the randomness comes from assigning units to treatment groups. A randomization distribution is the distribution of a statistic generated by simulation, by repeatedly randomly reallocating (reassigning) the response values to the treatment groups. For each reallocation, compute and record the value of the statistic (such as the difference in group means). The resulting distribution approximates the sampling distribution of the statistic if the treatment has no effect (so that the responses would have been the same whichever group a unit was in), and so it shows how large a difference is produced by the chance of random assignment alone.
Figure 2.15. Each of 10,000 values is the difference in means after the 16 responses were randomly reallocated to two groups of 8. Only about 0.2% of the reallocations produced a difference as large as the observed 1.59.
The central limit theorem
The central limit theorem (CLT) states that the sampling distribution of the mean of a random sample has a shape that can be approximated by a normal distribution, and the larger the sample, the better the approximation. This is true even when the population itself is not normal. The CLT is why normal-based methods work for means; it is also why a sample size of about 30 or more is a common guide when the population is skewed, while a very skewed population needs a larger sample and a roughly symmetric one needs less.
Figure 2.16. A right-skewed population (mean 10, standard deviation 10) and the simulated sampling distributions of the sample mean for samples of size 1, 5 and 30. As the sample size grows the distribution of \(\bar x\) becomes more symmetric, closer to normal, and less variable.
The panels show a strongly right-skewed population (an exponential distribution with mean 10 and standard deviation 10) and the simulated distributions of the sample mean for samples of size 1, 5 and 30. The sample means are centered at about the population mean, 10, in every panel; their shape becomes more symmetric and bell-shaped as \(n\) grows; and their variability decreases, with standard deviations in the simulation of about 10.1, 4.5 and 1.8, close to \(10/\sqrt n\).
Worked example · Describing a simulated sampling distribution
A simulation drew 4,000 samples of size 30 from a population with mean 10 and standard deviation 10, and recorded each sample mean. The recorded means had a mean of 10.0 and a standard deviation of 1.83, and their histogram was symmetric and bell-shaped. Describe what this shows.
The distribution of the sample mean for \(n=30\) is approximately normal (the central limit theorem, even though the population is skewed), is centered at the population mean 10, so the sample mean is not systematically too high or too low, and has a standard deviation of about 1.83, much smaller than the population's 10. A single sample mean of 30 observations will typically be within a couple of units of the true mean.
Worked example · Larger samples vary less
Samples of size 5 and samples of size 30 are drawn from the same population. Which sampling distribution of \(\bar x\) is more variable and which has the shape closer to normal?
The sampling distribution for \(n=5\) is more variable (standard deviation about 4.5 versus 1.8), and the one for \(n=30\) is closer to normal, because the CLT approximation improves as the sample size grows. In the figure, the \(n=5\) panel still shows some right skew.
Worked example · A randomization distribution
Eight plants were randomly assigned to fertilizer A and eight to fertilizer B. The A plants grew 12.1, 13.4, 11.8, 14.2, 13.9, 12.7, 14.5 and 13.1 cm and the B plants 10.9, 12.2, 11.5, 12.8, 10.4, 11.9, 12.0 and 11.3 cm. The mean for A is 13.21 cm and for B 11.63 cm, a difference of 1.59 cm. How could you tell whether a difference this large could be due to the random assignment alone?
Assume the fertilizer has no effect, so each plant's growth would have been the same under either assignment. Write the 16 growths on cards, shuffle, deal 8 to "A" and 8 to "B," and record the difference in group means. Repeat many times. In 10,000 reallocations, only about 0.2% produced a difference of 1.59 or more. A difference this large is very unlikely to be due only to the random assignment, which is strong evidence that fertilizer A produces more growth. (This reasoning is the basis of significance tests in Units 4 and 5.)
Worked example · Which statement is the CLT?
Which statement is correct? (i) "Large samples from any population are always normal." (ii) "The distribution of \(\bar x\) over many random samples of a large enough size is approximately normal, whatever the population shape."
Statement (ii). The CLT is about the sampling distribution of the mean, not about the sample itself or the population. A large sample from a skewed population is still skewed; it is the distribution of its mean, over repeated samples, that is approximately normal.
Exam focus
Sampling distribution: the distribution of a statistic over all possible samples of a given size from a population. It can be simulated by taking many random samples and recording the statistic.
Randomization distribution: the statistic recomputed after repeatedly reassigning the responses to the treatment groups; it shows what chance alone produces.
CLT: the sampling distribution of a sample mean is approximately normal, and the approximation improves as \(n\) grows; larger samples also vary less.
Do not confuse the distribution of the sample, the population and the sampling distribution.
Practice
Describe how to simulate the sampling distribution of the sample proportion \(\hat p\) for samples of size 50 from a population in which the true proportion is 0.40.
Show answer
Generate a random sample of 50 (for example `randInt(1,10,50)` with 1 to 4 meaning "yes"), compute \(\hat p\) as the number of yes values divided by 50, and record it. Repeat several thousand times, and describe the shape, center and variability of the recorded values.
What does the central limit theorem say about the sampling distribution of \(\bar x\) when the population is skewed and \(n=40\)?
Show answer
It says the sampling distribution of \(\bar x\) is approximately normal (a larger sample gives a better approximation), even though the population is skewed.
When the sample size increases from 10 to 100, how does the sampling distribution of \(\bar x\) change?
Show answer
It becomes more normal in shape and less variable (a smaller standard deviation); its center stays at the population mean.
How is a randomization distribution different from the sampling distribution of a sample mean from a population?
Show answer
A randomization distribution comes from repeatedly reassigning the response values among treatment groups in an experiment (using the same data); a sampling distribution comes from repeatedly taking random samples from a population.
A student says "My sample of 50 has a skewed histogram, so the central limit theorem does not apply." Respond.
Show answer
The CLT concerns the distribution of the sample mean over many samples, not the shape of one sample. A skewed sample, reflecting a skewed population, is exactly the case in which the CLT is useful: the distribution of \(\bar x\) for \(n=50\) is still approximately normal.
In a randomization distribution of differences in means, the observed difference was larger than all but 3% of the simulated differences. What does this suggest?
Show answer
A difference this large would happen in only about 3% of random reassignments if the treatment had no effect, so it is some evidence that the treatment makes a difference.
Unit 2 practice · 10 problems
Unit 2 practice: Probability, Random Variables, and Probability Distributions
Ten problems covering the whole unit: three multiple-choice questions in the style of Section I and seven free-response problems. A graphing calculator is fine; write the formula or the calculator command with its inputs so that the answer can be followed.
In a random survey of 300 adults, each was classified by age group and main source of news: 18 to 34: 90 online, 35 TV, 5 print; 35 to 54: 50 online, 40 TV, 10 print; 55 and over: 20 online, 35 TV, 15 print. (a) Find the marginal relative frequency of "online." (b) Find the conditional relative frequency of "online" among adults 18 to 34. (c) Are age group and news source associated? Justify.
Show answer
The row totals are 130, 100 and 70 and the column totals are 160, 110 and 30 (total 300). (a) \(160/300=0.533\). (b) \(90/130=0.692\). (c) Yes, they appear associated: the conditional distributions of news source differ across age groups. For example, 69% of those 18 to 34 mostly get news online, compared with 50% of those 35 to 54 and 29% of those 55 and over, and the share choosing print rises with age.
Events \(A\) and \(B\) have \(P(A)=0.4\), \(P(B)=0.5\) and \(P(A\cap B)=0.2\). Which statement is true?
Mutually exclusive events cannot occur together, so \(P(A\cap B)\) would be 0. Here it is 0.2.
\(P(A)P(B)=0.4(0.5)=0.20=P(A\cap B)\), so the events are independent. (Equivalently, \(P(A\mid B)=0.2/0.5=0.4=P(A)\).)
By the addition rule \(P(A\cup B)=0.4+0.5-0.2=0.7\). Adding 0.4 and 0.5 double counts the overlap.
\(P(A\mid B)=P(A\cap B)/P(B)=0.2/0.5=0.4\), not 0.5. (0.5 is \(P(B)\).)
A basketball player makes 60% of her free throws, each independent of the others. (a) Describe a simulation, using random digits, to estimate the probability that she makes at least 2 of her next 3 shots. (b) Find the exact probability.
Show answer
(a) Let the digits 0, 1, 2, 3, 4, 5 mean "made" (6 of the 10 digits, probability 0.6) and 6, 7, 8, 9 mean "missed." One trial is three random digits (for example randInt(0,9,3)); count how many are in 0 to 5. Repeat for many trials (say 1,000). The estimate is the number of trials with at least 2 digits in 0 to 5, divided by the number of trials. (b) \(P(\text{exactly }2)=3(0.6)^2(0.4)=0.432\) and \(P(3)=0.6^3=0.216\), so \(P(\text{at least }2)=0.648\).
A factory has two production lines. Line 1 makes 55% of the items and 3% of its items are defective; line 2 makes 45% and 6% of its items are defective. An item is chosen at random. (a) Find the probability that it is defective. (b) Given that it is defective, find the probability that it came from line 1.
Show answer
(a) \(P(\text{defective})=0.55(0.03)+0.45(0.06)=0.0165+0.027=0.0435\). (b) \(P(\text{line 1}\mid\text{defective})=\dfrac{0.0165}{0.0435}=0.379\). Although line 1 makes more than half the items, only about 38% of the defective ones come from it, because line 2 has the higher defect rate.
The random variable \(X\) is the number of times a student is asked a question in class: \(P(0)=0.1\), \(P(1)=0.3\), \(P(2)=0.4\), \(P(3)=0.2\). Find and interpret the mean and the standard deviation of \(X\).
Show answer
\(\mu_X=0(0.1)+1(0.3)+2(0.4)+3(0.2)=1.7\). \(\sigma_X^2=(0-1.7)^2(0.1)+(1-1.7)^2(0.3)+(2-1.7)^2(0.4)+(3-1.7)^2(0.2)=0.289+0.147+0.036+0.338=0.81\), so \(\sigma_X=0.9\). In the long run, a student is asked a mean of 1.7 questions, and the number of questions typically differs from the mean by about 0.9.
Two fair dice are rolled. (a) Find the probability that the sum is 7 or 11. (b) Find the probability of getting at least one 6.
Show answer
(a) There are 36 equally likely outcomes. A sum of 7 occurs in 6 ways and a sum of 11 in 2 ways, and the events are mutually exclusive, so \(P=(6+2)/36=2/9=0.222\). (b) Use the complement: \(P(\text{no 6})=(5/6)(5/6)=25/36\), so \(P(\text{at least one 6})=1-25/36=11/36=0.306\).
A student guesses randomly on each of 8 multiple-choice questions, each with 4 choices. Which expression gives the probability of getting at least 2 correct?
This is the probability of exactly 2 correct, not at least 2.
At least 2 correct is the complement of 0 or 1 correct, so \(P(X\ge2)=1-P(X\le1)=1-\)binomcdf(8,0.25,1) \(=0.633\).
This gives the probability of at most 2 correct answers, \(P(X\le2)\), which includes 0, 1 and 2 correct.
This subtracts only the probability of exactly 2; \(P(X\ge2)\) requires removing \(P(0)\) and \(P(1)\).
Scores on a test are approximately normal with mean 70 and standard deviation 8. (a) What proportion of students scored above 80? (b) What score is needed to be in the top 5%?
Show answer
(a) \(z=(80-70)/8=1.25\), so \(P(X\gt80)=0.106\) (normalcdf(80,1E99,70,8)). (b) The top 5% means 95% of scores are below the cutoff: invNorm(0.95,70,8) \(=70+1.645(8)=83.2\). A score of about 83.2 or higher is needed.
Scores on a test are approximately normal with mean 500 and standard deviation 100. A student scores 650. This score is approximately at the
The 50th percentile is the mean, 500. The score of 650 is 1.5 standard deviations above it.
The 84th percentile is one standard deviation above the mean, 600 (\(z=1\)). A score of 650 is farther above.
\(z=(650-500)/100=1.5\), and the area to the left of \(z=1.5\) is 0.933, so the score is at about the 93rd percentile.
The 98th percentile is about 2 standard deviations above the mean (\(z=2\), score 700). 650 is lower.
The time customers wait for service is skewed right with mean 20 minutes and standard deviation 12 minutes. A random sample of 36 customers (a small fraction of all customers) is taken. (a) Describe the sampling distribution of the sample mean \(\bar x\). (b) Find \(P(\bar x\gt22)\). (c) Why can't we find the probability that a single customer waits more than 22 minutes with a normal model?
Show answer
(a) The mean is \(\mu_{\bar x}=20\) and the standard deviation is \(\sigma_{\bar x}=12/\sqrt{36}=2\). The population is skewed, but \(n=36\ge30\), so by the central limit theorem the sampling distribution is approximately normal. (b) \(z=(22-20)/2=1\), so \(P(\bar x\gt22)=0.159\). (c) The normal model describes the sampling distribution of \(\bar x\), not the distribution of individual waits, which is skewed right; so a normal calculation is not valid for one customer.
Estimators and the sampling distribution of a proportion
Inference starts with a simple idea: use a statistic from a random sample to estimate a parameter of the population. A poll of 1,000 voters estimates the proportion of all voters who support a measure. How good is that estimate, and how much would it change from sample to sample? This lesson defines point estimators and what it means for one to be unbiased, and then describes the sampling distribution of the sample proportion \(\hat p\): its center, its spread, and when it is approximately normal.
3.1.A. Justify why an estimator is or is not unbiased.
3.1.B. Calculate estimates for a population parameter.
3.2.A. Calculate the mean and standard deviation of a sampling distribution for a sample proportion.
3.2.B. Justify the appropriateness of conditions for the sampling distribution of a sample proportion.
3.2.C. Interpret the mean, standard deviation, and probabilities for a sampling distribution of a sample proportion.
Essential knowledge.
3.1.A.1. When estimating a population parameter, an estimator is unbiased if, on average, the value of the estimator does not underestimate or overestimate the population parameter.
3.1.B.1. A sample statistic is a point estimator of the corresponding population parameter and can be thought of as the estimate of the population parameter. For example, the sample proportion \(\hat p\) is a point estimator for the population proportion \(p\).
3.2.A.1. For a population with population proportion \(p\), when the sampled values are independent, the sampling distribution of a sample proportion \(\hat p\) has a mean \(\mu_{\hat p}=p\) and a standard deviation \(\sigma_{\hat p}=\sqrt{\dfrac{p(1-p)}{n}}\).
3.2.B.1. Sampling without replacement requires that two conditions be met:
3.2.B.1.i. The randomization condition: the data should be collected using a random sample.
3.2.B.1.ii. The 10% condition: the population size must be at least 10 times larger than the sample size: \(n\le10\%N\), where \(N\) is the size of the population and \(n\) is the sample size.
3.2.B.2. The sampling distribution of the sample proportion \(\hat p\) is approximately normal provided the sample size is large enough. To ensure the sample size is large enough, the following condition must be met: \(np\ge10\) and \(n(1-p)\ge10\), where \(np\) is the expected number of successes and \(n(1-p)\) is the expected number of failures.
3.2.C.1. The mean, standard deviation, and probabilities for a sampling distribution of a sample proportion should be interpreted in the context of a specific population.
Point estimators and bias
A sample statistic that is used to estimate a population parameter is a point estimator of that parameter, and its value in a particular sample is the point estimate. For example, the sample proportion \(\hat p\) is a point estimator of the population proportion \(p\), the sample mean \(\bar x\) is a point estimator of \(\mu\), and the sample standard deviation \(s\) is a point estimator of \(\sigma\).
An estimator is unbiased if, on average, its value does not underestimate or overestimate the population parameter: the center of its sampling distribution equals the parameter. A biased estimator is systematically too high or too low. Bias is a property of the method over many samples, not of one sample. A single estimate from an unbiased estimator can still be well off; unbiasedness says only that the errors have no consistent direction.
Figure 3.1. Estimating the upper limit (10) of a population that is uniform on 0 to 10 from samples of 5. Doubling the sample mean is unbiased: its values average about 10. The sample maximum is biased: it never exceeds 10 and averages about 8.3.
In the figure, doubling the sample mean is an unbiased estimator of the upper limit 10 of a uniform population, because the estimates average about 10. The sample maximum can never exceed 10 and averages about 8.3, so it is biased low. Good estimators are unbiased and also have low variability, so that estimates from different samples are close to each other.
The sampling distribution of \(\hat p\)
Suppose a population has a proportion \(p\) of "successes." Take a random sample of size \(n\) and compute \(\hat p\), the proportion of successes in the sample. When the sampled values are independent, the sampling distribution of \(\hat p\) has \[\mu_{\hat p}=p\qquad\text{and}\qquad\sigma_{\hat p}=\sqrt{\frac{p(1-p)}{n}}.\] The first statement says \(\hat p\) is an unbiased estimator of \(p\). The second says the variability of \(\hat p\) depends on \(n\): quadrupling the sample size cuts the standard deviation in half. (For example, with \(p=0.5\), \(\sigma_{\hat p}=0.05\) for \(n=100\) and \(0.025\) for \(n=400\).)
Conditions for the formulas and for a normal model
Sampling without replacement from a finite population produces slightly dependent observations, so two conditions are needed:
Randomization condition: the data should be collected using a random sample.
10% condition: the population should be at least 10 times larger than the sample, \(n\le10\%N\), where \(N\) is the population size.
The sampling distribution of \(\hat p\) is approximately normal provided the sample size is large enough. To check, verify that \[np\ge10\quad\text{and}\quad n(1-p)\ge10,\] the expected numbers of successes and failures. When the sampling distribution is approximately normal, you can find probabilities about \(\hat p\) with a z-score: \[z=\frac{\hat p-p}{\sqrt{p(1-p)/n}}.\]
Figure 3.2. When \(p=0.60\) and \(n=100\), the sampling distribution of \(\hat p\) is approximately normal with mean 0.60 and standard deviation about 0.049. The shaded tail is the probability of a sample proportion above 0.70.
Always interpret the mean, standard deviation and probabilities of the sampling distribution in the context of the specific population: "the proportion of voters in this district who support the measure," not just "\(p\)."
Worked example · Describing the sampling distribution
In a large city, 60% of residents favor a new park. A random sample of 100 residents is taken. Describe the sampling distribution of \(\hat p\) and find the probability that more than 70% of the sample favor the park.
The sample is random and 100 is less than 10% of a large city's population, so the 10% condition holds. Expected successes and failures are \(np=60\) and \(n(1-p)=40\), both at least 10, so the sampling distribution is approximately normal with mean \(\mu_{\hat p}=0.60\) and standard deviation \(\sigma_{\hat p}=\sqrt{0.6(0.4)/100}=0.0490\). Then \(z=(0.70-0.60)/0.0490=2.04\) and \(P(\hat p\gt0.70)=P(z\gt2.04)=0.021\). In context: in about 2% of random samples of 100 residents, more than 70% would favor the park, if the true proportion is 60%.
Worked example · A smaller sample
Suppose 30% of the products from a factory are defective. In a random sample of 50 products, find the mean and standard deviation of \(\hat p\), check whether a normal model is reasonable, and find \(P(\hat p\lt0.20)\).
\(\mu_{\hat p}=0.30\) and \(\sigma_{\hat p}=\sqrt{0.3(0.7)/50}=0.0648\). The expected counts are \(np=15\) and \(n(1-p)=35\), both at least 10, so a normal model is reasonable (assuming 50 is under 10% of the factory's output). \(z=(0.20-0.30)/0.0648=-1.54\), so \(P(\hat p\lt0.20)=0.061\).
Worked example · Does the model apply?
A student wants to use a normal model for \(\hat p\) when \(p=0.04\) and \(n=100\). Is that appropriate?
\(np=100(0.04)=4\), which is less than 10, so the expected number of successes is too small for the sampling distribution to be approximately normal; it would be right skewed. A larger sample (at least \(n=250\), so that \(np\ge10\)) would be needed.
Worked example · Sample size and variability
For \(p=0.52\), compare the standard deviation of \(\hat p\) for \(n=100\) and \(n=400\), and find the probability that \(\hat p\) from the larger sample is within 0.04 of \(p\).
For \(n=100\): \(\sqrt{0.52(0.48)/100}=0.0500\). For \(n=400\): \(\sqrt{0.52(0.48)/400}=0.0250\), half as large. For \(n=400\), \(P(0.48\lt\hat p\lt0.56)=P(-1.60\lt z\lt1.60)=0.891\), so about 89% of samples of 400 give a \(\hat p\) within 0.04 of the true proportion.
Exam focus
A statistic that estimates a parameter is a point estimator; it is unbiased if the center of its sampling distribution equals the parameter. \(\hat p\) is an unbiased estimator of \(p\).
Conditions: random sample, 10% condition (\(n\le0.10N\)), and \(np\ge10\), \(n(1-p)\ge10\) for an approximately normal shape.
Larger samples give smaller standard deviation (proportional to \(1/\sqrt n\)). Interpret in context.
Practice
About 45% of students in a large school ride a bus. In a random sample of 80 students, find the mean and standard deviation of \(\hat p\) and check the conditions for a normal model.
Show answer
\(\mu_{\hat p}=0.45\), \(\sigma_{\hat p}=\sqrt{0.45(0.55)/80}=0.0556\). \(np=36\) and \(n(1-p)=44\) are at least 10, and (for a large school) 80 is under 10% of the population, so a normal model is reasonable.
For the previous problem find \(P(\hat p\gt0.55)\).
Show answer
\(z=(0.55-0.45)/0.0556=1.80\), so \(P=0.036\).
Explain what it means for an estimator to be unbiased.
Show answer
The estimator's sampling distribution is centered at the parameter: over many samples its values do not systematically overestimate or underestimate the parameter.
A sample proportion is computed from a random sample of 200 from a population with \(p=0.5\). Another is computed from a sample of 800. Which \(\hat p\) typically is closer to 0.5, and by what factor is its standard deviation smaller?
Show answer
The sample of 800. The standard deviation is smaller by a factor of \(\sqrt{800/200}=2\): \(0.0354\) against \(0.0177\).
Why does the 10% condition matter when sampling without replacement?
Show answer
Without replacement the observations are not exactly independent; if the sample is a small fraction (at most 10%) of the population, the dependence is negligible and the standard deviation formula for \(\hat p\) is accurate.
A newspaper reports that a random sample of 20 voters from a very large district had \(\hat p=0.25\). The true value is \(p=0.20\). Can the normal model for \(\hat p\) be used? Explain.
Show answer
\(np=20(0.20)=4\lt10\), so the expected number of successes is too small. The sampling distribution of \(\hat p\) would be skewed right and the normal model is not appropriate.
A sample proportion is a single number, and by itself it says nothing about how far from the truth it might be. A confidence interval adds that information: it gives a range of plausible values for the population proportion, built from the point estimate and the amount it typically varies. This lesson shows the conditions, the formula, and the steps for a one-sample z-interval for a population proportion, along with the standard error, the critical value \(z^*\), the margin of error, and the sample size needed for a desired margin of error.
Required content · 3.3.A, 3.3.B, 3.3.C, 3.3.D
Learning objectives.
3.3.A. Identify an appropriate confidence interval procedure including the parameter for a population proportion.
3.3.B. Justify the appropriateness of constructing a confidence interval for a population proportion by verifying conditions.
3.3.C. Calculate an appropriate confidence interval for a population proportion.
3.3.D. Calculate the standard error and margin of error of a sample statistic for a confidence interval for a population proportion, and estimate a given sample size from the margin of error.
Essential knowledge.
3.3.A.1. A confidence interval is an interval estimate for a population parameter. Based on the sample proportion, a confidence interval can be calculated to estimate the value of a single population proportion. The appropriate confidence interval procedure is a one-sample z-interval for a population proportion.
3.3.A.2. The parameter for a confidence interval for a population proportion should reference the proportion, the response variable, and the population in context.
3.3.B.1. A one-sample z-interval for a population proportion requires that three conditions be met:
3.3.B.1.i. The randomization condition: the data should be collected using a random sample.
3.3.B.1.ii. The 10% condition: when sampling without replacement, the population size must be at least 10 times larger than the sample size: \(n\le10\%N\), where \(N\) is the size of the population and \(n\) is the sample size.
3.3.B.1.iii. The normality condition: the observed number of successes, \(n\hat p\), and the observed number of failures, \(n(1-\hat p)\), should be at least 10.
3.3.C.1. \(z^*\) denotes a critical value, such that \(-z^*\) and \(+z^*\) represent the boundaries enclosing the middle \(C\)% of the standard normal distribution, in which \(C\)% is an approximate confidence level with which the population proportion is estimated.
3.3.C.2. An interval estimate can be constructed as point estimate ± (margin of error). For a population proportion, the one-sample z-interval estimate is \(\hat p\pm z^*\sqrt{\dfrac{\hat p(1-\hat p)}{n}}\).
3.3.D.1. The standard error (SE) of a statistic is an estimate of the standard deviation of the sampling distribution of the statistic. The standard error of the sample proportion \(\hat p\) is \(SE_{\hat p}=\sqrt{\dfrac{\hat p(1-\hat p)}{n}}\).
3.3.D.2. The standard error quantifies the typical amount that a statistic will vary from the value of the corresponding population parameter.
3.3.D.3. The margin of error of \(\hat p\) is half the width of the confidence interval and is calculated as the critical value \((z^*)\) times the standard error (SE) of \(\hat p\), which equals \(z^*\sqrt{\dfrac{\hat p(1-\hat p)}{n}}\).
3.3.D.4. The formula for the margin of error (MOE) can be rearranged to solve for \(n\): \(n=\dfrac{(z^*)^2\,\hat p(1-\hat p)}{MOE^2}\), the minimum sample size needed to achieve a given margin of error. For this purpose, if \(\hat p\) is not defined or unable to be calculated, use \(\hat p=0.5\) in order to find the upper bound for the sample size that will result in a given margin of error.
Confidence intervals
A confidence interval is an interval estimate for a population parameter. Based on a sample proportion, a confidence interval can be calculated to estimate a single population proportion; the procedure is a one-sample z-interval for a population proportion. In every interval, identify the parameter in context: it should reference the proportion, the response variable and the population, for example "\(p\) = the proportion of all registered voters in the county who support the measure."
Conditions
A one-sample z-interval for a population proportion requires three conditions:
Randomization: the data should be collected using a random sample.
10% condition: when sampling without replacement, the population size must be at least 10 times the sample size, \(n\le10\%N\).
Normality (large counts): the observed number of successes \(n\hat p\) and the observed number of failures \(n(1-\hat p)\) should each be at least 10.
Because the true \(p\) is unknown, the large-counts condition for an interval uses the observed counts. (For a test, you will use the expected counts under the null hypothesis.)
The interval
Every interval has the form point estimate \(\pm\) margin of error. For a population proportion, \[\hat p\pm z^*\sqrt{\frac{\hat p(1-\hat p)}{n}}.\] The ingredients are:
The standard error \(SE_{\hat p}=\sqrt{\dfrac{\hat p(1-\hat p)}{n}}\) is an estimate of the standard deviation of the sampling distribution of \(\hat p\) (we cannot use \(p\) in the formula because it is unknown). It measures the typical amount that \(\hat p\) varies from the population proportion.
The critical value \(z^*\) is the number such that \(-z^*\) and \(+z^*\) bound the middle \(C\)% of the standard normal distribution, where \(C\)% is the confidence level. The usual values are \(z^*=1.645\) for 90%, \(1.960\) for 95% and \(2.576\) for 99%. On the TI-84, \(z^*=\)`invNorm(1-(1-C)/2)`.
The margin of error is half the width of the interval: \(ME=z^*\cdot SE_{\hat p}\).
Figure 3.3. A 95% confidence interval for a population proportion is the point estimate \(\hat p=0.58\) plus or minus the margin of error 0.048, which gives the interval from 0.532 to 0.628.
Choosing a sample size
The margin-of-error formula can be rearranged to solve for the sample size needed to achieve a given margin of error: \[n=\frac{(z^*)^2\,\hat p(1-\hat p)}{ME^2}.\] Round up to the next whole number. If no estimate \(\hat p\) is available, use \(\hat p=0.5\), which gives the largest possible \(n\) (an upper bound that guarantees the margin of error will be no larger than desired).
Worked example · A complete 95% interval
A random sample of 400 registered voters in a large county found that 232 support a school measure. Construct and interpret a 95% confidence interval for the proportion of all registered voters in the county who support it.
Parameter: \(p\) = the proportion of all registered voters in the county who support the measure. Procedure: one-sample z-interval for \(p\). Conditions: the sample is random; 400 is less than 10% of all voters in a large county; \(n\hat p=232\) and \(n(1-\hat p)=168\) are both at least 10. Calculation: \(\hat p=232/400=0.58\), \(SE=\sqrt{0.58(0.42)/400}=0.0247\), \(z^*=1.96\), so \(ME=1.96(0.0247)=0.0484\) and the interval is \(0.58\pm0.0484\), or \((0.532,\,0.628)\). Conclusion: we are 95% confident that the interval from 0.532 to 0.628 captures the true proportion of all registered voters in the county who support the measure. (Calculator: `STAT` > `TESTS` > `A:1-PropZInt` with `x=232`, `n=400`, `C-Level=.95`.)
Worked example · Other confidence levels
Using the same data (\(\hat p=0.58\), \(n=400\)), find 90% and 99% intervals, and compare the three widths.
90%: \(z^*=1.645\), \(ME=0.0406\), interval \((0.539,\,0.621)\). 99%: \(z^*=2.576\), \(ME=0.0636\), interval \((0.516,\,0.644)\). The widths are 0.081, 0.097 and 0.127. For the same data, a higher confidence level requires a larger critical value, a larger margin of error and a wider interval.
Worked example · How large a sample?
A pollster wants a 95% confidence interval for a proportion with a margin of error of at most 0.03. How large must the sample be (a) with no prior estimate, (b) if a pilot study suggests \(\hat p\approx0.58\)?
(a) Use \(\hat p=0.5\): \(n=\dfrac{1.96^2(0.5)(0.5)}{0.03^2}=\dfrac{0.9604}{0.0009}=1067.1\), so \(n=1068\). (b) \(n=\dfrac{1.96^2(0.58)(0.42)}{0.03^2}=1039.8\), so \(n=1040\). The pilot estimate lowers the required sample slightly because \(0.58(0.42)\) is smaller than \(0.5(0.5)\).
Worked example · Checking the conditions
A club of 85 students surveys all of its members, and 17 say they prefer an early start time. A student proposes a 95% z-interval for the proportion of all students at the school who prefer an early start. Is the method appropriate?
No. The members are not a random sample of all students at the school, so the randomization condition fails, and the interval would not describe the school's students. (The large-counts condition would be satisfied, \(17\) and \(68\), but a large sample cannot fix a nonrandom sample.)
Calculator
TI-84: `STAT` > `TESTS` > `A:1-PropZInt` with \(x\) (number of successes), \(n\), and `C-Level`. The output gives the interval, \(\hat p\) and \(n\). Write the conditions and interpret the interval in context; the calculator output alone is not a complete answer.
Exam focus
Interval: \(\hat p\pm z^*\sqrt{\hat p(1-\hat p)/n}\). SE estimates the standard deviation of \(\hat p\); ME \(=z^*\cdot SE\) is half the width.
Conditions: random, 10%, observed successes and failures \(\ge10\).
\(z^*=1.645, 1.960, 2.576\) for 90%, 95%, 99%.
Sample size for a given ME: \(n=(z^*)^2\hat p(1-\hat p)/ME^2\), rounded up; use \(\hat p=0.5\) if there is no estimate.
State the parameter in context, check conditions, calculate, and interpret.
Practice
In a random sample of 150 teenagers from a large city, 36 said they volunteer weekly. Find and interpret a 90% confidence interval for the proportion of all teenagers in the city who volunteer weekly.
Show answer
\(\hat p=0.24\), \(SE=\sqrt{0.24(0.76)/150}=0.0349\), \(ME=1.645(0.0349)=0.0574\); interval \((0.183,\,0.297)\). We are 90% confident that the interval from 0.183 to 0.297 captures the proportion of all teenagers in the city who volunteer weekly. (Conditions: random sample, 150 under 10% of the city's teenagers, 36 and 114 at least 10.)
What is the margin of error for the 95% interval in the previous problem's data, and how would it change with a 99% level?
Show answer
For 95%, \(ME=1.96(0.0349)=0.0684\). For 99%, \(ME\approx0.0898\), which is larger.
A researcher wants a 95% margin of error of 0.02 for a proportion. What sample size is needed if there is no estimate of \(p\)?
Show answer
\(n=\dfrac{1.96^2(0.25)}{0.02^2}=2400.9\), so \(n=2401\).
In a random sample of 85 customers, 17 prefer the new design. Check whether the conditions for a z-interval are met.
Show answer
The counts are \(17\) successes and \(68\) failures, both at least 10. If the sample is random and the customer population is at least 850, the conditions hold.
Explain the difference between the standard deviation of \(\hat p\) and the standard error of \(\hat p\).
Show answer
The standard deviation \(\sqrt{p(1-p)/n}\) uses the unknown population proportion; the standard error \(\sqrt{\hat p(1-\hat p)/n}\) replaces \(p\) with the sample proportion so it can be calculated from data. The standard error is an estimate of the standard deviation.
A student writes: "We are 95% confident that \(\hat p\) is between 0.532 and 0.628." What is wrong?
Show answer
The sample proportion \(\hat p\) is known exactly (0.58); the interval is about the unknown population proportion \(p\). The statement should say that we are 95% confident the interval captures the proportion of all voters in the county who support the measure.
Interpreting confidence intervals and justifying claims
Computing an interval is only half the work. The other half is saying correctly what it means, what the confidence level promises, how the interval changes with the confidence level and the sample size, and how to use the interval to support or reject a claim. These are among the most frequently tested ideas on the AP exam, and the wording matters.
Required content · 3.4.A, 3.4.B, 3.4.C
Learning objectives.
3.4.A. Interpret a confidence interval in context for a population proportion.
3.4.B. Justify a claim based on a confidence interval for a population proportion.
3.4.C. Identify the relationships among sample size, confidence interval width, confidence level, and margin of error for a population proportion.
Essential knowledge.
3.4.A.1. Because the confidence interval for a population proportion is calculated based on a sample from a population, the computed interval may or may not contain the value of the population proportion.
3.4.A.2. The interpretation of the confidence level is that in repeated random sampling with the same sample size, approximately C% of confidence intervals calculated will capture the population proportion, with C representing the numerical value of the confidence level used.
3.4.A.3. When interpreting a C% confidence interval for a population proportion, we say we are C% confident that the interval \((a,b)\) contains the true value of the parameter for the population, where \(a\) represents the lower limit and \(b\) represents the upper limit. An interpretation of a confidence interval for a population proportion includes a reference to the parameter with details about the population it represents in the context of the study.
3.4.B.1. A confidence interval for a population proportion provides a range of plausible values that may serve as convincing evidence to support a particular claim about the population proportion.
3.4.C.1. For a given sample, increasing the confidence level will result in the following:
3.4.C.1.i. The critical value will increase.
3.4.C.1.ii. The margin of error will increase.
3.4.C.1.iii. The width of the confidence interval will increase.
3.4.C.2. Increasing the sample size decreases the standard error. Thus, when all other things remain the same, the width of the confidence interval for a population proportion tends to decrease as the sample size increases. For a confidence interval for a population proportion with a given confidence level, the width of the interval is approximately proportional to \(\dfrac{1}{\sqrt n}\).
What the interval does and does not say
Because a confidence interval is calculated from one random sample, the computed interval may or may not contain the true population proportion. The confidence level describes the method: in repeated random sampling with the same sample size, approximately \(C\)% of the confidence intervals calculated will capture the population proportion, where \(C\) is the numerical value of the confidence level.
Figure 3.4. Each segment is a 95% confidence interval from a different random sample of 100 from a population with \(p=0.60\). 36 of the 40 intervals (green) capture the true proportion; 4 (orange) miss it, close to the 95% that the confidence level predicts.
In the figure, 40 random samples of 100 were taken from a population with \(p=0.60\) and a 95% interval was made from each. Thirty-six of the 40 intervals captured 0.60 and four did not; with many more samples, the capture rate settles near 95% (a simulation of 100,000 samples gave about 94.8%). Any single interval either captures \(p\) or does not; we just do not know which.
### How to interpret a \(C\)% interval
State: "We are \(C\)% confident that the interval from \(a\) to \(b\) captures the true value of the parameter in context." A complete interpretation names the parameter, the population and the context. Be careful with several incorrect statements that are common:
It is not correct to say "there is a 95% probability that \(p\) is in this interval." The parameter \(p\) is a fixed number; once the interval is computed, it either captures \(p\) or it does not.
It is not a statement about \(\hat p\), which is known, or about 95% of the individual values in the population or sample.
It does not say that 95% of other samples will have \(\hat p\) in this interval.
Using an interval to justify a claim
A confidence interval gives a range of plausible values for the parameter, so it can provide convincing evidence for or against a claim about it. If a claimed value of the parameter lies inside the interval, it is a plausible value and the interval does not provide convincing evidence against the claim. If the claimed value lies outside the interval, it is not a plausible value, and the interval provides convincing evidence that the claim is false; if the whole interval is above (or below) the claimed value, it supports the conclusion that the true proportion is greater (or less) than that value. State the conclusion in terms of the parameter and the population in context.
What changes the width
The width of an interval is \(2\cdot z^*\cdot SE\). Two things change it:
Confidence level. For a given sample, increasing the confidence level increases the critical value \(z^*\), the margin of error and the width of the interval. More confidence costs precision.
Sample size. Increasing the sample size decreases the standard error. When everything else is the same, the width decreases as the sample size increases; for a given confidence level, the width is approximately proportional to \(1/\sqrt n\) (so quadrupling the sample size cuts the width in half).
Worked example · Interpreting and evaluating a claim
A 95% confidence interval for the proportion of all registered voters in a county who support a school measure is \((0.532,\,0.628)\). Interpret the interval, and decide whether it supports the claim that a majority of voters support the measure.
Interpretation: We are 95% confident that the interval from 0.532 to 0.628 captures the true proportion of all registered voters in the county who support the measure. Claim: a majority means \(p\gt0.50\). The value 0.50 is not in the interval, and every value in the interval is greater than 0.50, so the interval provides convincing evidence that more than half of the county's registered voters support the measure.
Worked example · A claim that cannot be rejected
A 90% interval for the proportion of teenagers in a city who volunteer weekly is \((0.183,\,0.297)\). A youth group claims that one quarter of the city's teenagers volunteer weekly. What does the interval say about that claim?
The claimed value 0.25 is inside the interval, so it is a plausible value for the population proportion. The interval does not provide convincing evidence that the claim is false. (It also does not prove that the claim is true: many other values in the interval are plausible too.)
Worked example · Level and sample size
For a sample of 400 with \(\hat p=0.58\), the 90%, 95% and 99% intervals have widths 0.081, 0.097 and 0.127. (a) What would the 95% interval's width be with a sample of 1,600 and the same \(\hat p\)? (b) A student claims that the 99% interval is better. Evaluate.
(a) Quadrupling the sample size halves the standard error, so the width is about \(0.097/2=0.048\). (b) A 99% interval is more likely to capture \(p\) in the long run, but it is wider and therefore less precise; neither is "better," they trade confidence for precision. Only a larger sample can increase both.
Worked example · Reading the capture figure
In the figure of 40 intervals, four intervals missed 0.60. Does that mean the 95% confidence level is wrong?
No. With 40 intervals and a 95% capture rate we expect about \(0.05\times40=2\) misses, and 4 is not unusual from a random process. The 95% describes the long-run proportion of intervals that capture \(p\), not a guarantee for each set of 40.
Exam focus
Confidence level: in repeated random sampling with the same \(n\), about \(C\)% of intervals capture the parameter.
Interpretation: "We are \(C\)% confident that the interval from \(a\) to \(b\) captures the true [parameter in context]." Not "there is a 95% chance \(p\) is in this interval."
Claims: a claimed value inside the interval is plausible; outside means convincing evidence against the claim.
Higher confidence level: larger \(z^*\), ME and width. Larger \(n\): smaller SE and width (\(\propto1/\sqrt n\)).
Practice
A 95% confidence interval for the proportion of all adults in a town who own a bicycle is \((0.41,\,0.49)\). Interpret the interval.
Show answer
We are 95% confident that the interval from 0.41 to 0.49 captures the true proportion of all adults in the town who own a bicycle.
Using the interval in the previous problem, is there convincing evidence that fewer than half of the adults in the town own a bicycle?
Show answer
Yes. All the plausible values in the interval are below 0.50, so 0.50 is not a plausible value and the interval supports the claim that fewer than half of the adults own a bicycle.
A student says: "This 95% interval means there is a 95% probability that the true proportion is between 0.41 and 0.49." Respond.
Show answer
The true proportion is a fixed number, so the probability is either 0 or 1 once the interval is computed. The 95% describes how often the method produces an interval that captures the parameter in repeated random samples.
Without calculating, say how the width of a 95% interval changes if the sample size is multiplied by 9 and \(\hat p\) stays the same.
Show answer
The width is proportional to \(1/\sqrt n\), so it becomes \(1/\sqrt9=1/3\) of the original.
A 90% interval for a proportion is \((0.30,\,0.40)\). Without recalculating, will the 99% interval from the same data be wider or narrower, and why?
Show answer
Wider. A higher confidence level uses a larger critical value \(z^*\), so the margin of error and width increase.
A confidence interval for the proportion of defective parts is \((0.02,\,0.06)\). The manufacturer claims that 5% of parts are defective. Is the claim supported or contradicted?
Show answer
The value 0.05 is in the interval, so it is plausible. The interval does not provide convincing evidence against the manufacturer's claim.
A confidence interval estimates a parameter. A significance test (or hypothesis test) answers a different question: is there convincing statistical evidence for a specific claim about a parameter? The test starts with a skeptical position, the null hypothesis, and asks whether the sample data are so unlikely under that position that we should doubt it. This lesson covers the first part of the procedure: choosing the test, writing the hypotheses and parameter in context, and checking the conditions.
Required content · 3.5.A, 3.5.B, 3.5.C
Learning objectives.
3.5.A. Identify an appropriate testing method for a population proportion including the parameter for the population proportion.
3.5.B. Identify the null and alternative hypotheses for a population proportion.
3.5.C. Justify the appropriateness of a hypothesis test for a population proportion by verifying conditions.
Essential knowledge.
3.5.A.1. A hypothesis test is a statistical inference procedure that is used to make a decision about the value of a population parameter. The appropriate hypothesis testing procedure is a one-sample z-test for a population proportion.
3.5.A.2. The parameter for a hypothesis test for a population proportion should reference the population parameter, the response variable, and the population in context.
3.5.B.1. In the hypothesis testing procedure, the null hypothesis, H0, is the statement about a parameter that is assumed to be correct unless there is convincing statistical evidence suggesting otherwise. It is the status quo condition. The alternative hypothesis, Ha, is the claim or belief about a parameter for which evidence is being collected. A researcher’s claim or belief about the population parameter is represented by the alternative hypothesis.
3.5.B.2. The null hypothesis contains an equality reference (=, ≥, or ≤). Although the null hypothesis for a one-sided test may include an inequality symbol, in AP Statistics it is tested at the boundary of equality. The alternative hypothesis with < or > is called one-sided, and the alternative hypothesis with ≠ is called two-sided.
3.5.B.3. The null hypothesis for a one-sample z-test for a population proportion is as follows: \(H_0:p=p_0\), where \(p_0\) is the null hypothesized value for the population proportion. A one-sided alternative hypothesis for a one-sample z-test for a population proportion is either \(H_a:p<p_0\) or \(H_a:p>p_0\). A two-sided alternative hypothesis is \(H_a:p\ne p_0\).
3.5.C.1. A one-sample z-test for a population proportion requires that three conditions be met:
3.5.C.1.i. The randomization condition: the data should be collected using a random sample.
3.5.C.1.ii. The 10% condition: when sampling without replacement, the population size must be at least 10 times larger than the sample size: \(n\le10\%N\), where \(N\) is the size of the population and \(n\) is the sample size.
3.5.C.1.iii. The normality condition: the expected number of successes, \(np_0\), and the expected number of failures, \(n(1-p_0)\), should be at least 10.
The idea of a hypothesis test
A hypothesis test is a statistical inference procedure used to make a decision about the value of a population parameter. For one population proportion, the appropriate procedure is a one-sample z-test for a population proportion. The structure of every test is the same: state the hypotheses and define the parameter, check conditions and name the test, compute the test statistic and p-value, and state a conclusion in context. This lesson covers the first two steps; the next two lessons cover the rest.
The hypotheses
The null hypothesis, \(H_0\), is the statement about a parameter that is assumed to be correct unless there is convincing statistical evidence suggesting otherwise: it is the status quo. The alternative hypothesis, \(H_a\), is the claim or belief about the parameter for which evidence is being collected. A researcher's claim about the population parameter is represented by the alternative hypothesis.
The null hypothesis contains an equality reference (\(=\), \(\ge\) or \(\le\)). In AP Statistics a test is carried out at the boundary of equality, so for a one-sample test of a proportion we write \[H_0:p=p_0,\] where \(p_0\) is the null hypothesized value. The alternative hypothesis is one-sided if it is \(H_a:p\lt p_0\) or \(H_a:p\gt p_0\), and two-sided if it is \(H_a:p\ne p_0\). Choose the direction from the question being asked before looking at the data, not from the sample result. Hypotheses always describe parameters (\(p\)), never statistics (\(\hat p\)).
The parameter in context
State what \(p\) means: it should reference the population parameter, the response variable and the population in context, for example "\(p\) = the true proportion of all students at the school who bike to school."
Conditions for the z-test
A one-sample z-test for a population proportion requires three conditions:
Randomization: the data should be collected using a random sample.
10% condition: when sampling without replacement, \(n\le10\%N\), where \(N\) is the size of the population.
Normality: the expected numbers of successes and failures under the null hypothesis, \(np_0\) and \(n(1-p_0)\), should each be at least 10.
Notice the difference from the confidence interval: for a test we assume \(H_0\) is true, so the expected counts use \(p_0\), not \(\hat p\).
Worked example · Writing hypotheses
For each claim, define the parameter and write the hypotheses. (a) A school newspaper says 40% of students bike to school; the principal thinks the true percentage is higher. (b) A company claims at least 70% of customers are satisfied; a consumer group suspects fewer. (c) A coin is claimed to be fair; we want to check whether it is biased in either direction.
(a) \(p\) = the true proportion of all students at the school who bike to school. \(H_0:p=0.40\), \(H_a:p\gt0.40\). (b) \(p\) = the true proportion of all customers of the company who are satisfied. \(H_0:p=0.70\), \(H_a:p\lt0.70\) (the null hypothesis is the claim being tested, written at the boundary, and the consumer group's suspicion is the alternative). (c) \(p\) = the long-run proportion of heads for this coin. \(H_0:p=0.50\), \(H_a:p\ne0.50\), a two-sided alternative since a bias in either direction matters.
Worked example · Checking conditions for a test
A school newspaper claims 40% of its 2,400 students bike. The principal surveys a random sample of 200 students, and 94 bike. Check the conditions for a one-sample z-test of \(H_0:p=0.40\) versus \(H_a:p\gt0.40\).
The students are a random sample. The population has 2,400 students and \(10\%\) of that is 240, which is at least \(n=200\), so the 10% condition is met. Under \(H_0\), the expected counts are \(np_0=200(0.40)=80\) and \(n(1-p_0)=200(0.60)=120\), both at least 10, so the normality condition is met. The conditions are satisfied and a one-sample z-test for a proportion is appropriate.
Worked example · Observed counts or expected counts?
In a random sample of 60 customers, 54 say they are satisfied. The company claims \(p_0=0.90\). The sample has 6 failures. Is the normality condition for the test met?
For a test we use the expected counts under the null hypothesis: \(np_0=60(0.90)=54\) and \(n(1-p_0)=60(0.10)=6\). The expected number of failures, 6, is less than 10, so the normality condition is not met and the z-test is not appropriate. (The observed number of failures, also 6, would fail the interval condition as well; the two are the same here only because \(\hat p=p_0\).)
Worked example · A poorly set-up test
A student writes \(H_0:\hat p=0.5\) and \(H_a:\hat p\gt0.52\) after seeing that 53% of a sample approved. Identify the errors.
(1) Hypotheses are about the parameter \(p\), not the statistic \(\hat p\). (2) The null and alternative values must be the same number: \(H_0:p=0.50\), \(H_a:p\gt0.50\). (3) The direction must come from the question before the data are seen, not from the sample result of 53%.
Exam focus
A test asks whether the data give convincing evidence for a claim. \(H_0:p=p_0\) is the status quo; \(H_a\) (\(\lt\), \(\gt\) or \(\ne\)) is the claim being investigated.
Define \(p\) in context (parameter, response variable, population). Hypotheses use \(p\), never \(\hat p\).
Conditions: random, 10%, and expected counts \(np_0\ge10\) and \(n(1-p_0)\ge10\).
Choose \(H_a\) from the question, before looking at the data.
Practice
A manufacturer claims 95% of its bulbs last at least 1,000 hours. A tester suspects the true percentage is lower. Write the hypotheses and define the parameter.
Show answer
\(p\) = the true proportion of all this manufacturer's bulbs that last at least 1,000 hours. \(H_0:p=0.95\), \(H_a:p\lt0.95\).
A pollster wants to know if the proportion of voters in a state who support a policy differs from the national value of 0.55. Write the hypotheses.
Show answer
\(p\) = the proportion of all voters in the state who support the policy. \(H_0:p=0.55\), \(H_a:p\ne0.55\).
A random sample of 80 students from a large school is used to test \(H_0:p=0.25\). Check the normality condition.
Show answer
\(np_0=80(0.25)=20\) and \(n(1-p_0)=80(0.75)=60\), both at least 10, so the condition is met.
Explain why the expected counts in a test use \(p_0\) while the counts in an interval use \(\hat p\).
Show answer
A test assumes the null hypothesis is true, so the sampling distribution of \(\hat p\) is centered at \(p_0\) and the expected counts are \(np_0\) and \(n(1-p_0)\). For an interval there is no null value, so the observed counts \(n\hat p\) and \(n(1-\hat p)\) are used as the best available estimates.
Why should the alternative hypothesis be chosen before collecting the data?
Show answer
Choosing the direction after seeing the result (for instance, picking "greater than" because \(\hat p\) came out above \(p_0\)) biases the test toward finding evidence and makes the p-value misleadingly small.
Explain what \(H_0\) and \(H_a\) mean in the context of a court trial, and which one is "assumed true."
Show answer
The null hypothesis is the presumption of innocence, assumed true until the evidence is convincing; the alternative is the claim that the defendant is guilty. A hypothesis test works the same way: \(H_0\) is assumed true and rejected only if the data are very unlikely when it is true.
The p-value is the central idea of a significance test and the most commonly misinterpreted number in statistics. It answers a specific question: if the null hypothesis were true, how surprising would a result as extreme as ours be? A small p-value says the sample result would be unusual under \(H_0\), which is evidence for the alternative. This lesson defines the p-value, shows how to find it from a normal model or a simulation, and explains how to interpret it correctly.
Required content · 3.6.A
Learning objective.
3.6.A. Interpret the p-value of a hypothesis test for a population proportion.
Essential knowledge.
3.6.A.1. Given the null hypothesis is true, there is a probability distribution of the test statistic called the null distribution. Using the null distribution, the p-value is the probability of obtaining a test statistic as extreme or more extreme (i.e., in the direction of the alternative hypothesis) than the test statistic that is observed given that the null hypothesis is true. That is, when x is the test statistic, the p-value is determined by finding the following:
3.6.A.1.i. The probability at or above the observed value of the test statistic, \(P(z\ge x)\), if the alternative is >
3.6.A.1.ii. The probability at or below the observed value of the test statistic, \(P(z\le x)\), if the alternative is <
3.6.A.1.iii. The probability less than or equal to the negative of the absolute value of the test statistic plus the probability greater than or equal to the absolute value of the test statistic, \(P(z\le-|x|)+P(z\ge|x|)\), if the alternative is ≠
3.6.A.2. If the distribution of the test statistic has been simulated, the p-value is the proportion of values in the null distribution that are as extreme or more extreme than the observed value of the test statistic. This is as follows:
3.6.A.2.i. The proportion at or above the observed value of the test statistic, if the alternative is >
3.6.A.2.ii. The proportion at or below the observed value of the test statistic, if the alternative is <
3.6.A.2.iii. The proportion less than or equal to the negative of the absolute value of the test statistic plus the proportion greater than or equal to the absolute value of the test statistic, if the alternative is ≠
3.6.A.3. An interpretation of the p-value of a hypothesis test for a population proportion should include a statement that the p-value is computed by assuming the null hypothesis is true (i.e., by assuming the true population proportion is equal to the particular value stated in the null hypothesis in context).
3.6.A.4. Small p-values indicate that the observed value of the test statistic would be unusual if the null hypothesis were true and therefore provide evidence for the alternative hypothesis. The lower the p-value, the more convincing the statistical evidence for the alternative hypothesis.
3.6.A.5. p-values that are not small indicate that the observed value of the test statistic would not be unusual if the null hypothesis were true and therefore do not provide convincing statistical evidence for the alternative hypothesis, nor do they provide evidence that the null hypothesis is true.
The null distribution and the p-value
Given that the null hypothesis is true, the test statistic has a probability distribution called the null distribution. Using the null distribution, the p-value is the probability of obtaining a test statistic as extreme as or more extreme than the one observed (extreme means in the direction of the alternative hypothesis), given that the null hypothesis is true. If the observed value of the test statistic is \(z\), the p-value is:
\(P(Z\ge z)\) for \(H_a:p\gt p_0\) (the area to the right of the observed \(z\));
\(P(Z\le z)\) for \(H_a:p\lt p_0\) (the area to the left);
\(P(Z\le-|z|)+P(Z\ge|z|)\) for \(H_a:p\ne p_0\) (the area in both tails, which is twice the one-tail area).
Figure 3.5. The p-value is an area under the null distribution of the test statistic: the area at or above the observed z for \(H_a:p>p_0\), at or below it for \(H_a:p\lt p_0\), and in both tails (beyond \(-|z|\) and \(+|z|\)) for \(H_a:p\ne p_0\).
The z-statistic for a one-sample proportion test is introduced in the next lesson; here the focus is on what the p-value means and how it is found from the null distribution.
p-values from a simulation
If the null distribution of the test statistic has been simulated, the p-value is the proportion of values in the simulated distribution that are as extreme or more extreme than the observed value: the proportion at or above the observed value if \(H_a\) is \(\gt\), at or below it if \(H_a\) is \(\lt\), and for \(\ne\) the proportion at or below \(-|{\rm observed}|\) plus the proportion at or above \(|{\rm observed}|\) (when the null distribution is symmetric, twice the smaller tail).
Interpreting a p-value
An interpretation of a p-value should include a statement that it is computed by assuming the null hypothesis is true, in the context of the problem. A template: "Assuming that [null hypothesis in context], there is a [p-value] probability of observing a sample [statistic in context] [as large as / as small as / as far from \(p_0\) as] the one observed, just by random chance."
Small p-values indicate that the observed value of the test statistic would be unusual if the null hypothesis were true, and therefore provide evidence for the alternative hypothesis. The smaller the p-value, the more convincing the statistical evidence.
Large p-values (not small) indicate that the observed value would not be unusual if the null hypothesis were true, so they do not provide convincing evidence for the alternative. They do not provide evidence that the null hypothesis is true.
Common errors: the p-value is not the probability that the null hypothesis is true, not the probability that the result happened "by chance," and not the probability that the alternative is true. It is a probability about the data, assuming the null hypothesis.
Worked example · Finding a p-value from z
Find the p-value for each: (a) \(z=1.8\) with \(H_a:p\gt p_0\); (b) \(z=-2.3\) with \(H_a:p\lt p_0\); (c) \(z=2.5\) with \(H_a:p\ne p_0\).
A test of whether more than 40% of students at a school bike to school (\(H_0:p=0.40\), \(H_a:p\gt0.40\)) found \(\hat p=0.47\) in a random sample of 200 and a p-value of 0.022. Interpret the p-value and say what it suggests.
Interpretation: Assuming that 40% of all students at the school bike, there is about a 2.2% chance of getting a random sample of 200 students in which 47% or more bike, just by random sampling variation. Meaning: such a sample would be unusual if the true proportion were 0.40, so the data provide evidence (a fairly small p-value) that more than 40% of the students bike.
Worked example · A simulated p-value
To test the same claim, a simulation drew 10,000 random samples of 200 from a population with \(p=0.40\) and recorded each \(\hat p\). In 247 of the 10,000 samples \(\hat p\ge0.47\). Find the p-value and compare with the normal-model answer.
The p-value is the proportion of simulated samples at least as extreme as the observed 0.47: \(247/10{,}000=0.0247\). The normal model gave 0.022; the two agree closely and the small difference is simulation variation (more trials would bring them closer).
Worked example · A large p-value
In a random sample of 80 from a large population a test of \(H_0:p=0.25\) versus \(H_a:p\gt0.25\) gave a p-value of 0.061. What can be concluded?
A p-value of 0.061 means that, if \(p\) were really 0.25, a sample proportion this large or larger would occur about 6% of the time, which is not especially rare. The data do not provide convincing evidence for the alternative at the 5% level. This does not show that \(p=0.25\); it means that this sample is not strong enough evidence against it.
Exam focus
p-value = probability, assuming \(H_0\) is true, of a test statistic as extreme or more extreme than observed (in the direction of \(H_a\)). Right tail for \(\gt\), left for \(\lt\), both tails for \(\ne\).
With a simulation: the proportion of simulated values as extreme or more extreme than observed.
Interpret with "assuming \(H_0\) is true (in context)". Small p-value: evidence for \(H_a\). Large p-value: no convincing evidence for \(H_a\), and no evidence for \(H_0\).
It is not the probability that \(H_0\) is true.
Practice
Find the p-value for \(z=2.1\) with \(H_a:p\gt p_0\), and for \(z=-1.4\) with \(H_a:p\ne p_0\).
Show answer
\(P(Z\ge2.1)=0.0179\). For \(z=-1.4\) the two-sided p-value is \(2P(Z\le-1.4)=2(0.0808)=0.1615\).
A test gives a p-value of 0.003. Interpret it in the context of \(H_0:p=0.60\), where \(p\) is the proportion of all customers who are satisfied, with a random sample of 120 customers.
Show answer
Assuming that 60% of all customers are satisfied, there is a 0.3% chance of getting a random sample of 120 customers whose satisfied proportion is as extreme (in the direction of \(H_a\)) as the observed one. That would be very unusual, which is strong evidence for the alternative hypothesis.
A student says "the p-value is 0.04, so there is a 4% chance that \(H_0\) is true." Explain the error.
Show answer
The p-value is computed by assuming \(H_0\) is true; it is the probability of data this extreme if \(H_0\) were true, not the probability that \(H_0\) is true. \(H_0\) is either true or false.
In a simulation of 5,000 samples under \(H_0\), 180 had a statistic at least as large as the observed value (\(H_a\) is one-sided, \(\gt\)). What is the estimated p-value?
Show answer
\(180/5000=0.036\).
Two tests of the same \(H_0\) give p-values 0.04 and 0.0004. Which gives stronger evidence for the alternative, and why?
Show answer
The one with p-value 0.0004: its result would be much more unusual if \(H_0\) were true.
The p-value for a test is 0.35. Does this show that the null hypothesis is true?
Show answer
No. A large p-value only means the data are consistent with \(H_0\); there is not convincing evidence for the alternative. The true parameter could still differ from \(p_0\) by an amount that this sample was too small to detect.
With the hypotheses written and the conditions checked, the rest of the test is arithmetic and judgment: compute the standardized test statistic, find its p-value, compare the p-value with the significance level, and write a conclusion in context. The conclusion has a very specific form, because a test can provide evidence for the alternative hypothesis but can never prove the null hypothesis.
Required content · 3.7.A, 3.7.B
Learning objectives.
3.7.A. Calculate an appropriate test statistic and p-value for testing a hypothesis about a population proportion.
3.7.B. Justify a claim about the population based on the results of a hypothesis test for a population proportion.
Essential knowledge.
3.7.A.1. The test statistic for testing a population proportion is \(z=\dfrac{\hat p-p_0}{\sqrt{\dfrac{p_0(1-p_0)}{n}}}\). The z-statistic has a standard normal distribution when the null hypothesis is true.
3.7.A.2. The distribution of the test statistic assuming the null hypothesis is true (null distribution) can be approximated by a probability model (e.g., a theoretical distribution such as the standard normal distribution).
3.7.A.3. The p-value of a one-sample z-test for a population proportion is found from the standard normal distribution using a table or technology.
3.7.B.1. The significance level of a hypothesis test, denoted by α, is the predetermined probability of rejecting the null hypothesis given that it is true. The significance level may be given or determined by the researcher. The relationship between a p-value and the significance level of a hypothesis test determines whether a result is statistically significant.
3.7.B.2. A formal decision in a hypothesis test explicitly compares the p-value to the significance level, \(\alpha\). If the p-value \(\le\alpha\), then reject the null hypothesis, \(H_0:p=p_0\). If the p-value \(>\alpha\), then fail to reject the null hypothesis.
3.7.B.3. Rejecting the null hypothesis means there is convincing statistical evidence to support the alternative hypothesis. Failing to reject the null hypothesis means there is not convincing statistical evidence to support the alternative hypothesis.
3.7.B.4. A hypothesis test can lead to rejecting or not rejecting the null hypothesis but can never lead to concluding or proving that the null hypothesis is true. Lack of statistical evidence for the alternative hypothesis is not the same as evidence for the null hypothesis.
3.7.B.5. The results of a hypothesis test for a population proportion can serve as the statistical reasoning to support the answer to an investigative question about the population that was sampled.
3.7.B.6. A conclusion for the hypothesis test for a population proportion is stated in context consistent with, and in terms of, the alternative hypothesis using non-definitive language. The conclusion should contain a reference to the parameter and the population.
The test statistic
The test statistic for a one-sample z-test for a population proportion is \[z=\frac{\hat p-p_0}{\sqrt{\dfrac{p_0(1-p_0)}{n}}}.\] It says how many standard deviations the sample proportion \(\hat p\) is from the null value \(p_0\), using the standard deviation of \(\hat p\) assuming \(H_0\) is true (so it uses \(p_0\), not \(\hat p\)). When \(H_0\) is true and the conditions are met, \(z\) has approximately a standard normal distribution; this is the null distribution, and the p-value is found from it with a table or technology.
Figure 3.6. If the true proportion is 0.40, sample proportions from samples of 200 are approximately normal with mean 0.40 and standard deviation 0.035. The observed \(\hat p=0.47\) is 2.02 standard deviations above the mean, and the shaded area to its right is the one-sided p-value, 0.022.
Significance level and the decision
The significance level \(\alpha\) is the predetermined probability of rejecting the null hypothesis given that it is true; it may be given or chosen by the researcher (commonly 0.05, 0.01 or 0.10) before the data are collected. A formal decision explicitly compares the p-value with \(\alpha\):
If the p-value \(\le\alpha\), reject \(H_0\). The result is statistically significant.
If the p-value \(\gt\alpha\), fail to reject \(H_0\).
Writing the conclusion
Rejecting \(H_0\) means there is convincing statistical evidence to support the alternative hypothesis. Failing to reject \(H_0\) means there is not convincing statistical evidence to support the alternative. A test can lead to rejecting or not rejecting the null hypothesis but can never lead to concluding or proving that the null hypothesis is true: lack of evidence for the alternative is not evidence for the null.
A good conclusion has three parts, written in context and consistent with the alternative hypothesis, using non-definitive language ("evidence suggests," never "proves"): (1) a decision that explicitly compares the p-value with \(\alpha\); (2) a statement that there is (or is not) convincing evidence; (3) the alternative hypothesis in context, referring to the parameter and the population.
The four-step format
State: the parameter and hypotheses (and \(\alpha\)). 2. Plan: the procedure (one-sample z-test for a proportion) and conditions. 3. Do: \(\hat p\), the test statistic and the p-value (calculator: `STAT` > `TESTS` > `5:1-PropZTest`). 4. Conclude: the decision and the conclusion in context.
Worked example · A complete test (right-tailed)
A school newspaper claims that 40% of students bike to school. The principal thinks the percentage is higher and surveys a random sample of 200 of the school's 2,400 students: 94 bike. Is there convincing evidence at \(\alpha=0.05\)?
State: \(p\) = the proportion of all students at the school who bike. \(H_0:p=0.40\), \(H_a:p\gt0.40\), \(\alpha=0.05\). Plan: one-sample z-test for a proportion. Random sample; \(200\le10\%\) of 2,400; \(np_0=80\) and \(n(1-p_0)=120\) are at least 10. Do: \(\hat p=94/200=0.47\). \(z=\dfrac{0.47-0.40}{\sqrt{0.40(0.60)/200}}=\dfrac{0.07}{0.0346}=2.02\), and the p-value is \(P(Z\ge2.02)=0.0217\). Conclude: because the p-value 0.022 is less than \(\alpha=0.05\), we reject \(H_0\). There is convincing statistical evidence that the proportion of all students at the school who bike to school is greater than 0.40.
Worked example · A two-sided test
A coin is flipped 100 times and lands heads 62 times. Is there convincing evidence at \(\alpha=0.05\) that the coin is not fair?
\(H_0:p=0.50\), \(H_a:p\ne0.50\), where \(p\) is the long-run proportion of heads. Flips are independent and \(np_0=n(1-p_0)=50\). \(\hat p=0.62\), \(z=\dfrac{0.62-0.50}{\sqrt{0.5(0.5)/100}}=\dfrac{0.12}{0.05}=2.40\), and the two-sided p-value is \(2P(Z\ge2.40)=2(0.0082)=0.0164\). Since \(0.0164\lt0.05\), reject \(H_0\): there is convincing evidence that the long-run proportion of heads for this coin differs from 0.50.
Worked example · Failing to reject
A company claims at least 70% of its customers recycle the packaging. A consumer group takes a random sample of 150 customers (from many thousands) and finds that 96 recycle. Test at \(\alpha=0.05\) whether the proportion is less than 0.70.
\(H_0:p=0.70\), \(H_a:p\lt0.70\), where \(p\) is the proportion of all the company's customers who recycle. Conditions: random; \(np_0=105\), \(n(1-p_0)=45\), both at least 10. \(\hat p=96/150=0.64\), \(z=\dfrac{0.64-0.70}{\sqrt{0.7(0.3)/150}}=\dfrac{-0.06}{0.0374}=-1.60\), and the p-value is \(P(Z\le-1.60)=0.0544\). Since \(0.0544\gt0.05\), we fail to reject \(H_0\). There is not convincing statistical evidence that the proportion of all the company's customers who recycle is less than 0.70. (This does not prove the company's claim: the evidence is merely not strong enough to reject it at the 5% level.)
Worked example · The same data, a different alternative
For the bike data (\(\hat p=0.47\), \(n=200\), \(p_0=0.40\)), what is the p-value if the alternative had been two-sided, and does the decision change at \(\alpha=0.05\)?
The test statistic is still 2.02. The two-sided p-value is \(2(0.0217)=0.0433\), which is still less than 0.05, so the decision to reject does not change, but the p-value doubled. At \(\alpha=0.01\) neither the one-sided (0.0217) nor the two-sided (0.0433) p-value would lead to rejecting \(H_0\).
Calculator
TI-84: `STAT` > `TESTS` > `5:1-PropZTest` with \(p_0\), \(x\), \(n\) and the alternative (`prop ≠ p0`, `< p0` or `> p0`). The output gives \(z\), the p-value and \(\hat p\). Write the hypotheses, conditions, and the conclusion in context.
Exam focus
\(z=\dfrac{\hat p-p_0}{\sqrt{p_0(1-p_0)/n}}\); p-value from the standard normal distribution according to \(H_a\).
p-value \(\le\alpha\): reject \(H_0\) (convincing evidence for \(H_a\)). p-value \(\gt\alpha\): fail to reject (not convincing evidence for \(H_a\)); never "accept \(H_0\)."
Conclusion: compare p-value with \(\alpha\), state the decision, and write the alternative hypothesis in context in non-definitive language.
Steps: State, Plan (conditions), Do, Conclude.
Practice
In a random sample of 600 from a large city, 318 approve of a new mayor. Test \(H_0:p=0.50\) against \(H_a:p\gt0.50\) at \(\alpha=0.05\).
Show answer
\(\hat p=0.53\), \(z=\dfrac{0.03}{\sqrt{0.25/600}}=1.47\), p-value \(=0.071\). Since \(0.071\gt0.05\), fail to reject \(H_0\): there is not convincing evidence that more than half of the city's residents approve of the mayor.
In a random sample of 80 items from a large shipment, 26 are defective. Test \(H_0:p=0.25\) against \(H_a:p\gt0.25\) at \(\alpha=0.05\).
Show answer
Conditions: \(np_0=20\) and \(n(1-p_0)=60\). \(\hat p=0.325\), \(z=\dfrac{0.075}{\sqrt{0.25(0.75)/80}}=1.55\), p-value \(=0.061\). Fail to reject \(H_0\): not convincing evidence that more than 25% of items in the shipment are defective.
A test of \(H_0:p=0.30\) vs \(H_a:p\ne0.30\) gives \(z=-2.5\). Find the p-value and state the decision at \(\alpha=0.01\).
Show answer
p-value \(=2(0.0062)=0.0124\). Since \(0.0124\gt0.01\), fail to reject \(H_0\) at the 1% level (but it would be rejected at the 5% level).
A student's conclusion reads, "Since p = 0.30 is greater than 0.05, we accept the null hypothesis and conclude that the proportion is 0.40." Fix it.
Show answer
Correct version: "Since the p-value, 0.30, is greater than \(\alpha=0.05\), we fail to reject \(H_0\). There is not convincing statistical evidence that the proportion of ... [context] is greater (or different) than 0.40." Failing to reject never proves that the proportion is 0.40.
Explain why \(p_0\) (not \(\hat p\)) is used in the denominator of the z-statistic.
Show answer
The p-value is calculated assuming \(H_0\) is true, so the standard deviation of \(\hat p\) should be the one that applies when \(p=p_0\): \(\sqrt{p_0(1-p_0)/n}\).
Would a larger sample, with the same \(\hat p\) and \(p_0\), give a larger or smaller p-value (for a case where \(\hat p\) is on the side of \(H_a\))? Why?
Show answer
A smaller p-value. The standard deviation \(\sqrt{p_0(1-p_0)/n}\) decreases as \(n\) grows, so the same difference \(\hat p-p_0\) is more standard deviations from \(p_0\), giving a larger \(|z|\).
A test decision is based on a sample, so it can be wrong. Sometimes a random sample gives a small p-value even though the null hypothesis is true, and sometimes it gives a large p-value even though the alternative is true. This lesson names the two kinds of error, gives the probability of each, defines the power of a test, and describes what increases it and how the consequences of each error should guide the choice of \(\alpha\) and the sample size.
Required content · 3.8.A, 3.8.B, 3.8.C, 3.8.D
Learning objectives.
3.8.A. Identify Type I and Type II errors.
3.8.B. Calculate the probability of Type I and Type II errors.
3.8.C. Identify the factors that affect the probability of errors in hypothesis testing.
3.8.D. Interpret Type I and Type II errors.
Essential knowledge.
3.8.A.1. A Type I error occurs when there is convincing statistical evidence that the alternative hypothesis is true (due to the small p-value), but it is not.
3.8.A.2. A Type II error occurs when there is not convincing statistical evidence that the alternative hypothesis is true (due to the large p-value), but it is.
3.8.A.3. The power of a hypothesis test is the probability that a hypothesis test will correctly reject the false null hypothesis.
3.8.B.1. The probability of making a Type I error is defined as the significance level, α. For a given study and hypothesis test, the probability of making a Type I error is typically set to a small value (e.g., 0.01, 0.05, 0.10) prior to collecting the data.
3.8.B.2. The probability of making a Type II error is \(1-\text{power}\).
3.8.C.1. For a given study and hypothesis test, the probability of a Type II error should ideally be small, and thus, the power will be large (e.g., \(P(\text{Type II error})\le0.20\) and power \(\ge0.80\)). The probability of a Type II error decreases and the power increases when any one of the following occurs, provided the others do not change:
3.8.C.1.i. Sample size(s) increases.
3.8.C.1.ii. Standard error decreases.
3.8.C.1.iii. True parameter value is farther from the null hypothesis.
3.8.C.1.iv. Significance level of a test increases.
3.8.D.1. In some studies, making a Type I error may have more serious consequences than making a Type II error. In other studies, making a Type II error may have more serious consequences than making a Type I error. The consequences of each error should be considered prior to conducting the study.
3.8.D.2. Because the significance level, α, is the probability of making a Type I error, the consequences of a Type I error influence decisions about a significance level.
3.8.D.3. Because sample size influences the probability of making a Type II error, the consequences of a Type II error influence decisions about how large the sample size should be.
Type I and Type II errors
There are two ways a test can be wrong.
A Type I error occurs when there is convincing statistical evidence that the alternative hypothesis is true (because the p-value is small), but it is not: we reject a true null hypothesis. (A "false positive.")
A Type II error occurs when there is not convincing statistical evidence that the alternative hypothesis is true (because the p-value is large), but it is: we fail to reject a false null hypothesis. (A "false negative.")
Decision
\(H_0\) is true
\(H_a\) is true
Reject \(H_0\)
Type I error
Correct decision
Fail to reject \(H_0\)
Correct decision
Type II error
Write each error in context: for a medical test of "the patient has the disease," a Type I error is concluding the patient has the disease when they do not, and a Type II error is concluding there is no convincing evidence of the disease when the patient does have it.
Probabilities of the errors
The probability of a Type I error is the significance level \(\alpha\): if \(H_0\) is true and we reject whenever the p-value is at most \(\alpha\), then we reject a true null hypothesis in a fraction \(\alpha\) of repeated samples. It is typically set to a small value (0.01, 0.05 or 0.10) before collecting the data.
The power of a test is the probability that the test will correctly reject a false null hypothesis (for a specific true value of the parameter). The probability of a Type II error is \(1-\text{power}\), often written \(\beta\). Ideally the probability of a Type II error is small and the power is large (for example power \(\ge0.80\)).
Figure 3.7. The green curve is the distribution of \(\hat p\) when \(H_0:p=0.50\) is true and the red curve when the true proportion is 0.60. With the rejection cutoff 0.582 (for \(\alpha=0.05\)), the orange area under the green curve is the probability of a Type I error, the blue area under the red curve is the probability of a Type II error (about 0.36), and the rest of the red curve (about 0.64) is the power.
What increases power
The probability of a Type II error decreases, and the power increases, when any one of the following occurs (the others unchanged):
The sample size increases.
The standard error decreases (for a proportion, from a larger \(n\)).
The true parameter value is farther from the null hypothesis: bigger differences are easier to detect.
The significance level \(\alpha\) increases (but then the probability of a Type I error increases too).
For \(H_0:p=0.50\), \(H_a:p\gt0.50\) with \(\alpha=0.05\) and a true proportion of 0.60, the power is about 0.41 for \(n=50\), 0.64 for \(n=100\), 0.89 for \(n=200\) and 0.99 for \(n=400\). For \(n=100\), the power is 0.26 when the true proportion is 0.55, 0.64 when it is 0.60 and 0.99 when it is 0.70. For \(n=100\) and \(p=0.60\), the power is 0.37, 0.64 and 0.77 for \(\alpha=0.01\), 0.05 and 0.10.
Choosing \(\alpha\) and \(n\) with the consequences in mind
In some studies a Type I error is more serious (for example, approving an ineffective drug for the market); in others a Type II error is (failing to detect a dangerous contaminant in water). The consequences of each error should be considered before the study is conducted. Because \(\alpha\) is the probability of a Type I error, the seriousness of a Type I error influences the choice of the significance level: a smaller \(\alpha\) when a Type I error is very costly. Because sample size influences the probability of a Type II error, the seriousness of a Type II error influences how large a sample to take.
Worked example · Naming the errors in context
A company's quality-control test has \(H_0:p=0.02\) and \(H_a:p\gt0.02\), where \(p\) is the proportion of defective parts in a shipment. Describe a Type I error, a Type II error, and which is more serious for the buyer.
Type I: concluding there is convincing evidence that more than 2% of parts in the shipment are defective when in fact the proportion is 2% (the shipment is rejected for no good reason). Type II: failing to find convincing evidence that more than 2% are defective when in fact more are (a bad shipment is accepted). For the buyer, a Type II error (accepting defective parts) is likely more costly, which argues for a larger sample or a larger \(\alpha\); for the supplier, a Type I error (a good shipment rejected) is more costly.
Worked example · Computing power
A test of \(H_0:p=0.50\) versus \(H_a:p\gt0.50\) uses \(n=100\) and \(\alpha=0.05\). Find the power when the true proportion is \(p=0.60\).
Under \(H_0\), \(\sigma_{\hat p}=\sqrt{0.5(0.5)/100}=0.05\); we reject when \(z\ge1.645\), that is, when \(\hat p\ge0.50+1.645(0.05)=0.5822\). If the true proportion is 0.60, the standard deviation of \(\hat p\) is \(\sqrt{0.6(0.4)/100}=0.0490\), and the probability of getting \(\hat p\ge0.5822\) is \(P\!\left(z\ge\dfrac{0.5822-0.60}{0.0490}\right)=P(z\ge-0.36)=0.64\). The power is about 0.64, so the probability of a Type II error is about \(1-0.64=0.36\).
Worked example · Improving power
The power computed above is only 0.64. Describe two changes that would increase it, and the drawback of each.
Increase the sample size: with \(n=200\) the power is 0.89, but sampling is more expensive. Increase \(\alpha\) from 0.05 to 0.10: the power rises to 0.77, but the probability of a Type I error doubles from 0.05 to 0.10. (A third factor, how far the true proportion is from 0.50, cannot be chosen by the researcher.)
Worked example · The relationship between \(\alpha\) and the errors
A researcher uses \(\alpha=0.01\) instead of \(\alpha=0.05\) for the same test, with the same sample size. What happens to the probabilities of the two errors?
The probability of a Type I error falls from 0.05 to 0.01. With the same sample, the rejection region is smaller, so it is harder to reject \(H_0\), and the probability of a Type II error rises (the power falls, for \(p=0.60\) and \(n=100\), from 0.64 to 0.37).
Exam focus
Type I: reject a true \(H_0\); probability \(\alpha\). Type II: fail to reject a false \(H_0\); probability \(1-\text{power}\).
Power = probability of correctly rejecting a false \(H_0\). It increases with a larger sample size, a smaller standard error, a true value farther from \(H_0\), and a larger \(\alpha\).
Lowering \(\alpha\) lowers the chance of a Type I error but raises the chance of a Type II error (for a fixed \(n\)).
Describe errors in context; use their consequences to choose \(\alpha\) and \(n\).
Practice
A medical test for a disease has \(H_0\): the patient does not have the disease. Describe a Type I and a Type II error.
Show answer
Type I: concluding that the patient has the disease when the patient does not. Type II: failing to find convincing evidence of the disease when the patient actually has it.
What is the probability of a Type I error if a test is conducted at the 1% significance level?
Show answer
\(\alpha=0.01\).
List three ways to reduce the probability of a Type II error.
Show answer
Increase the sample size, increase the significance level \(\alpha\) (with a greater risk of a Type I error), or (when possible) study a situation in which the true parameter is farther from the null value or the variability is smaller.
A test has power 0.85 against a particular alternative. What is the probability of a Type II error for that alternative, and what does the power mean?
Show answer
\(1-0.85=0.15\). The power means that if the true parameter is that alternative value, the test will reject the false null hypothesis about 85% of the time.
A city tests whether a river's contamination level exceeds a safe limit (\(H_a\): exceeds). Which error is more serious, and how should that influence the test?
Show answer
A Type II error (missing contamination that exists) is more serious for public health. The test should be designed for high power: a larger sample, and possibly a larger \(\alpha\) accepting more false alarms.
Explain why decreasing \(\alpha\) while keeping everything else the same decreases the power.
Show answer
A smaller \(\alpha\) requires stronger evidence to reject \(H_0\), so the cutoff moves farther into the tail. A false null hypothesis is then rejected less often, so the power falls and the Type II error probability rises.
Sampling distribution of a difference in two proportions
Many questions compare two groups: Do juniors and seniors differ in how many bring lunch? Does a new treatment help more patients than the old one? The natural statistic is the difference between the two sample proportions, \(\hat p_1-\hat p_2\). This lesson describes the sampling distribution of that difference: its center, its spread, the conditions that make it approximately normal, and how to find probabilities with it.
Required content · 3.9.A, 3.9.B, 3.9.C
Learning objectives.
3.9.A. Calculate the mean and standard deviation of the sampling distribution for the difference between two sample proportions.
3.9.B. Justify the appropriateness of conditions for the sampling distribution for the difference between two sample proportions.
3.9.C. Interpret the mean, standard deviation, and probabilities for the sampling distribution for the difference between two sample proportions.
Essential knowledge.
3.9.A.1. For two independent populations, with population proportions \(p_1\) and \(p_2\), when the sampled values are independent, the sampling distribution for the difference in sample proportions, \(\hat p_1-\hat p_2\), has a mean, \(\mu_{\hat p_1-\hat p_2}=p_1-p_2\), and standard deviation, \(\sigma_{\hat p_1-\hat p_2}=\sqrt{\dfrac{p_1(1-p_1)}{n_1}+\dfrac{p_2(1-p_2)}{n_2}}\).
3.9.B.1. When sampling without replacement, two conditions must be met:
3.9.B.1.i. The randomization condition: the data should be collected using two independent random samples.
3.9.B.1.ii. The 10% condition: the size of each sample should be less than or equal to 10% of the respective population size: \(n_1\le10\%N_1\) and \(n_2\le10\%N_2\), where \(N_1\) is the size of population 1 and \(N_2\) is the size of population 2. The sample sizes are represented as \(n_1\) and \(n_2\).
3.9.B.2. If the data come from an experiment, the data only need to meet the randomization condition. The treatments must be randomly assigned to the experimental units to meet the randomization condition.
3.9.B.3. The sampling distribution for the difference between sample proportions, \(\hat p_1-\hat p_2\), will have an approximately normal distribution provided both sample sizes are large enough. To ensure that both samples are large enough, the data must meet the following conditions: \(n_1p_1\ge10\), \(n_1(1-p_1)\ge10\), \(n_2p_2\ge10\), and \(n_2(1-p_2)\ge10\), where \(n_1p_1\) and \(n_2p_2\) are the expected numbers of successes and \(n_1(1-p_1)\) and \(n_2(1-p_2)\) are the expected numbers of failures.
3.9.C.1. The mean, standard deviation, and probabilities for the sampling distribution for the difference between two sample proportions should be interpreted within the context of two specific populations.
Center and spread
Consider two independent populations with population proportions \(p_1\) and \(p_2\), from which independent random samples of sizes \(n_1\) and \(n_2\) are taken. The sampling distribution of \(\hat p_1-\hat p_2\) has \[\mu_{\hat p_1-\hat p_2}=p_1-p_2\qquad\text{and}\qquad\sigma_{\hat p_1-\hat p_2}=\sqrt{\frac{p_1(1-p_1)}{n_1}+\frac{p_2(1-p_2)}{n_2}}.\] The first statement says that \(\hat p_1-\hat p_2\) is an unbiased estimator of \(p_1-p_2\). The second comes from the fact that the variances of independent statistics add: \(\sigma^2_{\hat p_1-\hat p_2}=\sigma^2_{\hat p_1}+\sigma^2_{\hat p_2}\). Notice that the variances add even though the statistics are subtracted; the standard deviations do not simply add.
Conditions
When sampling without replacement, two conditions must be met:
Randomization: the data should be collected using two independent random samples.
10% condition: each sample is at most 10% of its population: \(n_1\le10\%N_1\) and \(n_2\le10\%N_2\).
If the data come from a randomized experiment, only the randomization condition is needed: the treatments must be randomly assigned to the experimental units, and the 10% condition does not apply.
The sampling distribution of \(\hat p_1-\hat p_2\) is approximately normal provided both samples are large enough, which is checked with \[n_1p_1\ge10,\quad n_1(1-p_1)\ge10,\quad n_2p_2\ge10,\quad n_2(1-p_2)\ge10.\]
Figure 3.8. For \(p_1=0.60\), \(n_1=150\) and \(p_2=0.50\), \(n_2=200\), the difference \(\hat p_1-\hat p_2\) is approximately normal with mean 0.10 and standard deviation 0.053. The shaded area is the probability that the sample proportion from population 1 is lower than that from population 2.
As always, interpret the mean, the standard deviation and probabilities within the context of the two specific populations.
Worked example · Describing the sampling distribution
In one city 60% of residents favor a new transit line (\(p_1=0.60\)) and in a neighboring city 50% do (\(p_2=0.50\)). Independent random samples of \(n_1=150\) and \(n_2=200\) residents are taken. Describe the sampling distribution of \(\hat p_1-\hat p_2\) and find the probability that the sample proportion from the first city is lower than that from the second.
The expected counts are \(150(0.60)=90\), \(150(0.40)=60\), \(200(0.50)=100\) and \(200(0.50)=100\), all at least 10, so the distribution is approximately normal (given random samples that are each under 10% of their populations). The mean is \(0.60-0.50=0.10\) and the standard deviation is \(\sqrt{\dfrac{0.6(0.4)}{150}+\dfrac{0.5(0.5)}{200}}=\sqrt{0.0016+0.00125}=0.0534\). The first sample proportion is lower exactly when \(\hat p_1-\hat p_2\lt0\): \(z=\dfrac{0-0.10}{0.0534}=-1.87\), so the probability is \(P(z\lt-1.87)=0.031\). In context: about 3% of pairs of such samples would show the first city less supportive than the second even though it is actually 10 points more supportive.
Worked example · A larger difference
Using the same cities and samples, find the probability that the sample difference is more than 0.15 (the first city looks more than 15 points more supportive).
\(z=\dfrac{0.15-0.10}{0.0534}=0.94\), so \(P(\hat p_1-\hat p_2\gt0.15)=P(z\gt0.94)=0.175\) (more precisely 0.1745).
Worked example · Checking conditions in an experiment
In a randomized experiment, 100 volunteers were randomly assigned to a new study app and 100 to the old one. A researcher wants to model the difference in the proportion who improve. Which conditions are needed?
The data come from a randomized experiment, so only the randomization condition (random assignment of treatments) is needed; the 10% condition is unnecessary. The normality condition (the four expected-count checks) is still needed for a normal model.
Worked example · How sample size changes the spread
Suppose \(p_1=0.6\) and \(p_2=0.5\) as before, but both samples are of size 600. Find the standard deviation of the difference and compare it.
\(\sigma=\sqrt{\dfrac{0.24}{600}+\dfrac{0.25}{600}}=\sqrt{0.000817}=0.0286\), much smaller than 0.0534 from the earlier samples (150 and 200). With larger samples, the sample difference is typically much closer to the true difference of 0.10.
Conditions: two independent random samples (or a randomized experiment), 10% for each sample (not needed for an experiment), and all four of \(n_ip_i\) and \(n_i(1-p_i)\ge10\).
Approximately normal when the conditions hold: use \(z=\dfrac{(\hat p_1-\hat p_2)-(p_1-p_2)}{\sigma}\).
Interpret in context of the two populations.
Practice
\(p_1=0.40\), \(n_1=100\), \(p_2=0.30\), \(n_2=120\). Find the mean and standard deviation of \(\hat p_1-\hat p_2\) and check the normality condition.
Show answer
Mean \(0.10\). Standard deviation \(\sqrt{0.4(0.6)/100+0.3(0.7)/120}=\sqrt{0.0024+0.00175}=0.0644\). Expected counts: 40, 60, 36, 84, all at least 10.
For the previous problem, find \(P(\hat p_1-\hat p_2\lt0)\).
Show answer
\(z=-0.10/0.0644=-1.55\), so the probability is about 0.060.
Why are the variances added, not the standard deviations, when finding the standard deviation of a difference?
Show answer
For independent random variables, the variance of a sum or difference is the sum of the variances. Taking the square root of the sum of the variances gives the standard deviation, which is not the sum of the standard deviations.
Which condition is not needed if the data come from a randomized experiment?
Show answer
The 10% condition (and the requirement of independent random samples): only random assignment of the treatments to the units is required.
If both sample sizes double, what happens to the standard deviation of \(\hat p_1-\hat p_2\)?
Show answer
It is divided by \(\sqrt2\); the standard deviation decreases to about 71% of its previous value.
A student says "the mean of \(\hat p_1-\hat p_2\) is 0 because the two samples are random." Explain the error.
Show answer
The mean is \(p_1-p_2\), the true difference between the populations. It is 0 only when the populations have the same proportion; random sampling does not make the proportions equal.
Confidence intervals for a difference in two proportions
To compare two groups, estimate the difference between their population proportions. A confidence interval for \(p_1-p_2\) gives a range of plausible values for that difference, and whether the interval contains 0 tells us whether the data give convincing evidence that the proportions differ. This lesson covers the two-sample z-interval for a difference between population proportions: parameters, conditions, the formula, and the interpretation and use of the interval.
3.10.A. Identify an appropriate confidence interval procedure including the parameters for the difference between two population proportions.
3.10.B. Justify the appropriateness of constructing a confidence interval for the difference between two population proportions by verifying conditions.
3.10.C. Calculate an appropriate confidence interval for the difference between two population proportions.
3.10.D. Calculate the standard error and margin of error for estimating the difference between two population proportions.
3.11.A. Interpret a confidence interval in context for the difference between two population proportions.
3.11.B. Justify a claim based on a confidence interval for the difference between two population proportions.
Essential knowledge.
3.10.A.1. Based on the sample data, a confidence interval can be calculated to estimate the difference between two population proportions. The appropriate confidence interval procedure is a two-sample z-interval for a difference between population proportions.
3.10.A.2. The parameters of a confidence interval for the difference between two population proportions should refer to the difference in the proportions, the response variable, and the populations in context.
3.10.B.1. A two-sample z-interval for a difference between two population proportions requires that three conditions be met:
3.10.B.1.i. The randomization condition: the data should be collected using two independent random samples or a randomized experiment.
3.10.B.1.ii. The 10% condition: when sampling without replacement, the size of each sample should be less than or equal to 10% of the respective population size: \(n_1\le10\%N_1\) and \(n_2\le10\%N_2\), where \(N_1\) is the size of population 1 and \(N_2\) is the size of population 2. The sample sizes are represented as \(n_1\) and \(n_2\). (Note: This condition is unnecessary when the data are from a randomized experiment.)
3.10.B.1.iii. The normality condition: the numbers of observed successes, \(n_1\hat p_1\) and \(n_2\hat p_2\), and observed failures, \(n_1(1-\hat p_1)\) and \(n_2(1-\hat p_2)\), for both samples are all at least 10.
3.10.C.1. The point estimate for the difference between two population proportions is \((\hat p_1-\hat p_2)\).
3.10.C.2. For the difference between two population proportions, the interval estimate can be constructed as point estimate ± (margin of error). The interval estimate for the difference between two population proportions is \((\hat p_1-\hat p_2)\pm z^*\sqrt{\dfrac{\hat p_1(1-\hat p_1)}{n_1}+\dfrac{\hat p_2(1-\hat p_2)}{n_2}}\).
3.10.D.1. The standard error (SE) for the difference between two population proportions is \(SE_{\hat p_1-\hat p_2}=\sqrt{\dfrac{\hat p_1(1-\hat p_1)}{n_1}+\dfrac{\hat p_2(1-\hat p_2)}{n_2}}\).
3.10.D.2. For the difference between two population proportions, the margin of error is the critical value \(z^*\) times the standard error (SE) of the difference between the two proportions, which equals \(z^*\sqrt{\dfrac{\hat p_1(1-\hat p_1)}{n_1}+\dfrac{\hat p_2(1-\hat p_2)}{n_2}}\).
3.11.A.1. Because the confidence interval for the difference between two population proportions is calculated based on samples from two populations, the computed interval may or may not contain the value for the difference between those two population proportions.
3.11.A.2. The interpretation of the confidence level is as follows: In repeated random sampling with the same sample sizes from the same populations, approximately C% of confidence intervals created will capture the difference between the two population proportions, where C represents the numerical value of the confidence level used.
3.11.A.3. When interpreting a C% confidence interval for the difference between two population proportions, we say we are C% confident that the interval \((a,b)\) contains the parameter for the difference between the populations, where \(a\) represents the lower limit and \(b\) represents the upper limit. An interpretation of a confidence interval for the difference between two population proportions includes a reference to the parameter with the details about the populations it represents in the context of the study.
3.11.B.1. A confidence interval for the difference between two population proportions provides an interval of values that may provide convincing evidence to support a particular claim about the difference between the two population proportions. For example, if the interval contains 0, then there is insufficient evidence to conclude there is a difference between the two population proportions. If the interval does not contain 0, there is sufficient evidence to conclude there is a difference between the two population proportions.
Parameters and conditions
Based on the sample data, a confidence interval can be calculated to estimate the difference between two population proportions. The appropriate procedure is a two-sample z-interval for a difference between population proportions. The parameter should refer to the difference in the proportions, the response variable and the two populations in context, for example "\(p_1-p_2\) = the difference between the proportion of all juniors and the proportion of all seniors at the school who bring lunch."
The procedure requires three conditions:
Randomization: two independent random samples or a randomized experiment.
10% condition: when sampling without replacement, each sample is at most 10% of its population, \(n_1\le10\%N_1\) and \(n_2\le10\%N_2\). (This is unnecessary when the data come from a randomized experiment.)
Normality: the observed numbers of successes \(n_1\hat p_1\), \(n_2\hat p_2\) and failures \(n_1(1-\hat p_1)\), \(n_2(1-\hat p_2)\) are all at least 10.
The interval
The point estimate for the difference \(p_1-p_2\) is \(\hat p_1-\hat p_2\). As for any interval, the form is point estimate \(\pm\) margin of error: \[(\hat p_1-\hat p_2)\pm z^*\sqrt{\frac{\hat p_1(1-\hat p_1)}{n_1}+\frac{\hat p_2(1-\hat p_2)}{n_2}}.\] The expression under the square root is the standard error of the difference, \(SE_{\hat p_1-\hat p_2}\), and the margin of error is \(z^*\) times that standard error. (Calculator: `STAT` > `TESTS` > `B:2-PropZInt`.)
Interpreting the interval and justifying a claim
The interval may or may not contain the true difference. The confidence level means that in repeated random sampling with the same sample sizes from the same populations, approximately \(C\)% of the intervals created will capture the difference between the two population proportions.
An interpretation should say: "We are \(C\)% confident that the interval from \(a\) to \(b\) captures the true difference in the proportions of [population 1 and population 2, in context]." Say which group is subtracted from which, since the sign of the difference depends on the order, and interpret a negative value as "population 1 has the lower proportion."
The interval gives an interval of plausible values for the difference, so it can support a claim. If the interval contains 0, then 0 (no difference) is a plausible value, so there is not convincing evidence of a difference between the two population proportions. If the interval does not contain 0, there is convincing evidence that the proportions differ, and the interval shows the direction (all positive: \(p_1\gt p_2\); all negative: \(p_1\lt p_2\)) and plausible size of the difference.
Figure 3.9. Three 95% intervals for a difference of two population proportions. The vertical line marks 0, which means no difference. Intervals A and C contain 0, so they do not give convincing evidence of a difference; interval B lies entirely above 0, so it does.
Worked example · An interval that contains 0
In a school survey, 112 of 200 randomly selected juniors and 90 of 180 randomly selected seniors said they bring their lunch from home. Construct and interpret a 95% confidence interval for the difference in the proportions.
Parameter: \(p_1-p_2\) = the difference in the proportion of all juniors and the proportion of all seniors at the school who bring lunch (juniors minus seniors). Procedure: two-sample z-interval for a difference in proportions. Conditions: independent random samples; each sample is under 10% of its grade; the counts 112, 88, 90 and 90 are at least 10. Calculation: \(\hat p_1=0.56\), \(\hat p_2=0.50\), difference 0.06; \(SE=\sqrt{\dfrac{0.56(0.44)}{200}+\dfrac{0.50(0.50)}{180}}=0.0512\); \(ME=1.96(0.0512)=0.100\); interval \(0.06\pm0.100=(-0.040,\,0.160)\). Conclusion: we are 95% confident that the interval from \(-0.040\) to \(0.160\) captures the true difference (juniors minus seniors) in the proportions who bring lunch. Because the interval contains 0, there is not convincing evidence of a difference between the proportions of juniors and seniors at the school who bring lunch.
Worked example · An interval that does not contain 0
In a randomized experiment, 80 students used a new practice app and 80 used the old app; 62 of the new-app group and 48 of the old-app group passed a test. Construct and interpret a 95% confidence interval for the difference.
Parameter: \(p_1-p_2\) = the difference between the true proportion of students like these who would pass after using the new app and the proportion who would pass after using the old app. Conditions: students were randomly assigned to the apps (the 10% condition is unnecessary); counts 62, 18, 48, 32 are all at least 10. \(\hat p_1=0.775\), \(\hat p_2=0.60\), difference 0.175; \(SE=\sqrt{\dfrac{0.775(0.225)}{80}+\dfrac{0.6(0.4)}{80}}=0.0720\); \(ME=1.96(0.0720)=0.141\); interval \((0.034,\,0.316)\). We are 95% confident that the true difference (new minus old) in pass proportions is between 0.034 and 0.316. All the plausible values are positive, so there is convincing evidence that the new app leads to a higher pass rate. Since this was a randomized experiment, the difference can be attributed to the app.
Worked example · Different confidence levels
For the juniors-and-seniors data, the 90% interval is \((-0.024,\,0.144)\) and the 99% interval is \((-0.072,\,0.192)\). Compare the three intervals (90%, 95%, 99%).
All three contain 0. The higher the confidence level, the wider the interval: 0.168, 0.200 and 0.264 wide. No level provides convincing evidence of a difference.
Worked example · Interpreting a negative interval
A 95% interval for \(p_{\text{city}}-p_{\text{rural}}\), the difference in the proportions of city and rural households with broadband, is \((-0.18,\,-0.06)\). Interpret.
We are 95% confident that the interval from \(-0.18\) to \(-0.06\) captures the true difference in the proportion of households with broadband (city minus rural). The interval is entirely negative, so there is convincing evidence that the proportion of city households with broadband is lower than the proportion of rural households, by between 6 and 18 percentage points.
Calculator
TI-84: `STAT` > `TESTS` > `B:2-PropZInt` with \(x_1\), \(n_1\), \(x_2\), \(n_2\) and `C-Level`. Group 1 is the one you subtract from; write the parameter so the order is clear.
Conditions: two independent random samples (or a randomized experiment), 10% for each sample (not for an experiment), observed counts \(\ge10\) in all four cells.
Interpret: "We are \(C\)% confident that the interval from \(a\) to \(b\) captures the true difference in the proportions of [populations in context]," saying which group is first.
Contains 0: no convincing evidence of a difference. Does not contain 0: convincing evidence, with direction.
Practice
Of 120 random city residents, 44 favor a plan; of 110 random suburban residents, 38 favor it. Construct a 95% interval for the difference (city minus suburb) and interpret it.
Show answer
\(\hat p_1=0.367\), \(\hat p_2=0.345\), difference 0.0212; \(SE=\sqrt{0.367(0.633)/120+0.345(0.655)/110}=0.0632\); \(ME=0.124\); interval \((-0.103,\,0.145)\). We are 95% confident that the interval captures the true difference (city minus suburb) in the proportions who favor the plan. Since it contains 0, there is not convincing evidence of a difference between the proportions of city and suburban residents who favor the plan.
An interval for \(p_1-p_2\) is \((0.05,\,0.20)\). What can be said about \(p_1\) and \(p_2\)?
Show answer
Every plausible value is positive, so there is convincing evidence that \(p_1\gt p_2\), by an estimated 5 to 20 percentage points.
Check the conditions: 90 of 100 treated patients and 6 of 80 control patients improved, with random assignment.
Show answer
Randomization is met by the random assignment. The counts: treated 90 successes and 10 failures; control 6 successes and 74 failures. The count of 6 is less than 10, so the normality condition fails and the z-interval is not appropriate.
A researcher computes \(\hat p_1-\hat p_2=0.04\) with \(ME=0.07\). Does the interval give convincing evidence that the population proportions differ?
Show answer
The interval is \((-0.03,\,0.11)\), which contains 0, so there is not convincing evidence of a difference.
Why is a z-interval for \(p_1-p_2\) invalid if the same people are measured twice (before and after)?
Show answer
The two samples would not be independent; the procedure requires two independent samples or two randomly assigned treatment groups.
A student writes: "We are 95% confident that \(\hat p_1-\hat p_2\) is between 0.034 and 0.316." Correct the statement.
Show answer
The statistic is known (0.175). The interval is about the population difference: "We are 95% confident that the true difference in the proportions of [populations] is between 0.034 and 0.316."
Setting up a test for a difference in two proportions
A confidence interval estimates how big a difference is; a test asks whether there is convincing evidence of any difference. This lesson sets up the two-sample z-test for the difference between two population proportions: the parameters, the null and alternative hypotheses, and the conditions. A new feature appears in the conditions: because the null hypothesis says the two proportions are equal, the test uses a combined (pooled) proportion.
Required content · 3.12.A, 3.12.B, 3.12.C
Learning objectives.
3.12.A. Identify an appropriate testing method for the difference between population proportions including the parameters.
3.12.B. Identify the null and alternative hypotheses for the difference between population proportions.
3.12.C. Justify the appropriateness of a hypothesis test for the difference between two population proportions by verifying conditions.
Essential knowledge.
3.12.A.1. The appropriate testing method for the difference between two population proportions is a two-sample z-test for the difference between two population proportions.
3.12.A.2. The parameters for a hypothesis test for the difference between two population proportions should reference the population parameters, the response variables, and the populations in context.
3.12.B.1. For a two-sample z-test for the difference between two population proportions, the null hypothesis indicates no difference. The null hypothesis for the difference between two population proportions can be written as either \(H_0:p_1=p_2\) or \(H_0:p_1-p_2=0\). A one-sided alternative hypothesis for the difference between two population proportions can be written as either \(H_a:p_1<p_2\) or equivalently \(H_a:p_1-p_2<0\), or \(H_a:p_1>p_2\) or equivalently \(H_a:p_1-p_2>0\). A two-sided alternative hypothesis for the difference between two population proportions can be written as either \(H_a:p_1\ne p_2\) or equivalently \(H_a:p_1-p_2\ne0\).
3.12.C.1. A two-sample z-test for a difference between two population proportions requires that three conditions be met:
3.12.C.1.i. The randomization condition: the data should be collected using two independent random samples or a randomized experiment.
3.12.C.1.ii. The 10% condition: when sampling without replacement, the size of each sample should be less than or equal to 10% of the respective population size: \(n_1\le10\%N_1\) and \(n_2\le10\%N_2\), where \(N_1\) is the size of population 1 and \(N_2\) is the size of population 2. The sample sizes are represented as \(n_1\) and \(n_2\). (Note: This condition is unnecessary when the data are from a randomized experiment.)
3.12.C.1.iii. The normality condition: \(n_1\hat p_c\), \(n_1(1-\hat p_c)\), \(n_2\hat p_c\), and \(n_2(1-\hat p_c)\) must all be at least 10, with \(\hat p_c\) being the combined (or pooled) proportion assuming that \(H_0:p_1=p_2\) is true.
The procedure and parameters
The appropriate testing method for comparing two population proportions is a two-sample z-test for the difference between two population proportions. The parameters should reference the population parameters, the response variables and the populations in context, for example "\(p_1\) = the proportion of all juniors at the school who bring lunch from home; \(p_2\) = the proportion of all seniors at the school who bring lunch from home." For an experiment, the parameters are the true proportions of successes for the two treatments.
The hypotheses
In a two-sample z-test for a difference in proportions, the null hypothesis says there is no difference. It can be written either way: \[H_0:p_1=p_2\qquad\text{or equivalently}\qquad H_0:p_1-p_2=0.\] A one-sided alternative can be written \(H_a:p_1\lt p_2\) (or \(p_1-p_2\lt0\)), or \(H_a:p_1\gt p_2\) (or \(p_1-p_2\gt0\)). A two-sided alternative is \(H_a:p_1\ne p_2\) (or \(p_1-p_2\ne0\)). As always, choose the alternative from the research question before looking at the data, and write hypotheses about parameters, not about \(\hat p_1\) and \(\hat p_2\).
Conditions
A two-sample z-test for a difference between two population proportions requires three conditions:
Randomization: two independent random samples or a randomized experiment.
10% condition: when sampling without replacement, \(n_1\le10\%N_1\) and \(n_2\le10\%N_2\). (Unnecessary for a randomized experiment.)
Normality: \(n_1\hat p_c\), \(n_1(1-\hat p_c)\), \(n_2\hat p_c\) and \(n_2(1-\hat p_c)\) must all be at least 10, where \(\hat p_c\) is the combined (pooled) proportion, calculated assuming \(H_0:p_1=p_2\) is true:
Why pool? If \(H_0\) is true, the two populations have the same proportion, and the best estimate of that common value uses all the data from both samples. (A confidence interval does not assume equality, so it uses separate \(\hat p_1\) and \(\hat p_2\); the test assumes \(H_0\) and pools.)
Worked example · Writing the hypotheses and parameters
A school counselor suspects that a higher proportion of juniors than seniors bring lunch from home. Random samples of 80 juniors and 60 seniors are surveyed; 52 juniors and 30 seniors bring lunch. Write the hypotheses and check the conditions.
Parameters: \(p_1\) = the proportion of all juniors at the school who bring lunch; \(p_2\) = the proportion of all seniors at the school who bring lunch. \(H_0:p_1=p_2\), \(H_a:p_1\gt p_2\). Conditions: the samples are independent random samples, and (assuming at least 800 juniors and 600 seniors) each is under 10% of its grade. The pooled proportion is \(\hat p_c=\dfrac{52+30}{80+60}=\dfrac{82}{140}=0.586\). Then \(80(0.586)=46.9\), \(80(0.414)=33.1\), \(60(0.586)=35.1\) and \(60(0.414)=24.9\) are all at least 10, so the normality condition is met.
Worked example · An experiment
In a randomized experiment, 60 patients take a new drug and 60 take a placebo. Of the drug group, 45 improve; of the placebo group, 32 improve. Set up a test of whether the drug increases the improvement rate.
Parameters: \(p_1\) = the true proportion of patients like these who would improve with the new drug; \(p_2\) = the true proportion who would improve with the placebo. \(H_0:p_1=p_2\), \(H_a:p_1\gt p_2\). Conditions: patients were randomly assigned to treatments, so the 10% condition is not needed. \(\hat p_c=\dfrac{45+32}{120}=0.642\); the expected counts are \(60(0.642)=38.5\) and \(60(0.358)=21.5\) in each group, all at least 10. The conditions are met.
Worked example · Which sample proportion goes first?
A student writes \(H_a:p_1\lt p_2\) for the lunch example even though the counselor suspects that juniors bring lunch more often. What is wrong?
The alternative must match the research question: if \(p_1\) is the juniors' proportion and the suspicion is that juniors bring lunch more, then \(H_a:p_1\gt p_2\). The labeling of which population is "1" is the researcher's choice, but the direction must be consistent with the labels. Define the parameters first and then write \(H_a\).
Worked example · A failed condition
In a random sample, 6 of 40 teachers at one school and 10 of 50 at another say they use a certain software. Is the normality condition met for a test of equal proportions?
\(\hat p_c=\dfrac{6+10}{90}=0.178\). \(40(0.178)=7.1\) is less than 10, and \(40(0.822)=32.9\), \(50(0.178)=8.9\) (again below 10), \(50(0.822)=41.1\). The expected number of successes in each group is under 10, so the normality condition is not met and a z-test is not appropriate for these data.
Exam focus
Test for a difference between two proportions: \(H_0:p_1=p_2\) (or \(p_1-p_2=0\)); \(H_a\): \(\lt\), \(\gt\) or \(\ne\), set by the question. Define \(p_1\) and \(p_2\) in context.
Conditions: two independent random samples or a randomized experiment; 10% for sampling (not for experiments); the four counts using the pooled proportion \(\hat p_c=\dfrac{x_1+x_2}{n_1+n_2}\) all at least 10.
The test pools because \(H_0\) says the proportions are equal; the confidence interval does not pool.
Practice
A researcher wants to know if the proportion of adults who exercise regularly differs between two cities. Write the hypotheses with parameters defined.
Show answer
\(p_1\) = the proportion of all adults in city 1 who exercise regularly; \(p_2\) = the proportion of all adults in city 2 who exercise regularly. \(H_0:p_1=p_2\), \(H_a:p_1\ne p_2\).
In a random sample, 40 of 100 men and 25 of 90 women own a particular app. Find the pooled proportion and check the normality condition.
Show answer
\(\hat p_c=\dfrac{65}{190}=0.342\). \(100(0.342)=34.2\), \(100(0.658)=65.8\), \(90(0.342)=30.8\), \(90(0.658)=59.2\): all at least 10.
Why do we use the pooled proportion in the conditions and the standard error of a test but not in an interval?
Show answer
The test is carried out assuming the null hypothesis \(p_1=p_2\) is true, so the best estimate of that common proportion combines both samples. An interval makes no assumption that the proportions are equal, so it uses the separate sample proportions.
A randomized experiment compares two teaching methods with 30 students each. Which conditions for the z-test are required?
Show answer
Random assignment of the methods, and the normality condition with the pooled proportion (each of the four expected counts at least 10). The 10% condition is not needed.
A study compares the proportion of defective items from two machines, with \(H_a:p_A\lt p_B\). Explain what the alternative claims.
Show answer
That the true proportion of defective items from machine A is lower than the true proportion from machine B (machine A is better).
Explain why the test hypotheses are written in terms of \(p_1\) and \(p_2\), not \(\hat p_1\) and \(\hat p_2\).
Show answer
Hypotheses are claims about the population parameters, which we are trying to learn about. The sample proportions are observed values and are always known.
Carrying out a test for a difference in two proportions
This lesson completes the two-proportion test: the test statistic with the pooled standard error, the p-value and its interpretation, the decision, and a conclusion written in context. The logic is the same as the one-proportion test, and so is the conclusion format; only the formulas differ.
Required content · 3.13.A, 3.13.B, 3.13.C
Learning objectives.
3.13.A. Calculate an appropriate test statistic and p-value for testing a hypothesis for the difference between two population proportions.
3.13.B. Interpret the p-value of a hypothesis test for the difference between two population proportions.
3.13.C. Justify a claim about the populations based on the results of a hypothesis test for the difference between two population proportions.
Essential knowledge.
3.13.A.1. The test statistic for the difference between two population proportions is \(z=\dfrac{(\hat p_1-\hat p_2)-0}{\sqrt{\hat p_c(1-\hat p_c)}\sqrt{\dfrac1{n_1}+\dfrac1{n_2}}}\), where \(\hat p_c=\dfrac{n_1\hat p_1+n_2\hat p_2}{n_1+n_2}\) is the proportion of successes for the two groups combined. The z-statistic has a standard normal distribution when the null hypothesis is true.
3.13.A.2. The p-value for a two-sample z-test for the difference between two population proportions can be found from the standard normal distribution using a table or technology.
3.13.B.1. The p-value is the probability of obtaining a test statistic as extreme or more extreme than the test statistic that was observed (i.e., in the direction of the alternative hypothesis) given that the null hypothesis is true. An interpretation of the p-value of a hypothesis test for a difference between two population proportions should include a statement that the p-value is computed assuming the null hypothesis is true (i.e., by assuming that the true population proportions are equal to each other in context).
3.13.C.1. A formal decision in a hypothesis test for the difference between two population proportions explicitly compares the p-value to the significance level, \(\alpha\). If the p-value \(\le\alpha\), then reject the null hypothesis, \(H_0:p_1=p_2\) (or \(H_0:p_1-p_2=0\)). If the p-value \(>\alpha\), then fail to reject the null hypothesis.
3.13.C.2. The results of a hypothesis test for the difference between two population proportions can serve as the statistical reasoning to support the answer to an investigative question about the two populations that were sampled.
3.13.C.3. A conclusion for the hypothesis test for the difference between two population proportions is stated in context consistent with, and in terms of, the alternative hypothesis using non-definitive language. The conclusion should contain a reference to the parameters and the populations.
The test statistic
The test statistic for a difference between two population proportions is \[z=\frac{(\hat p_1-\hat p_2)-0}{\sqrt{\hat p_c(1-\hat p_c)}\sqrt{\dfrac1{n_1}+\dfrac1{n_2}}},\qquad\hat p_c=\frac{n_1\hat p_1+n_2\hat p_2}{n_1+n_2},\] where \(\hat p_c\) is the proportion of successes for the two groups combined. The "0" is the null hypothesized difference. When \(H_0\) is true and the conditions are met, \(z\) has approximately a standard normal distribution, so the p-value is found from the standard normal distribution with a table or technology: the area to the right of \(z\) for \(H_a:p_1\gt p_2\), to the left for \(H_a:p_1\lt p_2\), and in both tails for \(H_a:p_1\ne p_2\).
Interpreting the p-value, deciding and concluding
The p-value is the probability of obtaining a test statistic as extreme as or more extreme than the observed one (in the direction of \(H_a\)), given that the null hypothesis is true. A correct interpretation says that it is computed assuming the true proportions are equal in the two populations, in context.
The decision explicitly compares the p-value with the significance level \(\alpha\): if the p-value \(\le\alpha\), reject \(H_0\) (convincing evidence for \(H_a\)); if the p-value \(\gt\alpha\), fail to reject \(H_0\) (not convincing evidence for \(H_a\)). The results can serve as the statistical reasoning to answer the investigative question about the two populations. The conclusion is stated in context, consistent with the alternative hypothesis, in non-definitive language, and references the parameters and the populations.
(Calculator: `STAT` > `TESTS` > `6:2-PropZTest`, entering \(x_1\), \(n_1\), \(x_2\), \(n_2\) and the alternative.)
Worked example · A one-sided test in an experiment
In a randomized experiment, 45 of 60 patients on a new drug improved and 32 of 60 on a placebo improved. Is there convincing evidence at \(\alpha=0.05\) that the drug increases the proportion who improve?
State: \(p_1\) = the true proportion of patients like these who would improve with the drug; \(p_2\) = the true proportion who would improve with the placebo. \(H_0:p_1=p_2\), \(H_a:p_1\gt p_2\). Plan: two-sample z-test for a difference in proportions; random assignment; pooled counts \(38.5\) and \(21.5\) in each group are at least 10. Do: \(\hat p_1=0.75\), \(\hat p_2=0.533\), \(\hat p_c=0.642\). \(z=\dfrac{0.75-0.533}{\sqrt{0.642(0.358)}\sqrt{\frac1{60}+\frac1{60}}}=\dfrac{0.2167}{0.0876}=2.47\); p-value \(=P(Z\ge2.47)=0.0067\). Conclude: since \(0.0067\lt0.05\), we reject \(H_0\). There is convincing statistical evidence that the true proportion of patients like these who would improve is higher with the new drug than with the placebo. Because patients were randomly assigned, this supports a cause-and-effect conclusion.
Worked example · Two independent random samples
Random samples of 80 juniors and 60 seniors found that 52 juniors and 30 seniors bring lunch. Is there convincing evidence at \(\alpha=0.05\) that the proportion of juniors who bring lunch is greater than the proportion of seniors?
\(H_0:p_1=p_2\), \(H_a:p_1\gt p_2\) (conditions checked in Lesson 3.10). \(\hat p_1=0.65\), \(\hat p_2=0.50\), \(\hat p_c=82/140=0.586\). \(z=\dfrac{0.65-0.50}{\sqrt{0.586(0.414)}\sqrt{\frac1{80}+\frac1{60}}}=\dfrac{0.15}{0.0841}=1.78\); p-value \(=P(Z\ge1.78)=0.0373\). Since \(0.0373\lt0.05\), reject \(H_0\): there is convincing evidence that the proportion of juniors at the school who bring lunch is greater than the proportion of seniors. Interpretation of the p-value: if the proportions of all juniors and all seniors who bring lunch were equal, there would be about a 3.7% chance of random samples showing a difference this large or larger by chance alone.
Worked example · The same data with a two-sided alternative
If the counselor had wanted to know whether the proportions differ (\(H_a:p_1\ne p_2\)), what would change?
The test statistic is the same, \(z=1.78\), but the p-value doubles: \(2(0.0373)=0.0746\). Since \(0.0746\gt0.05\), the decision would be to fail to reject \(H_0\): there would not be convincing evidence that the proportions of juniors and seniors who bring lunch differ. The result of a test depends on the alternative chosen before the data were seen, which is why that choice must be made from the research question.
Worked example · Failing to reject
In random samples, 30 of 50 customers of store A and 27 of 50 customers of store B said they would recommend their store. Test whether the proportions differ at \(\alpha=0.05\).
\(H_0:p_1=p_2\), \(H_a:p_1\ne p_2\). \(\hat p_1=0.60\), \(\hat p_2=0.54\), \(\hat p_c=57/100=0.57\). The pooled counts (28.5 and 21.5 in each group) are at least 10. \(z=\dfrac{0.06}{\sqrt{0.57(0.43)}\sqrt{\frac1{50}+\frac1{50}}}=\dfrac{0.06}{0.0990}=0.61\); two-sided p-value \(=0.545\). Since \(0.545\gt0.05\), fail to reject \(H_0\): there is not convincing evidence that the proportions of all customers who would recommend the two stores differ. This does not show that the proportions are equal.
Exam focus
\(z=\dfrac{\hat p_1-\hat p_2}{\sqrt{\hat p_c(1-\hat p_c)}\sqrt{1/n_1+1/n_2}}\) with the pooled \(\hat p_c=\dfrac{x_1+x_2}{n_1+n_2}\); p-value from the standard normal distribution.
Decision: p-value \(\le\alpha\): reject; otherwise fail to reject. Conclusion in context about the two populations, consistent with \(H_a\), non-definitive.
p-value interpretation: assuming the two population proportions are equal, the probability of a difference this extreme or more.
A randomized experiment supports a cause-and-effect conclusion; random samples support a conclusion about populations.
Practice
In random samples, 40 of 100 men and 25 of 90 women own a particular app. Test \(H_a:p_1\gt p_2\) at \(\alpha=0.05\) (men first).
Show answer
\(\hat p_1=0.40\), \(\hat p_2=0.278\), \(\hat p_c=0.342\); \(z=\dfrac{0.122}{\sqrt{0.342(0.658)}\sqrt{\frac1{100}+\frac1{90}}}=\dfrac{0.122}{0.0689}=1.77\); p-value \(=0.038\). Since \(0.038\lt0.05\), reject \(H_0\): there is convincing evidence that the proportion of all men who own the app is greater than the proportion of all women.
What is the p-value for the previous problem if the alternative had been two-sided, and what is the decision?
Show answer
\(2(0.038)=0.076\), greater than 0.05, so fail to reject \(H_0\).
A test of \(H_0:p_1=p_2\) against \(H_a:p_1\ne p_2\) gives \(z=-2.2\). Find the p-value and decide at \(\alpha=0.05\).
Show answer
p-value \(=2P(Z\le-2.2)=2(0.0139)=0.0278\). Since \(0.0278\lt0.05\), reject \(H_0\): there is convincing evidence that the proportions differ.
Interpret a p-value of 0.0067 in the drug experiment.
Show answer
If the drug and the placebo were equally effective (the same true improvement proportion), there would be only about a 0.67% chance of random assignment producing a difference in improvement proportions at least as large as the observed 0.217 in favor of the drug.
In a randomized experiment the difference in proportions is statistically significant. Why can we conclude that the treatment caused the difference, but not in an observational study?
Show answer
Random assignment balances other factors between the groups, so a difference larger than chance would produce can be attributed to the treatment. In an observational study, confounding variables may explain the difference.
A student concludes "the proportions are equal" from a p-value of 0.545. Explain the error.
Show answer
A large p-value means the data are consistent with \(H_0\) and do not provide convincing evidence of a difference; it does not prove the proportions are equal. A difference may exist that the samples were too small to detect.
Setting up a chi-square test for homogeneity or independence
When a categorical variable has more than two categories, or when more than two groups are compared, proportions z-tests no longer fit. The chi-square test handles a two-way table of any size by comparing the observed counts with the counts we would expect if there were no difference or no association. This lesson introduces the chi-square statistic and distribution, the two versions of the test (homogeneity and independence), the hypotheses and the conditions.
Required content · 3.14.A, 3.14.B, 3.14.C, 3.14.D
Learning objectives.
3.14.A. Describe chi-square distributions.
3.14.B. Identify an appropriate testing method for comparing distributions in two-way tables of categorical data including the populations and variables.
3.14.C. Identify the null and alternative hypotheses for a chi-square test for homogeneity or independence.
3.14.D. Justify the appropriateness of a chi-square test for independence or homogeneity by verifying conditions.
Essential knowledge.
3.14.A.1. The chi-square statistic measures the distance between observed and expected counts relative to expected counts.
3.14.A.2. Chi-square distributions have positive values and are skewed right. Within this family of density curves, the skew becomes less pronounced with increasing degrees of freedom.
3.14.B.1. To determine whether the distributions of a categorical variable for two or more populations are different, the appropriate test is the chi-square test for homogeneity.
3.14.B.2. A chi-square test for homogeneity should reference the categorical variable and the populations in context.
3.14.B.3. To determine whether row and column variables in a two-way table of categorical data might be associated in the single population from which the data were sampled, the appropriate test is the chi-square test for independence.
3.14.B.4. A chi-square test for independence should reference the categorical variables and the population in context.
3.14.C.1. The appropriate null hypothesis for a chi-square test for homogeneity is \(H_0\): there is no difference in the distributions of the categorical variable across populations or treatments. The appropriate alternative hypothesis for a chi-square test for homogeneity is \(H_a\): there is a difference in the distributions of the categorical variable across populations or treatments.
3.14.C.2. The appropriate null hypothesis for a chi-square test for independence is \(H_0\): there is no association between two categorical variables in a given population (or the two categorical variables in a given population are independent of each other). The appropriate alternative hypothesis for a chi-square test for independence is \(H_a\): there is an association between two categorical variables in a given population (or the two categorical variables in a given population are not independent of each other).
3.14.D.1. A chi-square test for homogeneity or independence requires that three conditions must be met:
3.14.D.1.i. The randomization condition: the test of independence states that the data should be collected using a random sample. The test for homogeneity states that the data should be collected using independent random samples or a randomized experiment.
3.14.D.1.ii. The 10% condition: when sampling without replacement, check that \(n\le10\%N\), where \(N\) is the size of the population and \(n\) is the sample size. (Note: This condition is unnecessary when the data are from a randomized experiment.)
3.14.D.1.iii. The expected counts condition: all expected counts should be greater than 5.
The chi-square statistic and distribution
The chi-square statistic measures the distance between the observed counts and the expected counts, relative to the expected counts. It is large when the observed counts are far from what the null hypothesis predicts and small when they are close. Its sampling distribution, when the null hypothesis is true, is a chi-square distribution. Chi-square distributions have only positive values and are skewed right; within this family of density curves, the skew becomes less pronounced as the degrees of freedom increase.
Figure 3.10. Chi-square distributions take only positive values and are skewed right. As the degrees of freedom increase, the skew becomes less pronounced and the center moves to the right (the mean equals the degrees of freedom).
Two tests with one calculation
Both versions of the test use the same two-way table, the same statistic and the same calculation. They differ in how the data were collected and in the question asked.
The chi-square test for homogeneity determines whether the distributions of a categorical variable for two or more populations (or treatments) are different. The data come from independent random samples from each population, or from a randomized experiment with the treatments as the groups.
The chi-square test for independence determines whether the row and column variables in a two-way table are associated in a single population. The data come from one random sample, in which each individual is classified on both variables.
Hypotheses
For homogeneity: \(H_0\): there is no difference in the distributions of the categorical variable across the populations or treatments. \(H_a\): there is a difference in the distributions of the categorical variable across the populations or treatments. The test should reference the categorical variable and the populations in context.
For independence: \(H_0\): there is no association between the two categorical variables in the population (they are independent of each other). \(H_a\): there is an association between the two categorical variables in the population (they are not independent). The test should reference the two categorical variables and the population in context.
The hypotheses are always two-sided in the sense that they ask about any difference or association; a chi-square test cannot say in which direction the difference goes (that comes from comparing the observed and expected counts afterward).
Conditions
A chi-square test for homogeneity or independence requires three conditions:
Randomization. For independence: one random sample. For homogeneity: independent random samples (or a randomized experiment).
10% condition: when sampling without replacement, \(n\le10\%N\) (for each sample in the homogeneity test). It is unnecessary for a randomized experiment.
Expected counts: all expected counts should be greater than 5.
Worked example · Homogeneity or independence?
Decide which chi-square test fits and write the hypotheses. (a) 100 randomly chosen students at each of two schools are asked which study format they prefer (group, alone, online). (b) A random sample of 300 adults is classified by age group and main news source.
(a) Homogeneity: there are two populations (the two schools) with independent samples, and one categorical variable. \(H_0\): there is no difference in the distribution of preferred study format (group, alone, online) between students at the two schools. \(H_a\): there is a difference. (b) Independence: one random sample is classified on two variables. \(H_0\): there is no association between age group and main news source among adults (the variables are independent). \(H_a\): there is an association between age group and main news source among adults.
Worked example · A randomized experiment
Patients are randomly assigned to one of three treatments and later classified as improved, unchanged or worse. What test is used, and what are the hypotheses?
Homogeneity (the treatments define the groups). \(H_0\): there is no difference in the distribution of outcomes (improved, unchanged, worse) for the three treatments. \(H_a\): there is a difference in the distribution of outcomes for at least one treatment. Since the data come from a randomized experiment, the 10% condition is not needed.
Worked example · Checking the expected count condition
In a random sample of 40 people classified in a \(2\times2\) table, the row totals are 30 and 10, and the column totals are 34 and 6. What is the smallest expected count and is the condition met?
Expected count \(=\dfrac{(\text{row total})(\text{column total})}{\text{table total}}\). The smallest is for the row total 10 and column total 6: \(\dfrac{10(6)}{40}=1.5\), which is not greater than 5. The expected counts condition fails, so the chi-square test should not be used for this table. (Categories can sometimes be combined, or Fisher's exact test used instead.)
Worked example · Explaining the choice
A student says "I will use a chi-square test for independence to compare the proportions of men and women who prefer chocolate, vanilla or strawberry, because I sampled 100 men and 100 women." Is that the right test?
Because the researcher chose a fixed number of men and women and compares the distribution of flavor preference across the two groups, this is a test for homogeneity (independent samples from two populations). The calculation is identical, but the hypotheses should say there is no difference in the distribution of flavor preference between the populations of men and women.
Exam focus
The chi-square statistic compares observed with expected counts; the distribution is positive and right-skewed, with the skew decreasing as degrees of freedom increase.
Homogeneity: compare distributions of one categorical variable across \(\ge2\) populations or treatments (independent random samples or randomized experiment). Independence: one random sample, two categorical variables, is there an association?
Hypotheses: no difference/no association versus a difference/an association, written in context.
Conditions: random (appropriate form), 10% (not for experiments), all expected counts \(\gt5\).
Practice
Researchers randomly sample 150 residents of a city and record their age group (3 groups) and their preferred transport (4 types). Which test, and what are the hypotheses?
Show answer
A chi-square test for independence. \(H_0\): there is no association between age group and preferred transport among residents of the city. \(H_a\): there is an association.
Random samples of 80 customers from each of three stores are classified as satisfied, neutral or dissatisfied. Which test, and what is \(H_0\)?
Show answer
A chi-square test for homogeneity. \(H_0\): there is no difference in the distribution of satisfaction (satisfied, neutral, dissatisfied) among customers of the three stores.
Describe how the shape of the chi-square distribution changes as the degrees of freedom increase.
Show answer
The distribution is right-skewed, and the skew becomes less pronounced as the degrees of freedom increase; its center moves to the right.
A \(2\times3\) table has row totals 60 and 40 and column totals 30, 50 and 20. Find the smallest expected count and check the condition.
Show answer
The smallest expected count is for the column total 20 and the row total 40: \(40(20)/100=8\). All expected counts are \(\gt5\), so the condition is met.
Why can a chi-square test never conclude which group has the larger proportion?
Show answer
The test statistic adds the squared differences over all cells, so it detects only that the distributions differ somewhere; it has no direction. To describe how they differ, compare observed and expected counts or conditional proportions.
State the difference in the way data are collected for a test of homogeneity and a test of independence.
Show answer
Homogeneity: separate (independent) random samples from each population, or randomly assigned treatment groups. Independence: one random sample from one population, with each individual measured on both variables.
Once a chi-square test is set up, carrying it out has four computational steps: find the expected counts, compute the chi-square statistic, find the degrees of freedom and the p-value, and decide and conclude. The conclusion is written in context just like the conclusions for proportion tests. This lesson walks through a complete test and then shows how to use the calculator.
Required content · 3.15.A, 3.15.B, 3.15.C, 3.15.D
Learning objectives.
3.15.A. Calculate expected counts for two-way tables of categorical data.
3.15.B. Calculate the appropriate test statistic and p-value for a chi-square test for homogeneity or independence.
3.15.C. Interpret the p-value for the chi-square test for homogeneity or independence.
3.15.D. Justify a claim about the population(s) based on the results of a chi-square test for homogeneity or independence.
Essential knowledge.
3.15.A.1. The expected counts (under the null hypothesis) in a particular cell of a two-way table of categorical data can be calculated using the formula expected count \(=\dfrac{(\text{row total})(\text{column total})}{\text{table total}}\).
3.15.B.1. The appropriate test statistic for a chi-square test for homogeneity or independence is the chi-square statistic \(\chi^2=\sum\dfrac{(\text{observed count}-\text{expected count})^2}{\text{expected count}}\), where the sum is taken over all cells of the two-way table. The chi-square statistic has a chi-square distribution with degrees of freedom equal to (number of rows − 1)(number of columns − 1) when the null hypothesis is true.
3.15.B.2. The p-value for a chi-square test for independence or homogeneity is found from a chi-square distribution using a table or technology.
3.15.C.1. The p-value is the probability of obtaining a test statistic as extreme or more extreme than the test statistic that was observed (i.e., in the direction of the alternative hypothesis) given that the null hypothesis is true. An interpretation of the p-value for the chi-square test for homogeneity or independence should include a statement that the p-value is computed by assuming the null hypothesis is true in context.
3.15.D.1. A formal decision in a hypothesis test explicitly compares the p-value to the significance level, \(\alpha\). If the p-value \(\le\alpha\), then reject the null hypothesis for the appropriate chi-square test. If the p-value \(>\alpha\), then fail to reject the null hypothesis.
3.15.D.2. The results of a chi-square test for homogeneity or independence can serve as the statistical reasoning to support the answer to an investigative question about the population that was sampled (independence) or the populations that were sampled (homogeneity).
3.15.D.3. A conclusion for a chi-square test for homogeneity or independence is stated in context consistent with, and in terms of, the alternative hypothesis using non-definitive language. The conclusion should contain a reference to the population(s).
Expected counts
If the null hypothesis is true, the expected count in each cell of the two-way table is \[\text{expected count}=\frac{(\text{row total})(\text{column total})}{\text{table total}}.\] This is the count we would get in that cell if the distribution of the column variable were the same for every row (homogeneity) or the variables were independent. Expected counts need not be whole numbers; keep a decimal. Check that all are greater than 5.
The chi-square statistic and the p-value
The test statistic for a chi-square test for homogeneity or independence is \[\chi^2=\sum\frac{(\text{observed count}-\text{expected count})^2}{\text{expected count}},\] summed over all cells of the table. When the null hypothesis is true and the conditions are met, the statistic has a chi-square distribution with \[\text{degrees of freedom}=(\text{number of rows}-1)(\text{number of columns}-1).\] The p-value is found from this chi-square distribution (with a table or technology) and is the area to the right of the observed statistic: it is the probability of obtaining a statistic as large or larger, assuming the null hypothesis is true. An interpretation of the p-value should say that it is computed assuming the null hypothesis is true, in context.
Figure 3.11. The p-value is the area to the right of the observed chi-square statistic under the chi-square distribution with the appropriate degrees of freedom. Large values of the statistic (observed counts far from expected counts) are what count as evidence against the null hypothesis.
Decision and conclusion
A formal decision compares the p-value with the significance level \(\alpha\): if p-value \(\le\alpha\), reject \(H_0\); if p-value \(\gt\alpha\), fail to reject \(H_0\). The results serve as the statistical reasoning to answer the investigative question about the population sampled (independence) or the populations sampled (homogeneity). The conclusion is written in context, in terms of the alternative hypothesis, with non-definitive language, and refers to the population(s). A small p-value says the observed counts are farther from the expected counts than chance would usually allow; to describe how the distributions differ, look at the cells with the largest contributions \((O-E)^2/E\), or compare the conditional proportions.
(Calculator: enter the observed counts in a matrix, then `STAT` > `TESTS` > `C:χ²-Test`; the expected counts are stored in a second matrix.)
Worked example · A complete test of independence
In a random sample of 300 adults from a large metropolitan area, each was classified by age group and main source of news:
Age group
Online
TV
Print
Total
18 to 34
90
35
5
130
35 to 54
50
40
10
100
55 and over
20
35
15
70
Total
160
110
30
300
Is there convincing evidence, at \(\alpha=0.05\), of an association between age group and main news source among adults in the area?
State: \(H_0\): there is no association between age group and main news source among adults in the area. \(H_a\): there is an association. Plan: chi-square test for independence. The sample is random and the 300 adults are under 10% of the area's adults. The expected counts are
Age group
Online
TV
Print
18 to 34
69.33
47.67
13.00
35 to 54
53.33
36.67
10.00
55 and over
37.33
25.67
7.00
(for example \(\dfrac{130(160)}{300}=69.33\)); all are greater than 5. Do: the contributions \((O-E)^2/E\) are 6.160, 3.366, 4.923 in the first row; 0.208, 0.303, 0.000 in the second; and 8.048, 3.394, 9.143 in the third. \(\chi^2=35.55\) with \(df=(3-1)(3-1)=4\), and the p-value is about \(4\times10^{-7}\). Conclude: since the p-value is far less than 0.05, reject \(H_0\). There is convincing statistical evidence of an association between age group and main source of news among adults in the area. The largest contributions come from the 55-and-over group (more TV and print than expected, less online) and the 18-to-34 group (more online, less print), consistent with the conditional proportions from Lesson 2.1.
Worked example · A test of homogeneity
Random samples of 80 juniors and 60 seniors were asked where they usually eat lunch.
Group
Cafeteria
Bring lunch
Off campus
Total
Juniors
14
52
14
80
Seniors
24
30
6
60
Total
38
82
20
140
Is there convincing evidence of a difference in the distribution of lunch location for juniors and seniors at the school?
\(H_0\): there is no difference in the distribution of lunch location (cafeteria, bring lunch, off campus) between all juniors and all seniors at the school. \(H_a\): there is a difference. Independent random samples (each under 10% of its grade). Expected counts: juniors 21.71, 46.86, 11.43; seniors 16.29, 35.14, 8.57, all greater than 5. The contributions are 2.741, 0.564, 0.579 for juniors and 3.654, 0.753, 0.771 for seniors, so \(\chi^2=9.06\) with \(df=(2-1)(3-1)=2\), and the p-value is \(0.011\). At \(\alpha=0.05\), reject \(H_0\): there is convincing evidence that the distribution of lunch location differs between the juniors and seniors at the school. (The biggest contributions are the cafeteria cells: juniors use the cafeteria less than expected and seniors more.) Interpretation of the p-value: if the distributions of lunch location were the same for all juniors and all seniors, there would be about a 1.1% chance of random samples with counts at least this far from the expected counts.
Worked example · No association
Of 100 men, 80 own a smartphone; of 200 women, 160 do (random samples). Carry out the chi-square test of homogeneity for ownership.
The observed counts are 80, 20, 160, 40 and the totals give expected counts \(\dfrac{100(240)}{300}=80\), 20, 160, 40: the same as the observed counts. Every contribution is 0, so \(\chi^2=0\), \(df=1\) and the p-value is 1. There is no evidence of a difference in the proportions of men and women who own a smartphone. (For a \(2\times2\) table, the chi-square test and the two-sided two-proportion z-test give the same p-value; \(\chi^2=z^2\).)
Worked example · Degrees of freedom and the critical value
How many degrees of freedom does a \(4\times3\) table have, and what chi-square value has area 0.05 to its right?
\(df=(4-1)(3-1)=6\). The chi-square value with 5% of the area to its right for 6 degrees of freedom is 12.59, so a statistic larger than 12.59 gives a p-value below 0.05. (For \(df=2\) the value is 5.99 and for \(df=4\) it is 9.49.)
Calculator
TI-84: `2nd` `x⁻¹` (MATRIX) > `EDIT` > `[A]`, enter the dimensions and the observed counts. Then `STAT` > `TESTS` > `C:χ²-Test` with Observed `[A]` and Expected `[B]`, and `Calculate`. The output gives \(\chi^2\), the p-value and df; the expected counts are in matrix `[B]` for checking the condition. Show the expected counts and write the conclusion.
Exam focus
Expected count \(=\dfrac{(\text{row total})(\text{column total})}{\text{table total}}\); all should be \(\gt5\).
\(\chi^2=\sum\dfrac{(O-E)^2}{E}\) over all cells; \(df=(\text{rows}-1)(\text{columns}-1)\); p-value is the right-tail area.
Decide by comparing the p-value with \(\alpha\); conclude in context about the population(s), in terms of \(H_a\) (a difference in distributions or an association), in non-definitive language.
To see how the groups differ, look at the large contributions or the conditional proportions.
Practice
Find the expected counts for the table with rows (30, 20) and (20, 30).
Show answer
Row totals are 50 and 50; column totals are 50 and 50; table total 100. Every expected count is \(\dfrac{50(50)}{100}=25\).
For the table in the previous problem, find the chi-square statistic and its degrees of freedom, and state the conclusion at \(\alpha=0.05\) (random samples from two populations).
Show answer
\(\chi^2=4\left(\dfrac{(30-25)^2}{25}\right)=4(1)=4.0\), \(df=1\), p-value \(=0.0455\). Since \(0.0455\lt0.05\), reject \(H_0\): there is convincing evidence of a difference in the distributions between the two populations.
Random samples of 100 students from each of two schools were asked to choose a study format. School A: 30 group, 45 alone, 25 online. School B: 50 group, 40 alone, 10 online. Carry out the test at \(\alpha=0.05\).
Show answer
\(H_0\): no difference in the distribution of preferred study format between the two schools' students; \(H_a\): there is a difference. Expected counts: 40, 42.5, 17.5 for both rows (all greater than 5). \(\chi^2=2.5+0.147+3.214+2.5+0.147+3.214=11.72\), \(df=2\), p-value \(=0.0028\). Reject \(H_0\): convincing evidence that the distribution of preferred study format differs between students at the two schools (school B prefers group work more and online less than expected).
How many degrees of freedom does a \(5\times4\) table have?
Show answer
\((5-1)(4-1)=12\).
Interpret a p-value of 0.0028 in the study-format problem.
Show answer
If the distribution of preferred study format were the same for all students at the two schools, there would be only about a 0.28% chance of random samples giving counts at least as far from the expected counts as these.
A chi-square test gives a p-value of 0.40. A student writes: "The test proves there is no association." Correct the statement.
Show answer
Fail to reject \(H_0\): there is not convincing evidence of an association between the variables in the population. A large p-value does not prove independence; the sample may simply be too small to detect an association that exists.
Unit 3 practice · 10 problems
Unit 3 practice: Inference for Categorical Data: Proportions
Ten problems covering the whole unit: three multiple-choice questions in the style of Section I and seven free-response problems. Write the four steps (state, plan, do, conclude) for each inference problem, with conditions checked using numbers.
About 35% of the students at a large college commute. In a random sample of 200 students, find the mean and standard deviation of the sample proportion \(\hat p\) who commute, check the conditions for a normal model, and find \(P(\hat p\ge0.40)\).
Show answer
\(\mu_{\hat p}=0.35\) and \(\sigma_{\hat p}=\sqrt{0.35(0.65)/200}=0.0337\). The sample is random, 200 is less than 10% of the students at a large college, and \(np=70\) and \(n(1-p)=130\) are both at least 10, so the sampling distribution is approximately normal. \(z=(0.40-0.35)/0.0337=1.48\), so \(P(\hat p\ge0.40)=0.069\).
A 95% confidence interval for the proportion of all voters in a county who support a measure is (0.43, 0.52). Which is a correct interpretation?
The true proportion is a fixed number, not random, so once the interval is computed the probability is not 95%; the 95% describes the method.
The interval is about the proportion of voters who support the measure, not about how voters are distributed. This statement does not make sense.
This states the confidence level in terms of the method and refers to the parameter and the population in context.
The interval is not a description of where other sample proportions will fall; it is an estimate of the population proportion.
In a random sample of 500 voters from a large county, 238 support a measure. (a) Construct a 95% confidence interval for the proportion of all voters in the county who support it. (b) Does the interval provide convincing evidence that fewer than half of the county's voters support the measure? (c) How large a sample would be needed for a margin of error of 0.04 at 95% confidence if nothing is known about \(p\)?
Show answer
(a) Conditions: random sample; 500 is under 10% of a large county; \(n\hat p=238\) and \(n(1-\hat p)=262\) are at least 10. \(\hat p=0.476\), \(SE=\sqrt{0.476(0.524)/500}=0.0223\), \(ME=1.96(0.0223)=0.0438\), interval \((0.432,\,0.520)\). We are 95% confident that the interval from 0.432 to 0.520 captures the proportion of all voters in the county who support the measure. (b) No: 0.50 is in the interval, so it is a plausible value, and the interval includes values above 0.50. There is not convincing evidence that fewer than half support it. (c) \(n=\dfrac{1.96^2(0.5)(0.5)}{0.04^2}=600.25\), so \(n=601\).
A researcher tests \(H_0:p=0.30\) against \(H_a:p\gt0.30\) and obtains a p-value of 0.03. Which conclusion is correct at the 5% significance level?
The p-value 0.03 is less than 0.05, so we reject \(H_0\). Also a test can never provide evidence that \(H_0\) is true.
\(0.03\lt0.05\), so reject \(H_0\): there is convincing statistical evidence that the true proportion is greater than 0.30.
The decision is right, but the p-value is not the probability that \(H_0\) is true; it is the probability of data this extreme if \(H_0\) were true.
The p-value is below \(\alpha\), so the decision is to reject \(H_0\), not fail to reject.
A company claims that 25% of the people who receive its email click the link. A random sample of 400 recipients (from a very large list) shows that 120 clicked. Is there convincing evidence at \(\alpha=0.05\) that the true proportion differs from 25%?
Show answer
State: \(p\) = the true proportion of all recipients who click the link. \(H_0:p=0.25\), \(H_a:p\ne0.25\). Plan: one-sample z-test for a proportion. Random sample; 400 under 10% of a very large list; \(np_0=100\) and \(n(1-p_0)=300\) are at least 10. Do: \(\hat p=0.30\), \(z=\dfrac{0.30-0.25}{\sqrt{0.25(0.75)/400}}=2.31\); two-sided p-value \(=0.021\). Conclude: since \(0.021\lt0.05\), reject \(H_0\): there is convincing evidence that the proportion of all recipients who click the link differs from 25% (the sample suggests it is higher).
In a randomized experiment, 150 patients took a new drug and 150 took a standard drug; 96 and 78 patients improved, respectively. Is there convincing evidence at \(\alpha=0.05\) that the new drug has a higher improvement rate?
Show answer
State: \(p_1\) = the true proportion who would improve with the new drug, \(p_2\) = the true proportion who would improve with the standard drug (for patients like these). \(H_0:p_1=p_2\), \(H_a:p_1\gt p_2\). Plan: two-sample z-test for a difference in proportions; random assignment; pooled \(\hat p_c=174/300=0.58\); the counts \(150(0.58)=87\) and \(150(0.42)=63\) are at least 10 in both groups. Do: \(\hat p_1=0.64\), \(\hat p_2=0.52\); \(z=\dfrac{0.12}{\sqrt{0.58(0.42)(2/150)}}=\dfrac{0.12}{0.0570}=2.11\); p-value \(=0.018\). Conclude: since \(0.018\lt0.05\), reject \(H_0\): there is convincing evidence that the new drug has a higher true improvement proportion than the standard drug for patients like these, and, because treatments were randomly assigned, the drug can be credited.
A test of \(H_0:p=0.02\) against \(H_a:p\gt0.02\) is used to decide whether the proportion of defective parts in a shipment exceeds 2%. (a) Describe a Type I and a Type II error in context. (b) Name two ways to increase the power of the test.
Show answer
(a) A Type I error is concluding that there is convincing evidence that more than 2% of the shipment is defective when the true proportion is 2% (a good shipment is wrongly rejected); its probability is \(\alpha\). A Type II error is failing to find convincing evidence that more than 2% are defective when in fact the proportion exceeds 2% (a bad shipment is accepted). (b) Increase the sample size (this decreases the standard error), or increase the significance level \(\alpha\) (at the cost of a larger probability of a Type I error). The power is also higher when the true proportion is farther above 2%.
Use the data from the drug experiment (96 of 150 improved with the new drug, 78 of 150 with the standard drug) to construct a 95% confidence interval for \(p_1-p_2\) and interpret it.
Show answer
Conditions: random assignment; the counts 96, 54, 78 and 72 are all at least 10. \(\hat p_1-\hat p_2=0.64-0.52=0.12\); \(SE=\sqrt{\dfrac{0.64(0.36)}{150}+\dfrac{0.52(0.48)}{150}}=0.0566\); \(ME=1.96(0.0566)=0.111\); interval \((0.009,\,0.231)\). We are 95% confident that the interval from 0.009 to 0.231 captures the true difference (new minus standard) in the proportions of patients like these who would improve. The interval does not contain 0 (though only barely), so there is convincing evidence that the new drug has a higher improvement proportion.
Which statement about the standard errors in the two-proportion z-test and the two-proportion z-interval is true?
Only the test pools. An interval does not assume the proportions are equal.
Under \(H_0:p_1=p_2\) the best estimate of the common proportion combines both samples, so the test pools; the interval makes no such assumption.
This is reversed: the test pools because it assumes the proportions are equal, and the interval does not.
Both standard errors are computed from sample proportions.
Thirty students were randomly assigned to each of two study methods, and 18 of the 30 in method A and 10 of the 30 in method B passed a test. Use a chi-square test at \(\alpha=0.05\) to decide whether the pass rate differs.
Show answer
State: \(H_0\): there is no difference in the distribution of pass/fail (the pass rate) for the two methods; \(H_a\): there is a difference. Plan: chi-square test for homogeneity (randomly assigned groups). Expected counts: each row total is 30 and the column totals are 28 (passed) and 32 (failed), so \(E=\dfrac{30(28)}{60}=14\) for passes and \(\dfrac{30(32)}{60}=16\) for fails, in both groups, all greater than 5. Do: \(\chi^2=\dfrac{(18-14)^2}{14}+\dfrac{(12-16)^2}{16}+\dfrac{(10-14)^2}{14}+\dfrac{(20-16)^2}{16}=1.143+1+1.143+1=4.29\), \(df=(2-1)(2-1)=1\), p-value \(=0.038\). Conclude: since \(0.038\lt0.05\), reject \(H_0\): there is convincing evidence of a difference in pass rates between the two study methods. (Equivalent to a two-sided two-proportion z-test with \(z^2=\chi^2\).)
Unit 3 used the sample proportion to learn about a population proportion. For a quantitative variable the natural statistic is the sample mean \(\bar x\), and the same questions arise: how does \(\bar x\) behave from sample to sample, and when can its sampling distribution be modeled with a normal curve? This lesson gives the mean and standard deviation of \(\bar x\), the conditions, and the role of the central limit theorem.
Required content · 4.1.A, 4.1.B, 4.1.C
Learning objectives.
4.1.A. Calculate the mean and standard deviation of a sampling distribution of a sample mean.
4.1.B. Justify the appropriateness of conditions for the sampling distribution of a sample mean.
4.1.C. Interpret the mean, standard deviation, and probabilities for the sampling distribution of a sample mean.
Essential knowledge.
4.1.A.1. For a population with population mean \(\mu\) and population standard deviation \(\sigma\), when the sampled values are independent, the sampling distribution of the sample mean has mean \(\mu_{\bar x}=\mu\) and standard deviation \(\sigma_{\bar x}=\dfrac{\sigma}{\sqrt n}\).
4.1.B.1. Sampling without replacement requires that two conditions must be met:
4.1.B.1.i. The randomization condition: the data should be collected using a random sample.
4.1.B.1.ii. The 10% condition: the population size must be at least 10 times larger than the sample size: \(n\le10\%N\), where \(N\) is the size of the population and \(n\) is the sample size.
4.1.B.2. For a quantitative variable, if the population distribution can be modeled by a normal distribution, the sampling distribution of the sample mean, \(\bar x\), can be modeled with a normal distribution regardless of the sample size.
4.1.B.3. For a quantitative variable, if the population distribution cannot be modeled by a normal distribution, the sampling distribution of the sample mean, \(\bar x\), can be modeled approximately by a normal distribution, provided \(n\ge30\). If the population distribution is extremely skewed, a sample size much larger than 30 may be needed to ensure the sampling distribution is approximately normal.
4.1.C.1. The mean, standard deviation, and probabilities for a sampling distribution of a sample mean should be interpreted within the context of a specific population.
Center and spread of \(\bar x\)
For a population with mean \(\mu\) and standard deviation \(\sigma\), when the sampled values are independent, the sampling distribution of the sample mean has \[\mu_{\bar x}=\mu\qquad\text{and}\qquad\sigma_{\bar x}=\frac{\sigma}{\sqrt n}.\] The first statement says that \(\bar x\) is an unbiased estimator of \(\mu\). The second says the typical distance of \(\bar x\) from \(\mu\) shrinks as \(n\) grows, in proportion to \(1/\sqrt n\): to cut the standard deviation of \(\bar x\) in half you must take four times as many observations. A sample mean varies less than an individual observation.
Figure 4.1. A normal population with mean 150 g and standard deviation 12 g. The sampling distribution of \(\bar x\) is centered at 150 for every sample size, and its standard deviation, \(12/\sqrt n\), shrinks as the sample size grows (12, 6 and 3 for \(n=1\), 4 and 16).
Conditions
When sampling without replacement, two conditions must be met:
Randomization: the data should be collected using a random sample.
10% condition: the population size must be at least 10 times the sample size, \(n\le10\%N\).
Shape of the sampling distribution
The shape depends on the population and on \(n\):
If the population distribution can be modeled by a normal distribution, the sampling distribution of \(\bar x\) is normal for any sample size.
If the population is not normal, the sampling distribution of \(\bar x\) can be modeled approximately by a normal distribution provided \(n\ge30\) (the central limit theorem). If the population is extremely skewed, a sample size much larger than 30 may be needed.
When a normal model applies, probabilities for \(\bar x\) come from \(z=\dfrac{\bar x-\mu}{\sigma/\sqrt n}\). Interpret the mean, standard deviation and probabilities of the sampling distribution within the context of the specific population.
Worked example · A normal population
Tomato weights are normal with mean 150 g and standard deviation 12 g. A random sample of 9 tomatoes is selected (from a very large crop). Describe the sampling distribution of \(\bar x\) and find \(P(\bar x\gt155)\). How does it compare with the probability that a single tomato weighs more than 155 g?
The population is normal, so \(\bar x\) is normal for any \(n\), with mean \(\mu_{\bar x}=150\) and standard deviation \(\sigma_{\bar x}=12/\sqrt9=4\). \(z=\dfrac{155-150}{4}=1.25\), so \(P(\bar x\gt155)=0.106\). For one tomato, \(z=\dfrac{155-150}{12}=0.42\) and \(P(X\gt155)=0.339\). A sample mean of 9 tomatoes above 155 g is much less likely than a single tomato above 155 g, because averages vary less than individual values.
Worked example · A skewed population and a large sample
The time a customer waits for service is skewed right with mean \(\mu=70\) seconds and standard deviation \(\sigma=15\) seconds. In a random sample of 36 customers (from many), find the probability that the mean wait is less than 66 seconds.
The population is not normal but \(n=36\ge30\), so by the central limit theorem \(\bar x\) is approximately normal with mean 70 and standard deviation \(15/\sqrt{36}=2.5\). \(z=\dfrac{66-70}{2.5}=-1.6\), so \(P(\bar x\lt66)=0.055\). In context: there is about a 5.5% chance that a random sample of 36 customers has a mean wait under 66 seconds.
Worked example · When the normal model is not justified
A random sample of 10 observations is taken from a population that is strongly right skewed. A student uses a normal model for \(\bar x\). Is that justified?
No. The population is not normal and \(n=10\lt30\), so the sampling distribution of \(\bar x\) can retain some of the skew of the population and the normal model is not justified (unless the sample data show the population is approximately normal).
Worked example · Quadrupling the sample size
The number of text messages sent per day by teens has mean 3.2 hundred and standard deviation 1.4 hundred. Compare the standard deviation of \(\bar x\) for \(n=25\) and \(n=100\), and find \(P(\bar x\gt3.5)\) for \(n=100\) (a random sample, population large, \(n\ge30\)).
For \(n=25\): \(1.4/5=0.28\); for \(n=100\): \(1.4/10=0.14\), half as large. With \(n=100\), \(z=\dfrac{3.5-3.2}{0.14}=2.14\), so \(P(\bar x\gt3.5)=0.016\).
Exam focus
\(\mu_{\bar x}=\mu\) (unbiased) and \(\sigma_{\bar x}=\sigma/\sqrt n\).
Conditions: random sample and 10% condition (\(n\le0.10N\)).
Normal population: \(\bar x\) is normal for any \(n\). Non-normal population: approximately normal if \(n\ge30\) (CLT); more needed if the population is extremely skewed.
Averages vary less than individual values; quadrupling \(n\) halves \(\sigma_{\bar x}\).
Practice
A population has mean 50 and standard deviation 8. For random samples of size 64, find the mean and standard deviation of \(\bar x\).
Show answer
Heights of women are approximately normal with mean 64.5 in and standard deviation 2.5 in. What is the probability that the mean height of a random sample of 4 women exceeds 66 in?
Show answer
\(\sigma_{\bar x}=2.5/2=1.25\), \(z=\dfrac{66-64.5}{1.25}=1.2\), probability \(0.115\).
The scores on a test have mean 70 and standard deviation 15 and are skewed. Can a normal model be used for the mean of a random sample of 20 students? Of 50?
Show answer
Not for 20 (the population is not normal and \(n\lt30\)). For 50, \(n\ge30\) so the sampling distribution of \(\bar x\) is approximately normal by the central limit theorem.
How large a sample is needed to cut the standard deviation of \(\bar x\) to one third of the standard deviation of one observation?
Show answer
\(\sigma/\sqrt n=\sigma/3\) gives \(n=9\).
Explain why \(\sigma_{\bar x}\) is smaller than \(\sigma\).
Show answer
Averaging several observations smooths out the extremes: unusually high and low values tend to offset each other in a sample mean, so \(\bar x\) varies less from sample to sample than individual observations do.
Interpret \(\mu_{\bar x}=150\) and \(\sigma_{\bar x}=4\) in the tomato context (samples of 9 tomatoes).
Show answer
The mean of the sample means of 9 tomatoes is 150 g, the same as the mean weight of all tomatoes, so \(\bar x\) is unbiased; the mean weight of a sample of 9 tomatoes typically differs from 150 g by about 4 g.
Confidence intervals for a mean or mean difference
To estimate a population mean we use the sample mean, but the standard deviation of \(\bar x\), \(\sigma/\sqrt n\), involves the population standard deviation \(\sigma\), which is almost never known. Replacing \(\sigma\) with the sample standard deviation \(s\) adds extra variability, so the normal model is no longer exactly right. The correction is the t distribution. This lesson introduces it, then constructs the one-sample t-interval for a population mean, which also handles matched pairs through the mean of the differences.
4.2.B. Identify an appropriate confidence interval procedure including the parameter for a population mean or population mean difference.
4.2.C. Justify the appropriateness of constructing a confidence interval for a population mean or population mean difference by verifying conditions.
4.2.D. Calculate an appropriate confidence interval for a population mean or population mean difference.
4.2.E. Calculate the standard error and margin of error for a sample size for a one-sample t-interval.
Essential knowledge.
4.2.A.1. t-distributions, also called Student’s t-distributions, form a family of symmetric, bell-shaped, standardized distributions with wider tails than that of the standard normal distribution. Specific t-distributions are identified using a parameter known as the number of degrees of freedom (df), which is based on the sample size(s). When the degrees of freedom are small, the t-distribution has a much narrower peak and fatter tails than a normal distribution. As the degrees of freedom increase, the t-distribution more closely resembles the standard normal distribution (mean \(\mu=0\) and standard deviation \(\sigma=1\)).
4.2.A.2. t-distributions are used for finding critical values and test statistics for inferences about a population mean, \(\mu\), when the population standard deviation, \(\sigma\), is unknown and the sample standard deviation, \(s\), must be used instead.
4.2.B.1. The appropriate confidence interval procedure for estimating the population mean of a quantitative variable for one sample is a one-sample t-interval for a population mean. (The population standard deviation, \(\sigma\), is not typically known for distributions for quantitative variables.)
4.2.B.2. For a matched pairs design with two dependent samples, the appropriate analysis calculates differences between pairs of values to produce one sample of differences. The confidence interval procedure for the matched pairs design is a one-sample t-interval for a population mean difference.
4.2.B.3. The parameter for a confidence interval for a population mean or population mean difference should reference the population mean or population mean difference and the response variable, in context. For the population mean difference, it is important to state the order of subtraction for the difference.
4.2.C.1. A one-sample t-interval for a population mean or population mean difference requires that three conditions be met:
4.2.C.1.i. The randomization condition: the data should be collected using a random sample or a randomized experiment.
4.2.C.1.ii. The 10% condition: when sampling without replacement, the population size must be at least 10 times larger than the sample size: \(n\le10\%N\), where \(N\) is the size of the population and \(n\) is the sample size.
4.2.C.1.iii. The sample data condition: it is indicated the population distribution is approximately normal, or \(n\ge30\), or if \(n<30\), the sample data distribution should be free from strong skewness and outliers. For matched pairs, the number of differences should be at least 30. If the number of differences is less than 30, the sample of differences should be free from strong skewness and outliers.
4.2.D.1. A point estimate for a population mean is the sample mean, \(\bar x\), or \(\bar x_d\) for the sample mean difference.
4.2.D.2. To estimate the population mean for one sample or the population mean difference between values in matched pairs, when the population standard deviation is unknown, the confidence interval is \(\bar x\pm t^*\dfrac{s}{\sqrt n}\), where \(t^*\) is the critical value for the central \(C\)% of a t-distribution with degrees of freedom \(n-1\).
4.2.E.1. The standard error (SE) for a sample mean is given by \(SE_{\bar x}=\dfrac{s}{\sqrt n}\).
4.2.E.2. For a one-sample t-interval for a population mean, the margin of error is the critical value \((t^*)\) times the standard error (SE), which equals \((t^*)\left(\dfrac{s}{\sqrt n}\right)\).
The t distribution
t distributions (Student's t distributions) form a family of symmetric, bell-shaped, standardized distributions with wider tails than the standard normal distribution. A specific t distribution is identified by its degrees of freedom (df), which depend on the sample size. When the degrees of freedom are small, the t distribution has a lower peak and fatter tails than a normal distribution; as the degrees of freedom increase, it looks more and more like the standard normal distribution (\(\mu=0\), \(\sigma=1\)).
Figure 4.2. t distributions are symmetric and bell-shaped, centered at 0, with wider tails than the standard normal distribution (a lower, wider peak). The tails are fattest when the degrees of freedom are small; as the degrees of freedom increase, the t distribution looks more and more like the standard normal.
t distributions are used for finding critical values and test statistics for inferences about a population mean \(\mu\) when the population standard deviation \(\sigma\) is unknown and the sample standard deviation \(s\) must be used instead. For a sample of size \(n\), the degrees of freedom are \(n-1\). The critical value \(t^*\) bounds the central \(C\)% of the t distribution; it is larger than the corresponding \(z^*\), especially for small samples:
df
4
9
14
19
29
99
\(z^*\)
90%
2.132
1.833
1.761
1.729
1.699
1.660
1.645
95%
2.776
2.262
2.145
2.093
2.045
1.984
1.960
99%
4.604
3.250
2.977
2.861
2.756
2.626
2.576
On the TI-84, \(t^*=\)`invT(1-(1-C)/2, df)` (or `invT` with the area to the left).
The one-sample t-interval
The appropriate procedure to estimate the mean of a quantitative variable from one sample is a one-sample t-interval for a population mean. The parameter should reference the population mean and the response variable in context. The point estimate is \(\bar x\) and the interval is \[\bar x\pm t^*\frac{s}{\sqrt n},\] where \(t^*\) is the critical value for the central \(C\)% of a t distribution with \(n-1\) degrees of freedom. The standard error of the sample mean is \(SE_{\bar x}=\dfrac{s}{\sqrt n}\), and the margin of error is \(t^*\cdot\dfrac{s}{\sqrt n}\).
Matched pairs
When the data are a matched pairs design (two dependent samples: the same individuals measured twice, or pairs of similar individuals), the correct analysis calculates the difference within each pair, producing one sample of differences. The confidence interval is then a one-sample t-interval for the population mean difference \(\mu_d\), using \(\bar x_d\) and \(s_d\). The parameter must state the order of subtraction, for example "\(\mu_d\) = the mean of (after minus before) reading speed."
Figure 4.3. For matched pairs, the differences within each pair form one sample. Ten students' reading speeds were measured before and after a course. With fewer than 30 differences, the sample of differences should be free from strong skewness and outliers, and this dotplot shows no strong skewness or outliers.
Conditions
A one-sample t-interval for a mean or mean difference requires three conditions:
Randomization: the data should be collected using a random sample or a randomized experiment.
10% condition: when sampling without replacement, \(n\le10\%N\).
Sample data condition: the population distribution is approximately normal, or \(n\ge30\), or, if \(n\lt30\), the sample data should be free from strong skewness and outliers. For matched pairs, the number of differences should be at least 30; with fewer than 30, the sample of differences should be free from strong skewness and outliers.
Worked example · A one-sample t-interval
A random sample of 20 students at a large school reported sleeping a mean of \(\bar x=6.9\) hours on school nights, with a standard deviation of \(s=1.1\) hours; a dotplot showed no strong skewness or outliers. Construct and interpret a 95% confidence interval for the mean.
Parameter: \(\mu\) = the mean number of hours that students at the school sleep on school nights. Procedure: one-sample t-interval for \(\mu\). Conditions: random sample; 20 is less than 10% of the school; the sample data (\(n\lt30\)) show no strong skewness or outliers. Calculation: \(df=19\), \(t^*=2.093\), \(SE=\dfrac{1.1}{\sqrt{20}}=0.246\), \(ME=2.093(0.246)=0.515\), interval \(6.9\pm0.515=(6.385,\,7.415)\). Conclusion: we are 95% confident that the interval from 6.39 to 7.42 hours captures the mean number of hours that all students at the school sleep on school nights. (Calculator: `STAT` > `TESTS` > `8:TInterval` with the `Stats` input.)
Worked example · Matched pairs
Ten randomly selected students measured their reading speeds (words per minute) before and after a course: before 210, 185, 232, 198, 240, 175, 205, 220, 190, 225; after 213, 190, 231, 202, 246, 177, 210, 225, 193, 229. Construct and interpret a 95% confidence interval for the mean improvement.
The data are paired (the same student before and after), so use the differences, after minus before: 3, 5, \(-1\), 4, 6, 2, 5, 5, 3, 4. They have \(\bar x_d=3.6\) and \(s_d=2.01\) (no strong skewness or outliers, from the dotplot). Parameter: \(\mu_d\) = the mean difference (after minus before) in reading speed, in words per minute, for students like these. \(df=9\), \(t^*=2.262\), \(SE=\dfrac{2.01}{\sqrt{10}}=0.636\), \(ME=2.262(0.636)=1.44\); interval \((2.16,\,5.04)\). We are 95% confident that the interval from 2.16 to 5.04 words per minute captures the mean improvement in reading speed (after minus before) for the population of students. Since the interval is entirely positive, the mean change is likely an improvement.
Worked example · A 90% interval from summary statistics
A random sample of 15 batteries from a large shipment has a mean life of \(\bar x=52.3\) hours and \(s=6.4\) hours, with approximately normal sample data. Find a 90% confidence interval for the mean battery life.
\(df=14\), \(t^*=1.761\), \(SE=\dfrac{6.4}{\sqrt{15}}=1.652\), \(ME=1.761(1.652)=2.91\). The interval is \(52.3\pm2.91=(49.39,\,55.21)\) hours. We are 90% confident that the interval from 49.4 to 55.2 hours captures the mean life of batteries in the shipment.
Worked example · Which procedure?
A researcher measures the blood pressure of 12 patients before and after a treatment and wants to estimate the effect. A colleague proposes a two-sample interval comparing the two groups of 12 measurements. Is that appropriate?
No. The before and after values come from the same patients, so they are dependent (a matched pairs design). The correct procedure is a one-sample t-interval for the mean of the 12 differences. A two-sample procedure assumes independent samples.
Calculator
TI-84: `STAT` > `TESTS` > `8:TInterval` (enter `Inpt: Data` with the list, or `Stats` with \(\bar x\), \(s_x\), \(n\)) and `C-Level`. For matched pairs, first store the differences in a list (`L3 = L2 - L1`) and use that list. Write the conditions and the interpretation; the output alone is not enough.
Exam focus
t distributions: symmetric, bell-shaped, wider tails than the normal; df \(=n-1\); approach the standard normal as df grows.
Matched pairs: take the differences within pairs and use a one-sample t-interval for \(\mu_d\); state the order of subtraction.
Conditions: random sample or randomized experiment; 10%; population approximately normal, or \(n\ge30\), or (for \(n\lt30\)) no strong skewness or outliers in the sample data (or the differences).
Practice
A random sample of 40 packages has a mean weight of 12.4 oz and \(s=1.6\) oz (large population). Construct a 95% interval for the mean weight.
Show answer
\(df=39\), \(t^*=2.023\), \(SE=1.6/\sqrt{40}=0.253\), \(ME=0.512\); interval \((11.89,\,12.91)\). We are 95% confident that the interval captures the mean weight of all packages. (Conditions: random sample, \(n=40\ge30\), 10% condition.)
Why does the t-interval use \(t^*\) instead of \(z^*\)?
Show answer
The population standard deviation is unknown, so we estimate it with \(s\). The extra variability this adds means the standardized statistic follows a t distribution, with fatter tails than the normal; \(t^*\) is larger than \(z^*\) to make up for the extra uncertainty.
What is the critical value \(t^*\) for a 99% interval from a sample of 15?
Show answer
\(df=14\), \(t^*=2.977\).
Eight identical twin pairs are assigned at random so that one twin of each pair receives a vitamin and the other a placebo. Describe how to analyze the growth data to estimate the effect.
Show answer
This is a matched pairs design: compute the difference (vitamin minus placebo) in growth for each pair of twins, then use a one-sample t-interval for the mean difference \(\mu_d\), checking that the 8 differences show no strong skewness or outliers.
A sample has \(n=12\) with a strongly right-skewed dotplot and one extreme outlier. Is a t-interval appropriate?
Show answer
No. With \(n\lt30\), the sample data should be free from strong skewness and outliers; this sample is not, so the t-interval may be unreliable.
A 95% interval for a mean computed from a sample of size 25 is \((18.2,\,23.8)\). Find the sample mean and the margin of error.
Show answer
The sample mean is the midpoint, \((18.2+23.8)/2=21.0\); the margin of error is half the width, \((23.8-18.2)/2=2.8\).
Interpreting t-intervals and justifying claims about means
The logic of interpreting an interval for a mean is the same as for a proportion, but the wording refers to a mean (or a mean difference), the claims being tested are about a mean, and the sample size and confidence level change the width in the same predictable ways. This lesson practices the exact language the AP exam expects and uses intervals to justify claims about \(\mu\) and \(\mu_d\).
Required content · 4.3.A, 4.3.B, 4.3.C
Learning objectives.
4.3.A. Interpret a confidence interval in context for a population mean or population mean difference.
4.3.B. Justify a claim based on a confidence interval for a population mean or population mean difference.
4.3.C. Identify the relationships among sample size, confidence interval width, confidence level, and margin of error for a population mean or population mean difference.
Essential knowledge.
4.3.A.1. Because the confidence interval for a population mean or population mean difference is calculated based on a sample from a population, the computed interval may or may not contain the value of the population mean or population mean difference.
4.3.A.2. The interpretation of the confidence level is as follows: In repeated random sampling with the same sample size from the same population, approximately C% of confidence intervals created will capture the population mean or population mean difference, where C represents the numerical value of the confidence level used.
4.3.A.3. When interpreting a C% confidence interval for a population mean or population mean difference, we say we are C% confident the interval \((a,b)\) contains the value of the population mean or population mean difference, where \(a\) represents the lower limit and \(b\) represents the upper limit. An interpretation of a confidence interval for a population mean or population mean difference includes a reference to the parameter.
4.3.B.1. A confidence interval for a population mean or population mean difference provides an interval of values that may serve as convincing evidence to support a particular claim about the population mean or population mean difference.
4.3.C.1. For a given sample, increasing the confidence level will result in the following:
4.3.C.1.i. The critical value will increase.
4.3.C.1.ii. The margin of error will increase.
4.3.C.1.iii. The width of the confidence interval will increase.
4.3.C.2. Increasing the sample size decreases the standard error. Thus, when all other things remain the same, the width of a confidence interval for a population mean or population mean difference tends to decrease as the sample size increases. For a confidence interval for a population mean or population mean difference with a given confidence level, the width of the interval is approximately proportional to \(\dfrac{1}{\sqrt n}\).
Confidence level and interpretation
A confidence interval for a mean or a mean difference is calculated from one sample, so the computed interval may or may not contain the population mean or mean difference. The confidence level means: in repeated random sampling with the same sample size from the same population, approximately \(C\)% of the intervals created will capture the population mean (or mean difference), where \(C\) is the numerical confidence level.
To interpret a particular \(C\)% interval \((a,b)\), say: "We are \(C\)% confident that the interval from \(a\) to \(b\) contains the true value of the population mean [or mean difference] of [the response variable in context]." The interpretation must refer to the parameter (the population mean, not the sample mean) and for matched pairs state the order of subtraction.
Common errors: saying the interval contains \(C\)% of the individual values in the population or the sample; saying there is a \(C\)% probability that \(\mu\) is in this particular interval (the parameter is fixed, not random); and describing the sample mean \(\bar x\) (which is known) instead of \(\mu\).
Justifying a claim
A confidence interval gives an interval of plausible values for the population mean or mean difference, so it can serve as convincing evidence for or against a claim. A claimed value outside the interval is not plausible: the interval provides convincing evidence against the claim. A claimed value inside the interval is plausible, and the interval does not provide convincing evidence against it. For a matched pairs study, the claim "no change" corresponds to \(\mu_d=0\): if 0 is not in the interval, the data support a real change, and the sign of the interval shows its direction.
How the width changes
For a given sample, increasing the confidence level increases the critical value \(t^*\), the margin of error and the width of the interval.
Increasing the sample size decreases the standard error \(s/\sqrt n\) (and \(t^*\) also gets slightly smaller). When all else is the same, the width tends to decrease as the sample size increases; for a given confidence level the width is approximately proportional to \(1/\sqrt n\).
Worked example · Interpreting and evaluating a claim
The 95% interval for the mean number of hours students at a school sleep on school nights is \((6.39,\,7.42)\). Interpret the interval, then evaluate the claim that students at the school average 8 hours.
Interpretation: We are 95% confident that the interval from 6.39 to 7.42 hours contains the true mean number of hours that students at the school sleep on school nights. Claim: 8 hours is not in the interval, and the interval is entirely below 8, so the interval provides convincing evidence that the mean sleep is less than 8 hours. (A claim of 7 hours would be plausible, since 7 is in the interval.)
Worked example · A matched pairs claim
The 95% interval for the mean improvement in reading speed (after minus before) is \((2.16,\,5.04)\) words per minute. Does the interval support the claim that the course changes reading speed?
Zero (no change) is not in the interval, and all the plausible values are positive, so there is convincing evidence that the mean reading speed after the course is higher than before: the mean improvement is plausibly between 2.2 and 5.0 words per minute. (Whether the course caused the improvement depends on the study design; there was no control group here.)
Worked example · Level and sample size
For the sleep data (\(\bar x=6.9\), \(s=1.1\), \(n=20\)) the widths of the 90%, 95% and 99% intervals are 0.85, 1.03 and 1.41. (a) What happens to the width if the sample is \(n=80\) with the same \(\bar x\) and \(s\) (95% level)? (b) Why does the width not exactly halve when \(n\) is multiplied by 4?
(a) The standard error is half as large (\(s/\sqrt{80}=0.123\)), and \(t^*\) drops from 2.093 to 1.990, so the width is \(2(1.990)(0.123)=0.49\) hours, less than half of 1.03. (b) The width is approximately proportional to \(1/\sqrt n\); because the critical value \(t^*\) also changes with the degrees of freedom, the ratio is not exactly one half (here it is slightly less than one half: 0.475).
Worked example · Reading an interval from output
A computer reports a 99% confidence interval for the mean weight of a bag of rice as (4.91, 5.06) pounds. The label says 5 pounds. Does the interval provide convincing evidence that bags are underfilled?
The interval contains 5, so the label weight is a plausible value for the mean. There is not convincing evidence that the mean weight differs from 5 pounds, and in particular not convincing evidence of underfilling. (It also does not prove the mean is exactly 5.)
Exam focus
Interpretation: "We are \(C\)% confident that the interval from \(a\) to \(b\) contains the true mean [mean difference, order stated] of [variable in context]." Not a statement about the sample mean, about individual values, or a probability that \(\mu\) lies in this interval.
Claim inside the interval: plausible. Outside: convincing evidence against it. Matched pairs: check whether 0 is in the interval.
Higher confidence level: larger \(t^*\), ME and width. Larger \(n\): smaller SE and narrower interval (about \(\propto1/\sqrt n\)).
Practice
A 90% t-interval for the mean time (minutes) a bus is late is \((2.1,\,4.7)\). Interpret it and say whether it provides evidence that the buses are late on average.
Show answer
We are 90% confident that the interval from 2.1 to 4.7 minutes contains the true mean lateness of the buses. Since 0 is not in the interval and all the plausible values are positive, there is convincing evidence that the buses are late on average.
A researcher says "95% of the students sleep between 6.39 and 7.42 hours." Why is this a misinterpretation?
Show answer
The interval estimates the mean sleep time of all students, not the range of individual students' sleep times. Most individual students will sleep more or less than the interval's values, because individuals vary much more than a mean.
Without recalculating, how does the margin of error change if a sample size is increased from 25 to 100 and everything else stays the same (approximately)?
Show answer
It is roughly cut in half, since the standard error is proportional to \(1/\sqrt n\) (and \(t^*\) decreases slightly).
A 95% interval for the mean difference \(\mu_d\) (after minus before) in test scores is \((-1.2,\,4.6)\). What can you conclude about a change in scores?
Show answer
The interval contains 0, so 0 (no change) is a plausible value; there is not convincing evidence of a mean change in scores.
A student states: "The 99% interval is better than the 90% interval because it is more likely to contain \(\mu\)." Evaluate.
Show answer
A 99% interval is more likely to capture \(\mu\) in the long run, but it is wider and less precise. Neither is "better"; there is a trade-off between confidence and precision, and only a larger sample can improve both.
A 95% confidence interval for a mean is \((14.5,\,17.5)\) from a random sample. Is there convincing evidence that the true mean is not 16? Not 20?
Show answer
16 is in the interval, so it is plausible: no convincing evidence that the mean is not 16. 20 is outside the interval: convincing evidence that the mean is not 20 (it is less than 20).
Setting up a test for a population mean or mean difference
The structure of a significance test is the same for means as for proportions: hypotheses, conditions, test statistic, p-value, decision, conclusion. This lesson sets up a one-sample t-test for a population mean and for a population mean difference (matched pairs), covering the parameters, the hypotheses and the conditions, so that the next lesson can carry the test out.
Required content · 4.4.A, 4.4.B, 4.4.C
Learning objectives.
4.4.A. Identify an appropriate testing method and parameter for a population mean or population mean difference with unknown sigma .
4.4.B. Identify the null and alternative hypotheses for a population mean or population mean difference with unknown σ.
4.4.C. Justify the appropriateness of a hypothesis test for a population mean or population mean difference by verifying conditions.
Essential knowledge.
4.4.A.1. The appropriate test for a population mean with unknown population standard deviation \(\sigma\) is a one-sample t-test for a population mean.
4.4.A.2. For a matched pairs design with two dependent samples, the appropriate analysis calculates differences between pairs of values to produce one sample of differences. The hypothesis testing procedure for the matched pairs design is a one-sample t-test for the population mean difference.
4.4.A.3. The parameter for a hypothesis test for a population mean and population mean difference should reference the population parameter, the response variable, and the population in context.
4.4.B.1. The null hypothesis for a one-sample t-test for a population mean is \(H_0:\mu=\mu_0\), in which \(\mu_0\) is the null hypothesized value for the population mean. A one-sided alternative hypothesis for a one-sample t-test for a population mean is either \(H_a:\mu<\mu_0\) or \(H_a:\mu>\mu_0\). A two-sided alternative hypothesis is \(H_a:\mu\ne\mu_0\).
4.4.B.2. The null hypothesis for a population mean difference is \(H_0:\mu_d=0\). A one-sided alternative hypothesis for a population mean difference is either \(H_a:\mu_d<0\) or \(H_a:\mu_d>0\). A two-sided alternative hypothesis is \(H_a:\mu_d\ne0\).
4.4.C.1. A one-sample t-test for a population mean or a population mean difference requires that three conditions be met:
4.4.C.1.i. The randomization condition: the data should be collected using a random sample or a randomized experiment.
4.4.C.1.ii. The 10% condition: when sampling without replacement, the population size must be at least 10 times larger than the sample size: \(n\le10\%N\), where \(N\) is the size of the population and \(n\) is the sample size.
4.4.C.1.iii. The sample data condition: it is indicated the population distribution is approximately normal, or \(n\ge30\), or if \(n<30\), the sample data distribution should be free from strong skewness and outliers. For matched pairs, the number of differences should be at least 30. If the number of differences is less than 30, the sample of differences should be free from strong skewness and outliers.
The procedure and the parameter
When the population standard deviation \(\sigma\) is unknown, which is the usual case, the appropriate test for a population mean is a one-sample t-test for a population mean. For a matched pairs design with two dependent samples, calculate the differences within the pairs to produce one sample of differences; the testing procedure is a one-sample t-test for the population mean difference.
The parameter should reference the population parameter, the response variable and the population in context. For a mean difference, state the order of subtraction: "\(\mu_d\) = the true mean difference (after minus before) in reading speed, in words per minute, for all students like these."
The hypotheses
For one population mean, the null hypothesis is \(H_0:\mu=\mu_0\), where \(\mu_0\) is the null hypothesized value. The alternative is one-sided, \(H_a:\mu\lt\mu_0\) or \(H_a:\mu\gt\mu_0\), or two-sided, \(H_a:\mu\ne\mu_0\).
For a population mean difference (matched pairs), the null hypothesis is \(H_0:\mu_d=0\) (no mean difference), with a one-sided alternative \(H_a:\mu_d\lt0\) or \(H_a:\mu_d\gt0\), or a two-sided alternative \(H_a:\mu_d\ne0\). Choose the alternative from the question before looking at the data, and write the hypotheses in terms of parameters, never \(\bar x\).
Conditions
A one-sample t-test for a mean or a mean difference requires three conditions:
Randomization: the data should be collected using a random sample or a randomized experiment.
10% condition: when sampling without replacement, \(n\le10\%N\).
Sample data condition: the population distribution is approximately normal, or \(n\ge30\), or, if \(n\lt30\), the sample data distribution should be free from strong skewness and outliers. For matched pairs, the number of differences should be at least 30; if fewer than 30, the sample of differences should be free from strong skewness and outliers.
Unlike the proportion test, there are no expected-count checks. Instead, look at a graph of the sample data (a dotplot, histogram or boxplot) to check for skewness and outliers when \(n\lt30\), and say what you see.
Worked example · Writing the hypotheses
Write the parameter and hypotheses. (a) A battery maker claims its batteries last an average of 500 hours; a consumer group thinks they last less. (b) A teacher wants to know if the mean score on a test is different from the national mean of 75. (c) A tutor wants to show that students' scores increase on average after a program (before and after scores for the same students).
(a) \(\mu\) = the true mean life of this brand's batteries, in hours. \(H_0:\mu=500\), \(H_a:\mu\lt500\). (b) \(\mu\) = the true mean score of all students taking this test (in the teacher's school). \(H_0:\mu=75\), \(H_a:\mu\ne75\). (c) \(\mu_d\) = the true mean difference (after minus before) in score for students in the program. \(H_0:\mu_d=0\), \(H_a:\mu_d\gt0\).
Worked example · Checking conditions
A random sample of 25 batteries from a large production run has a mean life of 489 hours and \(s=30\) hours. A dotplot of the 25 lifetimes is roughly symmetric with no outliers. Check the conditions for a one-sample t-test.
The batteries are a random sample; 25 is less than 10% of a large production run; \(n=25\lt30\) but the dotplot shows no strong skewness or outliers, so the sample data condition is met. A one-sample t-test for a mean is appropriate.
Worked example · A condition that is not met
An experimenter has 9 measurements of reaction time, one of which (410 ms) is far above the others (which are 215 to 260 ms). Can she use a one-sample t-test?
With \(n=9\lt30\) the sample data should be free from strong skewness and outliers, but 410 is an outlier. The sample data condition fails, so the t procedures may give misleading results. She should investigate the outlier (a recording error?) and consider a larger sample, rather than using the t-test as it stands.
Worked example · Matched pairs or two samples?
Twelve runners' times are recorded in the same 5 km race with and without a new shoe. A student wants to compare "the 12 shoe times" with "the 12 no-shoe times" as two independent samples. What is wrong?
The same runners appear in both groups, so the data are matched pairs, not independent samples. The correct analysis takes the difference for each runner and uses a one-sample t-test on those 12 differences, with \(H_0:\mu_d=0\).
Exam focus
Unknown \(\sigma\): one-sample t-test for \(\mu\); for matched pairs, a one-sample t-test for \(\mu_d\) using the within-pair differences (state the order of subtraction).
\(H_0:\mu=\mu_0\) (or \(\mu_d=0\)); \(H_a\): \(\lt\), \(\gt\) or \(\ne\), chosen from the question.
Conditions: random sample or randomized experiment; 10%; population approximately normal, or \(n\ge30\), or no strong skewness or outliers in the sample (or in the differences, for pairs).
Define the parameter in context; hypotheses never use \(\bar x\).
Practice
A company claims the mean time to resolve a support call is at most 12 minutes. A customer group suspects it is longer. Write the parameter and hypotheses.
Show answer
\(\mu\) = the true mean time, in minutes, to resolve a support call at the company. \(H_0:\mu=12\), \(H_a:\mu\gt12\).
Eleven patients' blood pressures are measured before and after a drug. The doctor wants to know whether the drug changes blood pressure. Write the parameter and hypotheses.
Show answer
\(\mu_d\) = the true mean difference (after minus before) in blood pressure for patients like these. \(H_0:\mu_d=0\), \(H_a:\mu_d\ne0\).
A random sample of 18 cars from a large lot has fuel economies that are strongly skewed right with an outlier. May a t-test for the mean fuel economy be used?
Show answer
No. \(n=18\lt30\) and the sample data have strong skewness and an outlier, so the sample data condition is not met.
Which of the three conditions would be different for a randomized experiment, and how?
Show answer
The randomization condition is met by random assignment of treatments (rather than a random sample); the 10% condition is not needed. The sample data condition still applies.
Why might a student prefer a one-sided alternative in a test, and why is it risky to choose it after seeing the data?
Show answer
A one-sided alternative can detect a difference in the stated direction with more power. If it is chosen after seeing which way the sample mean differs from \(\mu_0\), the p-value is artificially halved and the test is biased toward finding evidence.
A school has a sample of 45 students from a school of 400. Is the 10% condition met?
Show answer
\(10\%\) of 400 is 40, and the sample of 45 exceeds that. The 10% condition is not met (the sample is more than 10% of the population).
Carrying out a test for a population mean or mean difference
With the test set up and the conditions checked, the t-test follows the same path as the z-test for a proportion: compute a standardized statistic, find the p-value from the appropriate distribution, compare it with \(\alpha\), and write a conclusion in context. The differences are that the statistic uses \(s\) rather than \(\sigma\), and its null distribution is a t distribution with \(n-1\) degrees of freedom.
Required content · 4.5.A, 4.5.B, 4.5.C
Learning objectives.
4.5.A. Calculate an appropriate test statistic and p-value for testing a hypothesis about a population mean or population mean difference.
4.5.B. Interpret the p-value of a hypothesis test for a population mean or population mean difference.
4.5.C. Justify a claim about the population based on the results of a hypothesis test for a population mean or population mean difference.
Essential knowledge.
4.5.A.1. The test statistic for a one-sample t-test for a population mean or population mean difference is \(t=\dfrac{\bar x-\mu_0}{s/\sqrt n}\), where \(t\) has degrees of freedom \(n-1\). The t-statistic has a t-distribution with degrees of freedom \(n-1\) when the null hypothesis is true.
4.5.A.2. The p-value for a one-sample t-test for a population mean or population mean difference is found using the appropriate t-distribution table or technology.
4.5.B.1. The p-value is the probability of obtaining a test statistic as extreme or more extreme than the test statistic that was observed (i.e., in the direction of the alternative hypothesis) given that the null hypothesis is true. An interpretation of the p-value of a hypothesis test for a population mean or population mean difference should include a statement that the p-value is computed by assuming that the null hypothesis is true (i.e., by assuming that the population mean is equal to the particular value stated in the null hypothesis in context).
4.5.C.1. A formal decision explicitly compares the p-value to the significance level, \(\alpha\). If the p-value is less than or equal to \(\alpha\), then reject the null hypothesis, \(H_0:\mu=\mu_0\). If the p-value is greater than \(\alpha\), then fail to reject the null hypothesis.
4.5.C.2. The results of a hypothesis test for a population mean or population mean difference can serve as the statistical reasoning to support the answer to an investigative question about the population that was sampled.
4.5.C.3. A conclusion for the hypothesis test for a population mean or population mean difference is stated in context consistent with, and in terms of, the alternative hypothesis using non-definitive language. The conclusion should contain a reference to the parameter and the population.
The test statistic
The test statistic for a one-sample t-test for a population mean (or mean difference, using \(\bar x_d\), \(s_d\), \(\mu_0=0\)) is \[t=\frac{\bar x-\mu_0}{s/\sqrt n},\qquad df=n-1.\] It says how many standard errors the sample mean is from the hypothesized mean. When the null hypothesis is true and the conditions are met, the statistic has a t distribution with \(n-1\) degrees of freedom. The p-value is the probability, assuming \(H_0\) is true, of a test statistic as extreme as or more extreme than the observed one in the direction of \(H_a\): the area to the right for \(\gt\), to the left for \(\lt\), and in both tails for \(\ne\). It is found from a t table or with technology (`tcdf(lower, upper, df)` on the TI-84).
Figure 4.4. If \(H_0\) is true, the test statistic has a t distribution with \(n-1=24\) degrees of freedom. The p-value for \(H_a:\mu\lt\mu_0\) is the shaded area to the left of the observed \(t=-1.83\), about 0.040.
Decision and conclusion
The formal decision compares the p-value with \(\alpha\): if the p-value \(\le\alpha\), reject \(H_0\); if the p-value \(\gt\alpha\), fail to reject \(H_0\). An interpretation of the p-value should say that it is computed assuming the null hypothesis is true (that the population mean equals \(\mu_0\), in context). The conclusion is stated in context, consistent with \(H_a\), in non-definitive language, and refers to the parameter and the population. A test can never prove \(H_0\).
The four steps are the same: State (parameter, hypotheses, \(\alpha\)), Plan (procedure and conditions), Do (\(\bar x\), \(s\), \(t\), df, p-value), Conclude (decision and context). Calculator: `STAT` > `TESTS` > `2:T-Test`.
Worked example · A left-tailed test
A battery maker claims that its batteries last an average of 500 hours. A random sample of 25 batteries (from a large run) has \(\bar x=489\) hours and \(s=30\) hours, with roughly symmetric sample data and no outliers. Is there convincing evidence at \(\alpha=0.05\) that the mean is less than 500 hours?
State: \(\mu\) = the true mean life, in hours, of this brand's batteries. \(H_0:\mu=500\), \(H_a:\mu\lt500\), \(\alpha=0.05\). Plan: one-sample t-test for a mean. Random sample, 25 under 10% of the run, sample data symmetric without outliers. Do: \(t=\dfrac{489-500}{30/\sqrt{25}}=\dfrac{-11}{6}=-1.83\), \(df=24\), p-value \(=P(t_{24}\le-1.83)=0.040\). Conclude: since \(0.040\lt0.05\), we reject \(H_0\). There is convincing evidence that the true mean life of this brand's batteries is less than 500 hours. (Using the normal distribution with \(z=-1.83\) would give 0.033, which is too small: the t distribution's heavier tails matter when the sample is small.)
Worked example · A matched pairs test
Ten randomly chosen students' reading speeds were measured before and after a course. The differences (after minus before) have \(\bar x_d=3.6\) and \(s_d=2.01\), with no strong skewness or outliers. Is there convincing evidence at \(\alpha=0.05\) that the course increases mean reading speed?
State: \(\mu_d\) = the true mean difference (after minus before) in reading speed, in words per minute, for students like these. \(H_0:\mu_d=0\), \(H_a:\mu_d\gt0\). Do: \(t=\dfrac{3.6-0}{2.01/\sqrt{10}}=5.66\), \(df=9\), p-value \(=P(t_9\ge5.66)=0.00016\). Conclude: the p-value is much less than 0.05, so reject \(H_0\): there is convincing statistical evidence that the mean reading speed of students like these is greater after the course than before. (There was no control group, so the study cannot show that the course caused the gain.)
Worked example · A two-sided test that fails to reject
A random sample of 40 students (from a large school) has a mean GPA of 3.42 with \(s=0.95\). Is there convincing evidence at \(\alpha=0.05\) that the school's mean GPA differs from 3.2?
\(H_0:\mu=3.2\), \(H_a:\mu\ne3.2\). \(n=40\ge30\), random sample, under 10%. \(t=\dfrac{3.42-3.2}{0.95/\sqrt{40}}=\dfrac{0.22}{0.150}=1.46\), \(df=39\), two-sided p-value \(=2P(t_{39}\ge1.46)=0.151\). Since \(0.151\gt0.05\), fail to reject \(H_0\): there is not convincing evidence that the mean GPA at the school differs from 3.2. (The sample mean is higher than 3.2, but a difference this size is not unusual from sampling variability.)
Worked example · Interpreting the p-value
Interpret the p-value 0.040 in the battery test.
If the true mean life of this brand's batteries were 500 hours, there would be about a 4.0% chance of getting a random sample of 25 batteries with a mean of 489 hours or less just by random sampling variability.
Calculator
TI-84: `STAT` > `TESTS` > `2:T-Test`. Choose `Data` (with the list) or `Stats` (\(\mu_0\), \(\bar x\), \(s_x\), \(n\)), then the alternative (`≠μ0`, `<μ0` or `>μ0`) and `Calculate`. The output gives \(t\), the p-value, \(\bar x\), \(s_x\) and \(n\). For matched pairs, run it on the list of differences with \(\mu_0=0\).
Exam focus
\(t=\dfrac{\bar x-\mu_0}{s/\sqrt n}\), \(df=n-1\); p-value from the t distribution by the direction of \(H_a\).
Decision: p-value \(\le\alpha\) reject \(H_0\); else fail to reject. Conclusion in context about the population mean (or mean difference, with the order of subtraction), in non-definitive language.
p-value interpretation: assuming \(\mu=\mu_0\) is true, the chance of a sample mean this far from \(\mu_0\) or farther in the direction of \(H_a\).
Do not use \(z\) for a mean test when \(\sigma\) is unknown.
Practice
A random sample of 12 students (from a large class) studied a mean of 7.4 hours for an exam with \(s=1.8\) hours (no skew or outliers). Test \(H_0:\mu=6.5\) against \(H_a:\mu\gt6.5\) at \(\alpha=0.05\).
Show answer
\(t=\dfrac{7.4-6.5}{1.8/\sqrt{12}}=1.73\), \(df=11\), p-value \(=0.056\). Since \(0.056\gt0.05\), fail to reject \(H_0\): not convincing evidence that the mean study time of students in the class exceeds 6.5 hours.
A random sample of 16 thermometers has a mean reading of 98.2 degrees when the true temperature is 100, with \(s=2.4\). Test \(H_a:\mu\lt100\) at \(\alpha=0.01\).
Show answer
\(t=\dfrac{98.2-100}{2.4/\sqrt{16}}=-3.0\), \(df=15\), p-value \(=0.0045\). Since \(0.0045\lt0.01\), reject \(H_0\): convincing evidence that the mean reading of these thermometers is below the true temperature.
Find the p-value for \(t=2.7\), \(df=9\) in a two-sided test, and for \(t=-2.4\), \(df=14\) in a left-tailed test.
Show answer
Two-sided with \(t=2.7\): \(2(0.0122)=0.0244\). Left-tailed with \(t=-2.4\): \(0.0154\).
Why is the p-value from a t distribution larger than the p-value from a normal distribution for the same statistic?
Show answer
A t distribution has heavier tails, so more of its area lies beyond a given value than for the standard normal. The t-test requires stronger sample evidence to reach the same p-value, accounting for the uncertainty in estimating \(\sigma\) by \(s\).
The p-value of a t-test of \(H_0:\mu=50\) is 0.34. A student concludes that the mean is 50. What is wrong?
Show answer
A large p-value only means there is not convincing evidence against \(H_0\); it does not prove \(\mu=50\). The conclusion should be that there is not convincing evidence that the mean differs from 50 (or is greater or less, as in \(H_a\)).
For matched pairs, why is \(\mu_0=0\) in the test statistic?
Show answer
The null hypothesis for the mean difference is "no difference," \(\mu_d=0\), so the t statistic measures how many standard errors the mean of the differences is from 0.
Sampling distribution of a difference in two sample means
Comparing two groups on a quantitative variable (Do students taught with method A score higher than those taught with method B? Do plants with fertilizer grow taller than plants without?) uses the difference in sample means, \(\bar x_1-\bar x_2\). This lesson describes the sampling distribution of that difference: its mean, its standard deviation, the conditions, and when a normal model is justified. It parallels the lesson on the difference of two proportions.
Required content · 4.6.A, 4.6.B, 4.6.C
Learning objectives.
4.6.A. Calculate the mean and standard deviation of a sampling distribution for the difference between two sample means.
4.6.B. Justify the appropriateness of conditions for the sampling distribution of the difference between two sample means.
4.6.C. Interpret the mean, standard deviation, and probabilities for a sampling distribution for the difference between sample means.
Essential knowledge.
4.6.A.1. For two independent populations with population means \(\mu_1\) and \(\mu_2\) and population standard deviations \(\sigma_1\) and \(\sigma_2\), when the sampled values are independent, the sampling distribution of the difference in sample means, \(\bar x_1-\bar x_2\), has a mean \(\mu_{\bar x_1-\bar x_2}=\mu_1-\mu_2\) and standard deviation \(\sigma_{\bar x_1-\bar x_2}=\sqrt{\dfrac{\sigma_1^2}{n_1}+\dfrac{\sigma_2^2}{n_2}}\).
4.6.B.1. Sampling without replacement requires that two conditions must be met:
4.6.B.1.i. The randomization condition: the data should be collected using two independent random samples.
4.6.B.1.ii. The 10% condition: the size of each sample should be less than or equal to 10% of the respective population size: \(n_1\le10\%N_1\) and \(n_2\le10\%N_2\), where \(N_1\) is the size of population 1 and \(N_2\) is the size of population 2. The sample sizes are represented as \(n_1\) and \(n_2\).
4.6.B.2. If the data come from an experiment, the data only need to meet the randomization condition. The treatments must be randomly assigned to experimental units to meet the randomization condition.
4.6.B.3. The sampling distribution for the difference between sample means, \((\bar x_1-\bar x_2)\), can be modeled with a normal distribution if the two population distributions can each be modeled by a normal distribution.
4.6.B.4. The sampling distribution for the difference between sample means, \((\bar x_1-\bar x_2)\), can be modeled approximately by a normal distribution if the two population distributions cannot be modeled by a normal distribution but \(n_1\ge30\) and \(n_2\ge30\).
4.6.C.1. The mean, standard deviation, and probabilities for a sampling distribution for the difference between sample means should be interpreted within the context of specific populations.
Center and spread
Consider two independent populations with means \(\mu_1\), \(\mu_2\) and standard deviations \(\sigma_1\), \(\sigma_2\), from which independent samples of sizes \(n_1\) and \(n_2\) are drawn. The sampling distribution of \(\bar x_1-\bar x_2\) has \[\mu_{\bar x_1-\bar x_2}=\mu_1-\mu_2\qquad\text{and}\qquad\sigma_{\bar x_1-\bar x_2}=\sqrt{\frac{\sigma_1^2}{n_1}+\frac{\sigma_2^2}{n_2}}.\] The difference of sample means is an unbiased estimator of the difference of population means. As for proportions, it is the variances \(\sigma^2_{\bar x_1}\) and \(\sigma^2_{\bar x_2}\) that add, even though the statistics are subtracted.
Conditions
When sampling without replacement:
Randomization: the data should be collected using two independent random samples.
10% condition: \(n_1\le10\%N_1\) and \(n_2\le10\%N_2\).
If the data come from an experiment, only the randomization condition is needed: the treatments must be randomly assigned to the experimental units, and the 10% condition does not apply.
Shape
The sampling distribution of \(\bar x_1-\bar x_2\) can be modeled with a normal distribution if the two population distributions can each be modeled by a normal distribution. If the populations are not normal, it can be modeled approximately by a normal distribution if \(n_1\ge30\) and \(n_2\ge30\) (the central limit theorem applied to each sample).
Figure 4.5. For \(\mu_1=72\), \(\sigma_1=10\), \(n_1=40\) and \(\mu_2=68\), \(\sigma_2=12\), \(n_2=35\), the difference \(\bar x_1-\bar x_2\) is approximately normal with mean 4 and standard deviation 2.57. The shaded area is the probability that the first sample mean is lower than the second.
Always interpret the mean, standard deviation and probabilities within the context of the specific populations.
Worked example · Probability that the sample difference has the wrong sign
Test scores have mean \(\mu_1=72\) and standard deviation \(\sigma_1=10\) in school 1 and \(\mu_2=68\), \(\sigma_2=12\) in school 2. Independent random samples of \(n_1=40\) and \(n_2=35\) students are taken (both under 10% of their schools). Describe the sampling distribution of \(\bar x_1-\bar x_2\) and find the probability that the sample mean from school 1 is lower than that from school 2.
Both sample sizes are at least 30, so \(\bar x_1-\bar x_2\) is approximately normal. The mean is \(72-68=4\) and the standard deviation is \(\sqrt{\dfrac{10^2}{40}+\dfrac{12^2}{35}}=\sqrt{2.5+4.114}=2.57\). The first sample mean is lower exactly when the difference is below 0: \(z=\dfrac{0-4}{2.57}=-1.56\), so the probability is \(0.060\). In context: even though school 1 has the higher mean by 4 points, about 6% of pairs of such samples would show school 1's mean as lower.
Worked example · Normal populations and small samples
The weights of boxes from machine A are normal with \(\mu_1=50\), \(\sigma_1=8\); from machine B they are normal with \(\mu_2=45\), \(\sigma_2=6\). Random samples of \(n_1=10\) and \(n_2=12\) are taken. Find the probability that \(\bar x_1\gt\bar x_2\).
Because both populations are normal, \(\bar x_1-\bar x_2\) is normal even with small samples. The mean is 5 and the standard deviation is \(\sqrt{\dfrac{64}{10}+\dfrac{36}{12}}=\sqrt{9.4}=3.07\). \(P(\bar x_1-\bar x_2\gt0)=P\!\left(z\gt\dfrac{0-5}{3.07}\right)=P(z\gt-1.63)=0.948\).
Worked example · The standard deviation, step by step
Why is it \(\sqrt{\dfrac{\sigma_1^2}{n_1}+\dfrac{\sigma_2^2}{n_2}}\) and not \(\dfrac{\sigma_1}{\sqrt{n_1}}-\dfrac{\sigma_2}{\sqrt{n_2}}\)?
The two sample means are independent random variables. For independent random variables the variance of a difference is the sum of the variances: \(\sigma^2_{\bar x_1-\bar x_2}=\dfrac{\sigma_1^2}{n_1}+\dfrac{\sigma_2^2}{n_2}\). Subtracting the means does not subtract the uncertainty; the difference is more variable than either mean alone. In the first example the individual standard deviations are \(1.58\) and \(2.03\), and the difference has standard deviation \(2.57\), larger than either.
Worked example · Which conditions for an experiment?
In a randomized experiment, 30 patients were randomly assigned to each of two drugs and the change in blood pressure was recorded. Which conditions are needed to model \(\bar x_1-\bar x_2\) with a normal distribution?
Random assignment of treatments (the randomization condition). The 10% condition is not required for an experiment. For the shape, both groups have \(n\ge30\) (or both populations of responses would have to be approximately normal), so the normal model is justified.
Conditions: two independent random samples (or random assignment in an experiment); 10% for each sample (not for experiments).
Normal if both populations are normal; approximately normal if \(n_1\ge30\) and \(n_2\ge30\).
Interpret in context of the two populations.
Practice
\(\mu_1=20\), \(\sigma_1=4\), \(n_1=36\); \(\mu_2=18\), \(\sigma_2=3\), \(n_2=49\). Find the mean and standard deviation of \(\bar x_1-\bar x_2\).
Show answer
Mean 2. Standard deviation \(\sqrt{16/36+9/49}=\sqrt{0.4444+0.1837}=0.793\).
For the previous problem, find \(P(\bar x_1-\bar x_2\lt1)\), and state whether a normal model is justified.
Show answer
\(z=(1-2)/0.793=-1.26\), probability \(0.104\). Both sample sizes are at least 30, so a normal model for the difference is justified (given random samples, each under 10% of its population).
Why can't the standard deviation of \(\bar x_1-\bar x_2\) be found by subtracting the two standard deviations?
Show answer
The sample means are independent, and for independent random variables the variances add, regardless of whether the variables are added or subtracted. A difference of standard deviations would even be able to give a smaller or negative number, which is impossible for a standard deviation.
Two samples of sizes 12 and 15 are taken from two skewed populations. Is it appropriate to model \(\bar x_1-\bar x_2\) with a normal distribution?
Show answer
No. The populations are not normal and neither sample size is at least 30, so the sampling distribution of the difference may be skewed.
If both sample sizes are multiplied by 4, how does the standard deviation of \(\bar x_1-\bar x_2\) change?
Show answer
It is divided by \(\sqrt4=2\), so it is cut in half.
What does \(\mu_{\bar x_1-\bar x_2}=4\) mean in the school-scores context?
Show answer
The mean of the differences between the two sample mean scores, over all possible pairs of samples, equals the true difference in the schools' mean scores: school 1's mean is 4 points higher than school 2's.
Confidence intervals for a difference in two means
When two groups are independent, the natural way to compare their population means is a two-sample t-interval for the difference between means. This lesson gives the conditions and the formula, shows how to read degrees of freedom from technology, and then explains how to interpret the interval and use it to justify a claim about the difference.
4.7.A. Identify an appropriate confidence interval procedure including the parameter for the difference between two population means.
4.7.B. Justify the appropriateness of constructing a confidence interval for the difference between two population means by verifying conditions.
4.7.C. Calculate an appropriate confidence interval for the difference between two population means.
4.7.D. Calculate the standard error and margin of error for estimating the difference between two population means.
4.8.A. Interpret a confidence interval in context for the difference between two population means.
4.8.B. Justify a claim based on a confidence interval for the difference between two population means.
Essential knowledge.
4.7.A.1. Based on the sample data, a confidence interval can be calculated to estimate the difference between two population means. The appropriate confidence interval procedure for two independent samples is a two-sample t-interval for the difference between population means.
4.7.A.2. The parameter for a confidence interval for a two-sample t-interval for the difference between population means should reference the difference in the means, the response variable, and the populations in context.
4.7.B.1. A two-sample t-interval for a difference between population means requires that three conditions be met:
4.7.B.1.i. The randomization condition: the data should be collected using two independent random samples or a randomized experiment.
4.7.B.1.ii. The 10% condition: when sampling without replacement, the size of each sample should be less than or equal to 10% of the respective population size: \(n_1\le10\%N_1\) and \(n_2\le10\%N_2\), where \(N_1\) is the size of population 1 and \(N_2\) is the size of population 2. The sample sizes are represented as \(n_1\) and \(n_2\). (Note: This condition is unnecessary when the data are from a randomized experiment.)
4.7.B.1.iii. The sample data condition: both samples should have a sample size greater than or equal to 30 or it is indicated that both population distributions are approximately normal. If either sample size is less than 30, both sample data distributions should be free from strong skewness and outliers.
4.7.C.1. A point estimate for the difference between two population means is the difference in sample means, \(\bar x_1-\bar x_2\).
4.7.C.2. For the difference between population means when the population standard deviations are unknown, the confidence interval can be constructed as point estimate ± (margin of error). The confidence interval for the difference between population means is \((\bar x_1-\bar x_2)\pm t^*\sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}\), where \(t^*\) are the critical values for the central \(C\)% of a t-distribution with appropriate degrees of freedom that can be found using technology. The degrees of freedom fall between \(n_1+n_2-2\) and the smaller of \(n_1-1\) and \(n_2-1\).
4.7.D.1. The standard error for the difference between two sample means is \(SE_{\bar x_1-\bar x_2}=\sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}\), where \(s_1\) and \(s_2\) are the sample standard deviations.
4.7.D.2. For the difference between two sample means, the margin of error is the critical value \((t^*)\) times the standard error (SE) of the difference of two sample means, which equals \(t^*\sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}\).
4.8.A.1. Because the confidence interval for the difference between two population means is calculated based on samples from two populations, the computed interval may or may not contain the value for the difference between the two population means.
4.8.A.2. The interpretation of the confidence level is as follows: In repeated random sampling with the same sample size from the same populations, approximately C% of confidence intervals created will capture the difference between the two population means, where C represents the numerical value of the confidence level used.
4.8.A.3. When interpreting a C% confidence interval for the difference between two population means, we say we are C% confident that the interval \((a,b)\) contains the value of the difference in the population means, where \(a\) represents the lower limit and \(b\) represents the upper limit. An interpretation of a confidence interval for the difference between two population means includes a reference to the difference in the population means with the details about the populations it represents in the context of the study.
4.8.B.1. A confidence interval for the difference between two population means provides an interval of values that may serve as convincing evidence to support a particular claim about the difference in two population means. For example, if the interval contains 0, then there is insufficient evidence to conclude there is a difference between the two population means. If the interval does not contain 0, then there is sufficient evidence to conclude there is a difference between the two population means.
Parameters and conditions
For two independent samples, a confidence interval can be calculated to estimate the difference between two population means with a two-sample t-interval for the difference between population means. The parameter should reference the difference in the means, the response variable and the populations in context (and the order of subtraction), for example "\(\mu_1-\mu_2\) = the true difference in mean reaction time (caffeine minus placebo) for volunteers like these."
The procedure requires three conditions:
Randomization: two independent random samples or a randomized experiment.
10% condition: when sampling without replacement, \(n_1\le10\%N_1\) and \(n_2\le10\%N_2\). (Unnecessary for an experiment.)
Sample data condition: both samples have sizes at least 30, or it is indicated that both population distributions are approximately normal. If either sample size is less than 30, both sample data distributions should be free from strong skewness and outliers.
Figure 4.6. Reaction times (in milliseconds) for 12 volunteers randomly assigned to caffeine and 12 assigned to a placebo. Both samples are small, and both distributions are roughly symmetric with no outliers, so the sample data condition is met.
The interval
The point estimate for the difference is \(\bar x_1-\bar x_2\). The interval is \[(\bar x_1-\bar x_2)\pm t^*\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}},\] where \(s_1\) and \(s_2\) are the sample standard deviations. The standard error of the difference is \(SE=\sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}\), and the margin of error is \(t^*\cdot SE\). The critical value \(t^*\) is for the central \(C\)% of a t distribution with appropriate degrees of freedom, which are found using technology. The degrees of freedom fall between \(n_1+n_2-2\) and the smaller of \(n_1-1\) and \(n_2-1\). (Calculator: `STAT` > `TESTS` > `0:2-SampTInt`, answering `No` for pooled.)
Interpreting the interval and justifying a claim
In repeated random sampling with the same sample sizes from the same populations, approximately \(C\)% of intervals created will capture the difference between the two population means. A correct interpretation: "We are \(C\)% confident that the interval from \(a\) to \(b\) contains the true difference \(\mu_1-\mu_2\) in the mean [response] of [populations in context]." Say which group is subtracted from which.
The interval provides an interval of plausible values for the difference, so it can serve as evidence. If the interval contains 0, there is not convincing evidence of a difference between the two population means; if it does not contain 0, there is convincing evidence of a difference, and the interval shows the direction (all values positive: \(\mu_1\gt\mu_2\); all negative: \(\mu_1\lt\mu_2\)) and size.
Worked example · An interval that does not contain 0
In a randomized experiment, 12 volunteers took caffeine and 12 took a placebo before a reaction-time test. The caffeine group had \(\bar x_1=213.3\) ms with \(s_1=11.66\) ms; the placebo group had \(\bar x_2=234.1\) ms with \(s_2=9.35\) ms. Both samples are roughly symmetric with no outliers. Construct and interpret a 95% confidence interval for the difference.
Parameter: \(\mu_1-\mu_2\) = the true difference in mean reaction time (caffeine minus placebo), in ms, for volunteers like these. Conditions: random assignment; both small samples have no strong skewness or outliers (see the boxplots). Calculation: \(\bar x_1-\bar x_2=-20.75\); \(SE=\sqrt{\dfrac{11.66^2}{12}+\dfrac{9.35^2}{12}}=4.315\); the calculator gives \(df\approx21.0\), \(t^*=2.080\), \(ME=2.080(4.315)=8.97\). Interval: \(-20.75\pm8.97=(-29.72,\,-11.78)\). Conclusion: we are 95% confident that the interval from \(-29.7\) to \(-11.8\) ms captures the true difference in mean reaction time (caffeine minus placebo) for volunteers like these. Zero is not in the interval and every plausible value is negative, so there is convincing evidence that caffeine lowers (improves) the mean reaction time, by an estimated 12 to 30 ms. Since the volunteers were randomly assigned, the difference can be attributed to the caffeine.
Worked example · An interval that contains 0
Random samples of 25 students from school A and 28 from school B have mean homework times of 14.2 hours (\(s=3.1\)) and 13.1 hours (\(s=3.6\)) per week, with no strong skewness or outliers. Construct and interpret a 95% interval for the difference.
\(\mu_A-\mu_B\) = the true difference in mean weekly homework time (A minus B). \(\bar x_A-\bar x_B=1.1\), \(SE=\sqrt{\dfrac{3.1^2}{25}+\dfrac{3.6^2}{28}}=0.921\), \(df\approx50.9\), \(t^*=2.007\), \(ME=1.85\); interval \((-0.75,\,2.95)\) hours. We are 95% confident that the true difference in mean weekly homework time (A minus B) is between \(-0.75\) and \(2.95\) hours. The interval contains 0, so there is not convincing evidence of a difference between the mean homework times at the two schools.
Worked example · Choosing the confidence level
For the caffeine experiment the 90% interval is \((-28.2,\,-13.3)\) and the 99% interval is \((-33.0,\,-8.5)\). Compare them.
All three intervals (90%, 95%, 99%) lie entirely below 0, so the conclusion does not depend on the level. The higher the confidence level, the wider the interval: the widths are about 14.9, 17.9 and 24.4 ms.
Worked example · Degrees of freedom
For the caffeine experiment, what are the limits for the degrees of freedom, and how much does the choice matter?
\(df\) is between \(n_1+n_2-2=22\) and the smaller of \(n_1-1=11\) and \(n_2-1=11\), so between 11 and 22; technology gave 21.0. Using the conservative \(df=11\), \(t^*=2.201\) and \(ME=9.50\), a slightly wider interval \((-30.2,\,-11.3)\), with the same conclusion. Always use the calculator's df when it is available.
Calculator
TI-84: `STAT` > `TESTS` > `0:2-SampTInt` (enter `Data` lists or `Stats`), `C-Level`, and `Pooled: No`. The output gives the interval, the degrees of freedom, \(\bar x_1\), \(\bar x_2\), \(s_1\), \(s_2\), \(n_1\), \(n_2\). Write the conditions and interpret the interval in context.
Exam focus
Interval: \((\bar x_1-\bar x_2)\pm t^*\sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}\), df from technology (between \(\min(n_1-1,n_2-1)\) and \(n_1+n_2-2\)).
Conditions: two independent random samples or a randomized experiment; 10% (not for experiments); both \(n\ge30\) or both samples free from strong skewness and outliers.
Interpret: "We are \(C\)% confident that the interval from \(a\) to \(b\) contains the true difference in means (order stated) of [variable in context]."
Contains 0: no convincing evidence of a difference. Does not contain 0: convincing evidence, with direction and size.
Practice
Samples: \(n_1=30\), \(\bar x_1=78.4\), \(s_1=9.6\); \(n_2=32\), \(\bar x_2=73.1\), \(s_2=10.8\). Find a 95% interval for \(\mu_1-\mu_2\) (assume independent random samples).
Show answer
Difference \(5.3\); \(SE=\sqrt{9.6^2/30+10.8^2/32}=2.59\); \(df\approx59.8\), \(t^*=2.00\); \(ME=5.18\); interval \((0.12,\,10.48)\). All values positive, so there is convincing evidence \(\mu_1\gt\mu_2\), though the interval is wide (the lower limit is barely above 0).
A 95% interval for \(\mu_1-\mu_2\) is \((-3.4,\,1.8)\). What can you conclude?
Show answer
The interval contains 0, so there is not convincing evidence of a difference between the two population means.
Why must the two samples be independent for a two-sample t-interval?
Show answer
The standard error formula assumes the two sample means vary independently so that their variances add. If the same people were measured twice (or were matched), the values would be dependent, and one should analyze the differences with a one-sample t-interval.
An experiment compares two diets with 8 people per group; one diet group has an outlier in weight loss. Can the two-sample t-interval be used?
Show answer
The groups are small (\(n\lt30\)), so both samples must be free from strong skewness and outliers. The outlier violates the condition, so the interval may be unreliable; the outlier should be investigated.
In the interpretation of an interval for \(\mu_1-\mu_2\), why must you state which group is first?
Show answer
The sign of the difference depends on the order of subtraction. An interval of \((-29.7,-11.8)\) for (caffeine minus placebo) means caffeine lowers the reaction time, while the same numbers for (placebo minus caffeine) would mean the opposite.
How does increasing the sample sizes affect the width of the interval for \(\mu_1-\mu_2\)?
Show answer
The standard error \(\sqrt{s_1^2/n_1+s_2^2/n_2}\) decreases, so the interval narrows (about \(\propto1/\sqrt n\) if both sizes are multiplied by the same factor).
Do students taught with a new method score higher than students taught with the old one? Does caffeine change reaction time? Questions like these compare the means of two populations or two treatments, and the appropriate procedure is the two-sample t-test. This lesson sets it up: the parameters, the hypotheses, and the conditions. (The calculation is in the next lesson.)
Required content · 4.9.A, 4.9.B, 4.9.C
Learning objectives.
4.9.A. Identify an appropriate testing method for the difference between two population means including the parameters for the difference between the two population means.
4.9.B. Identify the null and alternative hypotheses for the difference between two population means.
4.9.C. Justify the appropriateness of a hypothesis test for the difference between two population means by verifying conditions.
Essential knowledge.
4.9.A.1. The appropriate test for the difference between two population means is a two-sample t-test for a difference between two population means.
4.9.A.2. The parameters for a hypothesis test for the difference between two population means should reference the population parameters, the response variables, and the populations in context.
4.9.B.1. The null hypothesis for a two-sample t-test for the difference between two population means, \(\mu_1\) and \(\mu_2\), can be written as either \(H_0:\mu_1=\mu_2\) or \(H_0:\mu_1-\mu_2=0\). A one-sided alternative hypothesis for the difference between population means can be written as either \(H_a:\mu_1<\mu_2\) (or equivalently \(H_a:\mu_1-\mu_2<0\)) or \(H_a:\mu_1>\mu_2\) (or equivalently \(H_a:\mu_1-\mu_2>0\)). A two-sided alternative hypothesis for the difference between population means can be written as \(H_a:\mu_1\ne\mu_2\) (or equivalently \(H_a:\mu_1-\mu_2\ne0\)).
4.9.C.1. A two-sample t-test for a difference between population means requires that three conditions be met:
4.9.C.1.i. The randomization condition: the data should be collected using two independent random samples or a randomized experiment.
4.9.C.1.ii. The 10% condition: when sampling without replacement, the size of each sample should be less than or equal to 10% of the respective population size: \(n_1\le10\%N_1\) and \(n_2\le10\%N_2\), where \(N_1\) is the size of population 1 and \(N_2\) is the size of population 2. The sample sizes are represented as \(n_1\) and \(n_2\). (Note: This condition is unnecessary when the data are from a randomized experiment.)
4.9.C.1.iii. The sample data condition: both samples should have a sample size greater than or equal to 30 or it is indicated that both population distributions are approximately normal. If either sample size is less than 30, both sample data distributions should be free from strong skewness and outliers.
The procedure and the parameters
The appropriate test for the difference between two population means (from independent samples or randomized groups) is a two-sample t-test for a difference between two population means. The parameters should reference the population parameters, the response variables and the populations in context. For an experiment, the parameters are the true means of the response under each treatment (for volunteers like those in the study). Define \(\mu_1\) and \(\mu_2\) explicitly so the direction of the alternative is clear.
The hypotheses
The null hypothesis says there is no difference between the population means. It can be written \(H_0:\mu_1=\mu_2\) or equivalently \(H_0:\mu_1-\mu_2=0\). A one-sided alternative can be written \(H_a:\mu_1\lt\mu_2\) (or \(\mu_1-\mu_2\lt0\)) or \(H_a:\mu_1\gt\mu_2\) (or \(\mu_1-\mu_2\gt0\)); a two-sided alternative is \(H_a:\mu_1\ne\mu_2\) (or \(\mu_1-\mu_2\ne0\)). The alternative is chosen from the research question before looking at the data.
Conditions
A two-sample t-test for a difference between population means requires three conditions:
Randomization: two independent random samples or a randomized experiment.
10% condition: when sampling without replacement, \(n_1\le10\%N_1\) and \(n_2\le10\%N_2\). (Unnecessary for a randomized experiment.)
Sample data condition: both samples have size at least 30, or it is indicated that both population distributions are approximately normal. If either sample is smaller than 30, both sample data distributions should be free from strong skewness and outliers.
Unlike the proportion test, the t-test does not pool the two samples: the test statistic uses the separate sample standard deviations \(s_1\) and \(s_2\).
Worked example · Writing the hypotheses
Write parameters and hypotheses. (a) A teacher wants to know whether students taught with a new method (group 1) score higher on average than students taught with the old method (group 2). (b) A researcher wants to know whether caffeine changes mean reaction time (caffeine group 1, placebo group 2). (c) A coach thinks athletes at school X (group 1) run slower on average than athletes at school Y (group 2).
(a) \(\mu_1\) = true mean score of students taught with the new method; \(\mu_2\) = true mean score with the old method. \(H_0:\mu_1=\mu_2\), \(H_a:\mu_1\gt\mu_2\). (b) \(\mu_1\) = true mean reaction time (ms) with caffeine; \(\mu_2\) = true mean reaction time with the placebo, for volunteers like these. \(H_0:\mu_1=\mu_2\), \(H_a:\mu_1\ne\mu_2\). (c) \(\mu_1\), \(\mu_2\) = the true mean running times of all athletes at the two schools. \(H_0:\mu_1=\mu_2\), \(H_a:\mu_1\gt\mu_2\) (a larger mean time means slower).
Worked example · Checking conditions
In a randomized experiment, 12 volunteers took caffeine and 12 took a placebo. Boxplots of the reaction times are roughly symmetric with no outliers. Check the conditions for a two-sample t-test.
Volunteers were randomly assigned to the treatments, so the randomization condition is met (the 10% condition is unnecessary). Both samples are smaller than 30, but both boxplots show no strong skewness and no outliers, so the sample data condition is met. A two-sample t-test is appropriate.
Worked example · Independent or paired?
A study measures the same 15 students' scores on a test taken in the morning and again in the afternoon. A student proposes a two-sample t-test. Evaluate.
The two sets of scores are from the same students, so the samples are dependent: this is a matched pairs design. The appropriate procedure is a one-sample t-test on the 15 differences (afternoon minus morning) with \(H_0:\mu_d=0\), not a two-sample t-test.
Worked example · The wrong test is not just a technicality
In a comparison of two teaching methods, a student writes \(H_0:\bar x_1=\bar x_2\). Explain what is wrong.
Hypotheses concern parameters, not statistics. The sample means \(\bar x_1\) and \(\bar x_2\) will almost never be exactly equal; the question is whether the population (or treatment) means \(\mu_1\) and \(\mu_2\) differ. The correct form is \(H_0:\mu_1=\mu_2\).
Exam focus
Two independent samples (or treatment groups), quantitative response: two-sample t-test. Matched pairs: one-sample t-test on the differences.
\(H_0:\mu_1=\mu_2\) (or \(\mu_1-\mu_2=0\)); \(H_a\): \(\lt\), \(\gt\) or \(\ne\). Define both parameters in context.
Conditions: two independent random samples or a randomized experiment; 10% (not for experiments); both \(n\ge30\) or both samples free from strong skewness and outliers.
No pooling in the t-test: use \(s_1\) and \(s_2\) separately.
Practice
A researcher wants to know if the mean weight loss differs between two diets. Write the parameters and hypotheses.
Show answer
\(\mu_1\) = true mean weight loss with diet 1; \(\mu_2\) = true mean weight loss with diet 2 (for people like those in the study). \(H_0:\mu_1=\mu_2\), \(H_a:\mu_1\ne\mu_2\).
A company claims its new battery lasts longer than the old one. Write the hypotheses with the new battery as group 1.
Show answer
\(\mu_1\) = true mean life of the new battery; \(\mu_2\) = true mean life of the old battery. \(H_0:\mu_1=\mu_2\), \(H_a:\mu_1\gt\mu_2\).
Samples of 40 and 45 are selected independently and randomly from large populations. Which conditions for the two-sample t-test are met?
Show answer
Randomization (independent random samples), the 10% condition (large populations), and the sample data condition (both sample sizes are at least 30).
An experiment has 10 and 11 subjects in the two treatment groups. What must you check about the data?
Show answer
Both samples are smaller than 30, so check that both sample distributions (for example with boxplots or dotplots) are free from strong skewness and outliers (or that the populations are approximately normal).
Explain why a two-sample t-test is not appropriate for comparing the cholesterol of 20 patients before and after a treatment.
Show answer
The measurements are on the same patients, so the samples are not independent. Use a one-sample t-test on the 20 differences.
The null hypothesis is \(H_0:\mu_1-\mu_2=0\). Explain in words.
Show answer
The null hypothesis says there is no difference between the two population means: on average the two populations (or treatments) give the same response.
This lesson finishes the two-sample t-test: the test statistic, the degrees of freedom from technology, the p-value, the decision, and the conclusion in context. The steps mirror the other tests; what changes is the standard error and the use of technology for the degrees of freedom.
Required content · 4.10.A, 4.10.B, 4.10.C
Learning objectives.
4.10.A. Calculate an appropriate test statistic and p-value for testing a hypothesis for the difference between two population means.
4.10.B. Interpret the p-value of a hypothesis test for the difference between two population means.
4.10.C. Justify a claim about the populations based on the results of a hypothesis test for the difference between two population means.
Essential knowledge.
4.10.A.1. The test statistic for a two-sample t-test for the difference between two population means is \(t=\dfrac{(\bar x_1-\bar x_2)-0}{\sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}}\). The t-statistic has a t-distribution when the null hypothesis is true. The t-statistic and the degrees of freedom can be found using technology. The degrees of freedom fall between \(n_1+n_2-2\) and the smaller of \(n_1-1\) and \(n_2-1\).
4.10.A.2. The p-value for a two-sample t-test for the difference between two population means can be found using the appropriate t-distribution table or from the appropriate t-distribution using technology.
4.10.B.1. The p-value is the probability of obtaining a test statistic as extreme or more extreme than the test statistic that was observed (i.e., in the direction of the alternative hypothesis) given that the null hypothesis is true. An interpretation of the p-value of a hypothesis test for a two-sample test for the difference between two population means should include a statement that the p-value is computed by assuming that the null hypothesis is true (i.e., by assuming the population means are equal to each other in context).
4.10.C.1. A formal decision explicitly compares the p-value to the significance level, \(\alpha\). If the p-value is less than or equal to \(\alpha\), then reject the null hypothesis, \(H_0:\mu_1-\mu_2=0\) (or \(H_0:\mu_1=\mu_2\)). If the p-value is greater than \(\alpha\), then fail to reject the null hypothesis.
4.10.C.2. The results of a hypothesis test for a two-sample t-test for a difference between two population means can serve as the statistical reasoning to support the answer to an investigative question about the two populations that were sampled.
4.10.C.3. A conclusion for the hypothesis test for the difference between two population means is stated in context consistent with, and in terms of, the alternative hypothesis using non-definitive language. The conclusion should contain a reference to the parameters and the populations.
The test statistic
The test statistic for a two-sample t-test for a difference between two population means is \[t=\frac{(\bar x_1-\bar x_2)-0}{\sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}}.\] When the null hypothesis is true, the statistic has (approximately) a t distribution. The t statistic and the degrees of freedom can be found with technology, and the degrees of freedom fall between \(n_1+n_2-2\) and the smaller of \(n_1-1\) and \(n_2-1\). The p-value is found from the t distribution: the area to the right for \(H_a:\mu_1\gt\mu_2\), to the left for \(\lt\), and in both tails for \(\ne\).
Interpretation, decision and conclusion
The p-value is the probability of obtaining a test statistic as extreme or more extreme than the one observed (in the direction of \(H_a\)), assuming the null hypothesis is true, that is, assuming the two population means are equal (in context). The decision compares the p-value with \(\alpha\): if the p-value \(\le\alpha\), reject \(H_0\); if the p-value \(\gt\alpha\), fail to reject \(H_0\). The results can serve as the statistical reasoning to answer the investigative question about the two populations. The conclusion is stated in context, in terms of \(H_a\), in non-definitive language, and refers to the parameters and the populations. (Calculator: `STAT` > `TESTS` > `4:2-SampTTest`, `Pooled: No`.)
Worked example · A one-sided test with large samples
A teacher randomly selects 30 students taught with a new method and 32 taught with the old one (both small fractions of the school's students). The new-method group has \(\bar x_1=78.4\), \(s_1=9.6\); the old-method group has \(\bar x_2=73.1\), \(s_2=10.8\). Is there convincing evidence at \(\alpha=0.05\) that the new method has a higher mean score?
State: \(\mu_1\) = true mean score of students taught with the new method; \(\mu_2\) = true mean score with the old method. \(H_0:\mu_1=\mu_2\), \(H_a:\mu_1\gt\mu_2\). Plan: two-sample t-test; independent random samples, each under 10% of its population, and both \(n\ge30\). Do: \(t=\dfrac{78.4-73.1}{\sqrt{9.6^2/30+10.8^2/32}}=\dfrac{5.3}{2.592}=2.05\); \(df=59.8\); p-value \(=0.023\). Conclude: since \(0.023\lt0.05\), reject \(H_0\). There is convincing statistical evidence that the true mean score of students taught with the new method is higher than that of students taught with the old method.
Worked example · A randomized experiment with small samples
In the caffeine experiment, 12 volunteers took caffeine (\(\bar x_1=213.3\) ms, \(s_1=11.66\)) and 12 took a placebo (\(\bar x_2=234.1\) ms, \(s_2=9.35\)). Test at \(\alpha=0.05\) whether caffeine reduces mean reaction time.
State: \(\mu_1\) = true mean reaction time (ms) with caffeine; \(\mu_2\) = true mean reaction time with the placebo, for volunteers like these. \(H_0:\mu_1=\mu_2\), \(H_a:\mu_1\lt\mu_2\). Plan: two-sample t-test; random assignment; both samples are small but have no strong skewness or outliers. Do: \(t=\dfrac{-20.75}{\sqrt{11.66^2/12+9.35^2/12}}=\dfrac{-20.75}{4.315}=-4.81\); \(df\approx21.0\); p-value \(=P(t\le-4.81)\approx0.00005\). Conclude: since the p-value is much less than 0.05, reject \(H_0\): there is convincing evidence that caffeine lowers mean reaction time for volunteers like these. Because the volunteers were randomly assigned, the difference can be attributed to the caffeine. Interpretation of the p-value: if the mean reaction times were the same with caffeine and placebo, there would be only about a 0.005% chance of random assignment producing a difference in sample means of 20.75 ms or more in favor of caffeine.
Worked example · A two-sided test
Random samples of 25 students at school A and 28 at school B have mean weekly homework times of 14.2 hours (\(s=3.1\)) and 13.1 hours (\(s=3.6\)), without strong skewness or outliers. Is there convincing evidence at \(\alpha=0.05\) that the mean times differ?
\(H_0:\mu_A=\mu_B\), \(H_a:\mu_A\ne\mu_B\). \(t=\dfrac{14.2-13.1}{\sqrt{3.1^2/25+3.6^2/28}}=\dfrac{1.1}{0.921}=1.19\); \(df\approx50.9\); two-sided p-value \(=0.238\). Since \(0.238\gt0.05\), fail to reject \(H_0\): there is not convincing evidence that the mean weekly homework times at the two schools differ. This agrees with the interval in Lesson 4.7, which contained 0.
Worked example · Test and interval agree
In the caffeine experiment, the 95% interval for \(\mu_1-\mu_2\) was \((-29.7,\,-11.8)\), which does not contain 0. How is this related to the test?
A two-sided test at \(\alpha=0.05\) and a 95% interval give consistent answers: if 0 is outside the interval, the two-sided p-value is below 0.05, and the test rejects \(H_0:\mu_1-\mu_2=0\) (here the two-sided p-value is 0.0001). The interval adds information the test does not: how large the difference plausibly is.
Calculator
TI-84: `STAT` > `TESTS` > `4:2-SampTTest` with `Data` (lists) or `Stats` (\(\bar x_1,s_1,n_1,\bar x_2,s_2,n_2\)), the alternative (`μ1≠μ2`, `<` or `>`), and `Pooled: No`. The output gives \(t\), the p-value and the degrees of freedom. Always say which group is group 1.
Exam focus
\(t=\dfrac{\bar x_1-\bar x_2}{\sqrt{s_1^2/n_1+s_2^2/n_2}}\); df from technology; p-value from the t distribution by the direction of \(H_a\).
Interpret the p-value assuming the two population means are equal. Decide with \(\alpha\); conclude in context about both populations, in terms of \(H_a\), in non-definitive language.
A randomized experiment supports a cause-and-effect conclusion; random samples support a conclusion about populations.
A two-sided test and the matching confidence interval agree.
Practice
Two independent random samples: \(n_1=36\), \(\bar x_1=50.2\), \(s_1=6\); \(n_2=40\), \(\bar x_2=47.5\), \(s_2=7\). Test \(H_a:\mu_1\ne\mu_2\) at \(\alpha=0.05\).
Show answer
\(t=\dfrac{2.7}{\sqrt{36/36+49/40}}=\dfrac{2.7}{1.4916}=1.81\); \(df\approx74\); two-sided p-value \(\approx0.074\). Since \(0.074\gt0.05\), fail to reject \(H_0\): not convincing evidence that the two population means differ.
A test of \(H_0:\mu_1=\mu_2\) against \(H_a:\mu_1\gt\mu_2\) gives \(t=1.9\) with \(df=40\). Find the approximate p-value and the decision at \(\alpha=0.05\).
Show answer
The p-value is \(P(t_{40}\gt1.9)\approx0.032\). Since \(0.032\lt0.05\), reject \(H_0\).
Explain why the p-value in the caffeine experiment supports a cause-and-effect conclusion.
Show answer
The treatments (caffeine or placebo) were randomly assigned, which balances other factors across groups, so a difference larger than random assignment would plausibly produce (the tiny p-value) can be attributed to the caffeine.
A student concludes from a large p-value that the two population means are equal. Correct this.
Show answer
A large p-value means the data do not give convincing evidence of a difference; it does not prove equality. A difference could exist that the samples were too small to detect.
Why does the two-sample t-test use \(s_1^2/n_1+s_2^2/n_2\) in the denominator and not a pooled value?
Show answer
The procedure does not assume that the two populations have equal standard deviations, so the variances of the two sample means are estimated separately and added, as the sampling distribution of \(\bar x_1-\bar x_2\) requires. (This differs from the two-proportion test, where \(H_0\) says the proportions are equal and so a combined estimate is used.)
Interpret a p-value of 0.023 in the teaching-method test.
Show answer
If the true mean scores with the new and old methods were equal, there would be about a 2.3% chance of independent random samples showing a difference in sample means of 5.3 points or more in favor of the new method just by random sampling variability.
Unit 4 practice · 10 problems
Unit 4 practice: Inference for Quantitative Data: Means
Ten problems covering the whole unit: three multiple-choice questions in the style of Section I and seven free-response problems. Name the procedure and check the conditions (including the sample data condition) before computing.
Tomato weights are normal with mean 150 g and standard deviation 12 g. In a random sample of 16 tomatoes from a large harvest, find the mean and standard deviation of \(\bar x\) and the probability that \(\bar x\) is less than 147 g.
Show answer
\(\mu_{\bar x}=150\) and \(\sigma_{\bar x}=12/\sqrt{16}=3\). Because the population is normal, \(\bar x\) is normal for any sample size. \(z=(147-150)/3=-1\), so \(P(\bar x\lt147)=0.159\). (For a single tomato, \(P(X\lt147)=0.401\), much larger: averages vary less than individuals.)
A random sample of 15 observations is strongly skewed right and has one extreme outlier. Which is true about using a one-sample t-interval for the population mean?
Randomization is one condition, but the sample data condition must also be met.
There is no rule that \(n\ge10\) is sufficient; for \(n\lt30\) the sample must show no strong skewness or outliers.
For \(n\lt30\), the t procedures require the sample data to be free from strong skewness and outliers (or a normal population). Here they are not.
The 10% condition addresses independence, not the shape of the data.
A random sample of 25 batteries from a large run has \(\bar x=48.2\) hours and \(s=7.5\) hours, with no strong skewness or outliers. (a) Construct a 95% confidence interval for the mean life of this brand's batteries. (b) The maker claims the mean is 50 hours. What does the interval say about that claim?
Show answer
(a) \(df=24\), \(t^*=2.064\), \(SE=7.5/\sqrt{25}=1.5\), \(ME=2.064(1.5)=3.10\), interval \(48.2\pm3.10=(45.10,\,51.30)\). We are 95% confident that the interval from 45.1 to 51.3 hours captures the true mean life of this brand's batteries. (b) 50 is inside the interval, so it is a plausible value for the mean; the interval does not provide convincing evidence against the claim.
A two-sided one-sample t-test with \(n=20\) gives \(t=2.1\). Which is the correct number of degrees of freedom and approximate p-value?
The degrees of freedom are \(n-1=19\), not 20.
The degrees of freedom are \(n-1=19\), and the two-sided p-value is \(2P(t_{19}\gt2.1)\approx0.049\).
\(df=19\) is correct, but 0.025 is the one-sided area; the test is two-sided, so double it.
The degrees of freedom are 19, and 0.025 is only the one-tail area.
A random sample of 30 students (from a large school) studied a mean of 7.1 hours for an exam, with \(s=1.6\) hours. Is there convincing evidence at \(\alpha=0.05\) that the mean study time of all students at the school is greater than 6.5 hours?
Show answer
State: \(\mu\) = the true mean study time (hours) of all students at the school. \(H_0:\mu=6.5\), \(H_a:\mu\gt6.5\). Plan: one-sample t-test; random sample, under 10% of a large school, \(n=30\ge30\). Do: \(t=\dfrac{7.1-6.5}{1.6/\sqrt{30}}=\dfrac{0.6}{0.292}=2.05\), \(df=29\), p-value \(=0.025\). Conclude: since \(0.025\lt0.05\), reject \(H_0\): there is convincing evidence that the mean study time of all students at the school is greater than 6.5 hours.
Eight randomly chosen students took a speed-reading test before and after a short course. The differences in words per minute (after minus before) were 4, \(-1\), 3, 5, 2, 0, 6, 3. The dotplot of the differences has no strong skewness or outliers. Test at \(\alpha=0.05\) whether the course increases mean reading speed.
Show answer
State: \(\mu_d\) = the true mean difference (after minus before) in reading speed, in words per minute, for students like these. \(H_0:\mu_d=0\), \(H_a:\mu_d\gt0\). Plan: matched pairs, so a one-sample t-test on the differences; random sample; \(n=8\lt30\) but the differences show no strong skewness or outliers. Do: \(\bar x_d=2.75\), \(s_d=2.375\); \(t=\dfrac{2.75}{2.375/\sqrt8}=3.27\), \(df=7\), p-value \(=0.0068\). Conclude: since \(0.0068\lt0.05\), reject \(H_0\): there is convincing evidence that the mean reading speed is higher after the course than before for students like these. (With no control group we cannot say the course caused the increase.)
Independent random samples of 40 students from school A and 36 from school B took the same test. School A: \(\bar x_1=82.3\), \(s_1=9.1\). School B: \(\bar x_2=77.9\), \(s_2=10.4\). (a) Construct a 95% confidence interval for \(\mu_A-\mu_B\) (the calculator gives \(df\approx70.0\) and \(t^*=1.994\)). (b) What does the interval say about a difference in the schools' mean scores?
Show answer
(a) Conditions: independent random samples, each under 10% of its school, both \(n\ge30\). \(\bar x_1-\bar x_2=4.4\), \(SE=\sqrt{\dfrac{9.1^2}{40}+\dfrac{10.4^2}{36}}=2.25\), \(ME=1.994(2.25)=4.49\), interval \((-0.09,\,8.89)\). We are 95% confident that the interval from \(-0.09\) to \(8.89\) points captures the true difference (A minus B) in the mean scores of the two schools. (b) The interval contains 0, so there is not convincing evidence of a difference in the mean scores, although the interval is mostly positive, so A may be higher.
Use the same data as the previous problem to test \(H_0:\mu_A=\mu_B\) against \(H_a:\mu_A\ne\mu_B\) at \(\alpha=0.05\), and explain how the result agrees with the interval.
Show answer
\(t=\dfrac{4.4}{2.25}=1.95\), \(df\approx70.0\), two-sided p-value \(=0.055\). Since \(0.055\gt0.05\), fail to reject \(H_0\): there is not convincing evidence that the mean scores of the two schools differ. This agrees with the 95% interval, which contains 0; a two-sided test at \(\alpha=0.05\) rejects exactly when the 95% interval excludes the null value.
Scores at school 1 have mean 50 and standard deviation 8, and at school 2 mean 47 and standard deviation 10. Independent random samples of 36 and 40 students are taken. Find the mean and standard deviation of \(\bar x_1-\bar x_2\) and the probability that \(\bar x_1\lt\bar x_2\).
Show answer
The mean is \(50-47=3\) and the standard deviation is \(\sqrt{\dfrac{8^2}{36}+\dfrac{10^2}{40}}=\sqrt{1.778+2.5}=2.07\). Both sample sizes are at least 30, so \(\bar x_1-\bar x_2\) is approximately normal. \(P(\bar x_1-\bar x_2\lt0)=P\!\left(z\lt\dfrac{0-3}{2.07}\right)=P(z\lt-1.45)=0.073\).
Which situation calls for a one-sample t procedure on the differences (matched pairs) rather than a two-sample t procedure?
The boys and girls are separate, independent samples, so use the two-sample procedure.
The groups are formed by random assignment into two independent groups: a two-sample procedure.
The same patients are measured twice, so the two sets of values are dependent. Take the difference for each patient and use a one-sample t procedure.
The samples from the two cities are independent: two-sample procedure.
So far a quantitative variable has been studied alone or compared across groups. Often the question is how two quantitative variables are related: Do students who study longer score higher? How is a car's age related to its price? The tool for seeing a relationship between two quantitative variables is the scatterplot, and describing what it shows is the first step of any regression analysis.
Required content · 5.1.A, 5.1.B, 5.1.C
Learning objectives.
5.1.A. Construct scatterplots depicting the relationship between two quantitative variables.
5.1.B. Describe the characteristics of a scatterplot.
5.1.C. Justify a claim using scatterplots depicting the relationship between two quantitative variables.
Essential knowledge.
5.1.A.1. A bivariate quantitative data set consists of observations of ordered pairs from two quantitative variables, collected from the same individuals in a sample or population, and can be used to construct a scatterplot.
5.1.A.2. A scatterplot shows the relationship between two quantitative variables for each observation, one corresponding to the value on the x-axis and one corresponding to the value on the y-axis. The explanatory variable is placed on the x-axis and is the variable whose values are used to explain or predict the corresponding values for the response variable, which is placed on the y-axis.
5.1.B.1. A description of the association shown in a scatterplot includes form, direction, strength, and unusual features.
5.1.B.2. The form of the association shown in a scatterplot, if any, can be described as linear or non-linear.
5.1.B.3. The direction of the association shown in a scatterplot, if any, can be described as positive or negative. A positive association means that as values of the explanatory variable increase, the values of the response variable tend to increase. A negative association means that as values of the explanatory variable increase, the values of the response variable tend to decrease.
5.1.B.4. The strength of the association shown in a scatterplot is how closely the points follow the general pattern. Strength can be described as strong, moderate, or weak.
5.1.B.5. Unusual features of a scatterplot include clusters of individual points or points that don’t fit in the general pattern of association between the two variables.
5.1.C.1. Scatterplots depicting the relationship between two numeric variables may reveal information that can be used to justify claims about the variable in context.
Bivariate quantitative data
A bivariate quantitative data set consists of observations of ordered pairs from two quantitative variables, collected from the same individuals in a sample or population. Each individual contributes a pair \((x,y)\). A scatterplot shows the relationship between the two variables for each observation, one variable on the \(x\)-axis and the other on the \(y\)-axis.
The explanatory variable is the variable whose values are used to explain or predict the corresponding values of the response variable. The explanatory variable is placed on the horizontal (\(x\)) axis and the response variable on the vertical (\(y\)) axis. Deciding which is which depends on the question: with hours studied and exam score, hours studied is the explanatory variable and exam score the response. (Calling a variable explanatory does not mean it causes the response.)
Figure 5.1. Each point is one student: hours studied (explanatory variable, horizontal axis) and exam score (response variable, vertical axis). The association is positive, linear and strong, with no unusual points.
Describing the association
A description of the association shown in a scatterplot includes form, direction, strength and unusual features, in context.
Form: the association is linear if the points follow a straight-line pattern; otherwise it is nonlinear (for example curved).
Direction: a positive association means that as the values of the explanatory variable increase, the values of the response variable tend to increase; a negative association means that as the explanatory values increase, the response values tend to decrease.
Strength: how closely the points follow the general pattern: strong, moderate or weak.
Unusual features:clusters of points, and individual points (outliers) that do not fit the general pattern of association.
Figure 5.2. Scatterplots with different forms and directions. A description of an association includes form (linear or nonlinear), direction (positive or negative), strength (strong, moderate or weak) and unusual features.
Scatterplots may reveal information that can be used to justify claims about the variables in context, and also information that cautions against a simple summary (such as clusters that suggest two different groups mixed together).
Worked example · Describing a scatterplot
Ten students recorded hours studied and exam score (the scatterplot above). Describe the association.
The association between hours studied and exam score is positive (students who studied more hours tended to have higher scores), linear (the points follow a straight-line pattern), and strong (the points are close to the pattern). There are no unusual features: no clusters and no outliers. For example, a student who studied 8 hours scored 88, while one who studied 1 hour scored 52.
Worked example · Choosing explanatory and response variables
For each pair, name the explanatory and response variable. (a) The age of a used car and its price. (b) The number of hours of daily sunshine and the temperature in cities. (c) A student wants to predict the amount of fertilizer needed from a crop's yield.
(a) Age is explanatory; price is the response. (b) Either could be argued, but the question "does more sunshine go with higher temperatures?" treats sunshine as explanatory and temperature as the response. (c) The prediction is of the fertilizer amount, so fertilizer amount is the response and yield is the explanatory variable (this is unusual: in a designed experiment fertilizer would be the explanatory variable and yield the response). The roles depend on the question being asked.
Worked example · Direction and form from a description
The scatterplot of outdoor temperature (explanatory) and hot chocolate sales (response) at a café shows that as temperature rises, sales steadily fall, and the points lie close to a line except for one cool day with sales far above the pattern. Describe the association.
Negative (sales decrease as temperature increases), linear and strong, with one unusual point: the cool day with unusually high sales does not fit the general pattern (an outlier). Even a single unusual point should be mentioned and, if possible, explained (perhaps a festival that day).
Worked example · Linear or nonlinear?
The height of a thrown ball (response) against time since release (explanatory) rises, peaks and falls. Is a linear description appropriate?
No. The form is nonlinear (curved, roughly parabolic): the direction changes from positive to negative, so a single direction cannot describe it and a straight line would fit poorly. A linear model should be fit only when the scatterplot shows a linear trend.
Exam focus
Bivariate quantitative data: pairs \((x,y)\) from the same individuals. Explanatory variable on the \(x\)-axis; response on the \(y\)-axis.
Describe a scatterplot with form (linear or nonlinear), direction (positive or negative), strength (strong, moderate, weak) and unusual features (clusters, outliers), in context.
Positive: both tend to increase together. Negative: one increases as the other decreases.
Association is not causation.
Practice
A scatterplot of a runner's weight (explanatory) and race time (response) shows points rising from lower left to upper right, loosely scattered around a line. Describe the association.
Show answer
A moderate (or weak to moderate) positive linear association: heavier runners tend to have longer race times, though the points are loosely scattered.
Name the explanatory and response variable: the number of hours of sleep and the score on a test the next day.
Show answer
Hours of sleep is the explanatory variable; the test score is the response variable.
A scatterplot shows two separate groups of points, one in the lower left and one in the upper right, with no pattern within each group. What should the description mention?
Show answer
The two clusters (an unusual feature): the overall pattern looks positive, but within each cluster there is no apparent association, and the clusters may represent two different groups of individuals.
A scatterplot of the age of children (explanatory) and their height (response) from 2 to 12 years old curves upward and then flattens. Describe the form.
Show answer
The form is nonlinear (curved): height increases with age (positive direction) but the increases get smaller, so a straight line would not describe the pattern well.
Explain why a scatterplot, rather than two separate histograms, is needed to study the relationship between two quantitative variables.
Show answer
Histograms show the distribution of each variable separately and lose the pairing. A scatterplot shows each individual's two values together, so the relationship (form, direction, strength, unusual points) can be seen.
A student finds a positive association between ice cream sales and the number of drownings across months and concludes ice cream causes drowning. Respond.
Show answer
Association does not imply causation. A lurking variable, such as hot weather (more swimming and more ice cream), can drive both variables.
Describing a scatterplot in words is useful, but a single number that summarizes the strength and direction of a linear relationship is more convenient for comparing relationships. That number is the correlation coefficient, \(r\). This lesson defines it, explains how to read it, and gives the important cautions about what it can and cannot tell you.
Required content · 5.2.A
Learning objective.
5.2.A. Interpret the correlation for a linear relationship.
Essential knowledge.
5.2.A.1. The correlation coefficient, r, summarizes the strength and direction of the linear association between two quantitative variables. The correlation coefficient r is unit-free and always between −1 and 1, inclusive. A negative correlation coefficient value indicates a negative association, and a positive correlation coefficient value indicates a positive association.
5.2.A.2. The strength of the linear association is determined by how close the correlation coefficient is to −1 or 1. A value of \(r=0\) indicates that there is no linear association. A value of \(r=-1\) or \(r=1\) indicates that there is a perfect linear association.
5.2.A.3. A correlation coefficient close to −1 or 1 does not necessarily mean that a linear model is appropriate.
5.2.A.4. A perceived or real relationship between two variables does not mean that changes in one variable cause changes in the other. That is, correlation does not necessarily imply causation.
The correlation coefficient
The correlation coefficient \(r\) summarizes the strength and direction of the linear association between two quantitative variables. It is unit-free (changing the units of either variable, say from inches to centimeters, does not change \(r\)) and always between \(-1\) and \(1\), inclusive. It is computed with technology, from the standardized values: \(r=\dfrac1{n-1}\sum z_xz_y\), the average of the products of the \(z\)-scores (using \(n-1\)).
The sign gives the direction: a negative \(r\) indicates a negative association and a positive \(r\) a positive association.
The strength of the linear association is determined by how close \(r\) is to \(-1\) or \(1\). A value of \(r=0\) indicates no linear association; \(r=1\) or \(r=-1\) indicates a perfect linear association (all points exactly on a line).
Figure 5.3. The correlation coefficient \(r\) describes the strength and direction of the linear association: values near 1 or \(-1\) mean a strong linear association, values near 0 mean little or no linear association, and the sign gives the direction.
For the study-time data (hours studied and exam score), \(r=0.983\): a strong positive linear association. There is no cutoff that divides "strong" from "moderate," but values of \(|r|\) above about 0.8 are usually described as strong, between about 0.5 and 0.8 as moderate, and below about 0.5 as weak.
Cautions
A correlation near \(-1\) or \(1\) does not necessarily mean a linear model is appropriate. \(r\) measures linear association only. A strong curved relationship can have \(r\) close to 0, and a scatterplot must always be examined.
Correlation is not resistant to unusual points. One outlier (or an influential point) can change \(r\) dramatically.
Correlation does not imply causation. A perceived or real relationship between two variables does not mean that changes in one variable cause changes in the other; a lurking variable may explain both, or the relationship may be coincidence.
\(r\) is defined only for two quantitative variables; do not compute it for categorical data.
Figure 5.4. Left: a strong but nonlinear relationship can have a correlation near 0. Right: a single unusual point (the filled orange point replaces the open circle) changes the correlation dramatically, so correlation is not resistant to outliers.
Worked example · Reading \(r\)
Match each correlation to a description: \(r=-0.92\), \(r=0.15\), \(r=0.70\). (a) Moderately strong positive linear association; (b) strong negative linear association; (c) very weak positive (essentially no) linear association.
\(r=-0.92\) is (b): the negative sign gives the direction, and 0.92 is close to 1 in size. \(r=0.15\) is (c). \(r=0.70\) is (a). The strength depends on \(|r|\): \(-0.92\) is stronger than 0.70 even though it is smaller as a number.
Worked example · A strong relationship with \(r\) near 0
The height of a thrown ball is recorded at times 1 to 9 seconds: 2, 9, 15, 18, 20, 19, 16, 11, 3 meters. The correlation between time and height is \(r=0.09\). Does that mean there is no relationship?
No. The points follow a very clear curve (the ball rises and falls), but the relationship is not linear. A correlation of 0.09 says there is almost no linear association; the scatterplot shows a strong nonlinear relationship. This is why you should always look at the scatterplot before interpreting \(r\).
Worked example · The effect of an outlier
For ten data points that follow a line closely, \(r=0.998\). If the last point is changed from \(y=12.0\) to \(y=2.0\) (all others unchanged), \(r\) drops to 0.445. What does this show?
A single unusual point can change the correlation from very strong to moderate. The correlation coefficient is not resistant to outliers. Whenever an outlier is present, report \(r\) with and without it and investigate whether it is an error or a real, important observation.
Worked example · Correlation and causation
A study finds a correlation of \(r=0.78\) between the number of firefighters sent to a fire and the dollar amount of damage. Does sending more firefighters cause more damage?
No. The strong positive correlation reflects a lurking variable: the size of the fire. Larger fires cause more damage and also lead to more firefighters being sent. A correlation does not show that changes in one variable cause changes in the other; establishing causation requires a well-designed experiment.
Exam focus
\(r\): strength and direction of linear association; unit-free; \(-1\le r\le1\); sign = direction; \(|r|\) near 1 = strong; \(r=0\) = no linear association.
\(r\) near \(\pm1\) does not guarantee that a line is the right model; always look at the scatterplot.
\(r\) is affected by outliers. Correlation does not imply causation.
Interpret in context: "There is a strong positive linear association between ... and ...."
Practice
Which is a stronger linear association, \(r=-0.85\) or \(r=0.60\)? Explain.
Show answer
\(r=-0.85\), because \(|{-0.85}|\gt|0.60|\): it is closer to \(-1\) or \(1\). The negative sign indicates a negative association.
The correlation between a car's age and its price is \(r=-0.88\). Interpret it.
Show answer
There is a strong negative linear association between the age of a car and its price: older cars tend to have lower prices.
Does changing the units of the \(y\)-variable from dollars to cents change \(r\)? Explain.
Show answer
No. \(r\) is unit-free: it is computed from standardized values, which do not depend on the units.
A scatterplot shows a strong U-shaped pattern. A student calculates \(r=0.03\) and says the variables are unrelated. Respond.
Show answer
The variables are strongly related, but not linearly. \(r\) measures only linear association, so a value near 0 does not mean there is no relationship; the scatterplot shows a clear nonlinear pattern.
Explain why a high correlation between ice cream sales and sunburns does not show that ice cream causes sunburn.
Show answer
A lurking variable (hot, sunny weather) leads to both more ice cream sales and more sunburns. Correlation alone does not demonstrate cause and effect.
What does \(r=1\) tell you about the points on the scatterplot, and is \(r=1\) common with real data?
Show answer
All the points lie exactly on a line with positive slope. It is very rare with real data, where there is almost always some scatter around any pattern.
When a scatterplot shows a linear pattern, we can summarize it with a line and use the line to predict the response for a given value of the explanatory variable. This lesson introduces the linear regression model, how to make predictions with it, and the difference between interpolation, which is generally safe, and extrapolation, which is not.
Required content · 5.3.A
Learning objective.
5.3.A. Calculate a predicted response value using a linear regression model.
Essential knowledge.
5.3.A.1. If the form of the relationship between x and y appears linear, we can approximate the relationship between x and y using a linear regression model, which is a linear equation that uses an explanatory variable, x, to predict the response variable, y.
5.3.A.2. In a linear regression model, the predicted response value, denoted by \(\hat y\), is calculated as \(\hat y=a+bx\), where \(a\) is the y-intercept, \(b\) is the slope of the regression line, and \(x\) is the explanatory variable.
5.3.A.3. Extrapolation is predicting a response value using a value for the explanatory variable that is beyond the interval of x-values used to determine the regression line. The predicted value is less reliable the further the estimate is extrapolated.
5.3.A.4. Interpolation is predicting a response value using a value for the explanatory variable that is within the interval of x-values used to determine the regression line.
The linear regression model
If the form of the relationship between \(x\) and \(y\) appears linear, we can approximate the relationship using a linear regression model: a linear equation that uses the explanatory variable \(x\) to predict the response variable \(y\). The predicted response is written \(\hat y\) ("y-hat") and calculated as \[\hat y=a+bx,\] where \(a\) is the \(y\)-intercept (the predicted value when \(x=0\)), \(b\) is the slope of the regression line (the predicted change in \(y\) for a one-unit increase in \(x\)), and \(x\) is the explanatory variable. The hat on \(\hat y\) distinguishes the prediction from the observed value \(y\): the model gives predicted values, and the actual data points scatter around them.
The next lessons show how to judge whether the line is appropriate and how the best line is chosen. Here the line for the study-time data is \(\hat y=45.96+5.34x\), where \(x\) is hours studied and \(\hat y\) is the predicted exam score. To predict the score for a student who studies 3.5 hours, substitute: \(\hat y=45.96+5.34(3.5)=64.6\).
Figure 5.5. The least-squares regression line \(\hat y=45.96+5.34x\) for the study-time data passes through \((\bar x,\bar y)\). Predictions for x-values within the range of the data (1 to 8 hours) are interpolation; predictions outside that range (the dashed parts) are extrapolation and are less reliable.
Interpolation and extrapolation
Interpolation is predicting a response value using a value of the explanatory variable within the interval of \(x\)-values used to determine the regression line. For the study-time data (x from 1 to 8 hours), predicting the score for 3.5 hours is interpolation.
Extrapolation is predicting a response value using an \(x\)-value beyond the interval of \(x\)-values used to determine the line. The predicted value is less reliable the further it is extrapolated, because we do not know whether the linear pattern continues. For the study-time data, predicting the score for 12 hours gives \(45.96+5.34(12)=110.0\), an impossible score above 100: the line cannot continue indefinitely.
Always check whether a prediction is interpolation or extrapolation before trusting it, and say so in the answer.
Worked example · Making predictions
The regression equation \(\hat y=45.96+5.34x\) models exam score from hours studied (\(x\) from 1 to 8). Predict the score for 3.5 hours and for 5.5 hours, and comment on reliability.
For 3.5 hours: \(\hat y=45.96+5.34(3.5)\approx64.6\) (the unrounded coefficients 45.957 and 5.3355 give 64.63). For 5.5 hours: \(\hat y=45.96+5.34(5.5)=75.3\). Both \(x\)-values are within the range of the data (1 to 8 hours), so these are interpolations and are reasonably reliable.
Worked example · Extrapolation
Use the same equation to predict the score for a student who studies 0 hours and for one who studies 12 hours. Are the predictions reliable?
For 0 hours: \(\hat y=45.96\); for 12 hours: \(\hat y=45.96+5.34(12)=110.0\). Both \(x\)-values are outside the interval from 1 to 8 hours that the line was based on, so these are extrapolations. The 12-hour prediction is above the maximum possible score, which shows that the linear pattern cannot continue; the 0-hour prediction is closer to the data and probably more reasonable but still not guaranteed to be reliable.
Worked example · Using a model in context
A real-estate agent finds that for homes in one neighborhood, \(\hat y=45+0.12x\), where \(x\) is the area in square feet and \(\hat y\) is the predicted price in thousands of dollars (areas in the data ran from 900 to 2,600 square feet). Predict the price of a 1,500 square foot home and say whether to trust a prediction for 6,000 square feet.
For 1,500 square feet: \(\hat y=45+0.12(1500)=225\), a predicted price of about \$225,000 (interpolation). For 6,000 square feet the prediction would be \(45+0.12(6000)=765\) thousand dollars, but 6,000 is far outside the data (900 to 2,600), so it is a large extrapolation and should not be trusted: very large homes may be priced by different rules.
Worked example · Is a line appropriate?
A student fits a line to data on the height of a plant over 20 weeks, where growth speeds up and then levels off. Is the linear regression model appropriate?
The relationship is curved, not linear, so a linear model should not be fit to the data (and an \(r\) value would be misleading). A linear regression model should only be used if the scatterplot shows a linear trend.
Interpolation: predicting within the range of the \(x\)-values used to find the line; reasonably reliable if the model is appropriate.
Extrapolation: predicting outside that range; less reliable the farther away. Always identify it.
Fit a line only if the scatterplot shows a linear trend.
Practice
The regression equation \(\hat y=12.5+2.8x\) predicts weight (kg) from age (years, data from 4 to 10). Predict the weight at age 7 and say whether it is interpolation or extrapolation.
Show answer
\(\hat y=12.5+2.8(7)=32.1\) kg. Age 7 is within the data range (4 to 10), so this is interpolation.
For the equation in the previous problem, a student predicts the weight of a 30-year-old. Evaluate.
Show answer
\(\hat y=12.5+2.8(30)=96.5\) kg. Age 30 is far outside the range of the data (4 to 10), so this is extrapolation and is not reliable: children's growth does not continue linearly into adulthood.
What is the difference between \(y\) and \(\hat y\)?
Show answer
\(y\) is the actual observed response for an individual; \(\hat y\) is the response predicted by the regression model for that individual's \(x\)-value. They are generally not equal.
In \(\hat y=45.96+5.34x\), what is the predicted score for 6 hours of study?
Show answer
A scatterplot shows a clear curved pattern. A student fits a regression line anyway. Why is this a problem?
Show answer
The line will systematically over- and underpredict in different parts of the data, and predictions will be poor. A linear model should only be fit when the scatterplot shows a linear trend.
Why is extrapolation less reliable than interpolation?
Show answer
Within the range of the data we have evidence that the linear pattern holds. Beyond it we have no data, and the relationship may change (for example, flatten out or reverse), so the predicted value may be far off.
A regression line never passes through every point. The vertical distance between a point and the line, the residual, measures how far the model's prediction is from reality for that individual. Residuals tell us how well the line predicts and, when plotted, whether a linear model is appropriate at all.
Required content · 5.4.A, 5.4.B, 5.4.C
Learning objectives.
5.4.A. Calculate the differences between the observed and predicted values.
5.4.B. Interpret the differences between the observed and predicted values.
5.4.C. Describe the form of association of bivariate data using residual plots.
Essential knowledge.
5.4.A.1. A residual is the difference between the observed response value and the predicted response value for the given value of the explanatory variable: residual \(=y-\hat y\) (residual = observed \(y\) − predicted \(y\)).
5.4.B.1. If the residual is positive, the model underpredicts (underestimates) the value of the response variable. If the residual is negative, the model overpredicts (overestimates) the value of the response variable.
5.4.C.1. A residual plot is a scatterplot of the residuals versus the predicted response values (or the explanatory variable values).
5.4.C.2. Residual plots can be used to investigate the appropriateness of the linear regression model for the observed data.
5.4.C.3. The linear regression model should only be fit to the data if the data exhibit a linear trend. Apparent randomness in a residual plot for a linear regression model is confirmation of a linear form in the association between the two variables and indicates that the simple linear regression model is an appropriate model for the data.
5.4.C.4. Curvature in the residual plot for a linear regression model suggests that the linear model is not the most appropriate model for the data.
Residuals
A residual is the difference between the observed response value and the predicted response value for a given value of the explanatory variable: \[\text{residual}=y-\hat y\qquad(\text{observed }y\text{ minus predicted }y).\] - If the residual is positive, the observed value is above the line: the model underpredicts (underestimates) the response. - If the residual is negative, the observed value is below the line: the model overpredicts (overestimates) the response.
Figure 5.6. A residual is the observed value minus the predicted value, \(y-\hat y\). Points above the line have positive residuals (the line underpredicts) and points below the line have negative residuals (the line overpredicts).
The student who studied 4.5 hours scored 73. The line (with unrounded coefficients 45.957 and 5.3355) predicts \(\hat y=69.97\), so the residual is \(73-69.97=+3.03\): the model underpredicted this student's score by about 3 points. The residuals for the ten students are \(0.71, 1.37, -4.30, 2.04, -1.30, 3.03, -2.64, 1.03, 0.69, -0.64\), which sum to 0 (the residuals of a least-squares line always sum to zero).
Residual plots
A residual plot is a scatterplot of the residuals versus the predicted response values (or versus the explanatory variable values). It is used to investigate the appropriateness of the linear regression model for the observed data.
Apparent randomness in the residual plot, with points scattered about the horizontal line at 0 with no pattern, is confirmation of a linear form in the association and indicates that the simple linear regression model is appropriate.
Curvature (or another pattern) in the residual plot suggests that the linear model is not the most appropriate model for the data.
The linear regression model should be fit only if the data exhibit a linear trend.
Figure 5.7. A residual plot graphs the residuals against the explanatory variable (or the predicted values). Apparent randomness around the horizontal line at 0 supports a linear model; a curved pattern in the residuals suggests that the linear model is not the most appropriate.
Worked example · Computing and interpreting a residual
For the study-time line \(\hat y=45.96+5.34x\), a student who studied 2.5 hours scored 55. Find and interpret the residual.
With the unrounded coefficients, \(\hat y=45.957+5.3355(2.5)=59.30\). The residual is \(y-\hat y=55-59.30=-4.30\). The residual is negative, so the model overpredicted: the student scored about 4.3 points lower than the line predicted for 2.5 hours of study.
Worked example · Which direction?
A residual is \(+6.2\) for one data point and \(-3.1\) for another. Describe where each point lies relative to the line and what each says about the model's prediction.
The point with residual \(+6.2\) lies 6.2 units above the line: the observed value is greater than predicted, so the model underpredicts it. The point with residual \(-3.1\) lies 3.1 units below the line: the observed value is less than predicted, so the model overpredicts it.
Worked example · Reading a residual plot
Ten points have residuals that go: \(-9.7,\,-2.9,\,2.9,\,5.7,\,7.4,\,6.2,\,3.0,\,-2.2,\,-10.4\) as \(x\) increases (a hump). What does the pattern say?
The residuals follow a clear curve: negative at both ends and positive in the middle. This pattern means the linear model overpredicts at the small and large \(x\)-values and underpredicts in the middle, so the relationship is curved and a straight line is not the most appropriate model. (These are the residuals for the thrown ball data, which had a correlation of only 0.09.)
Worked example · Randomness in a residual plot
The residual plot for the study-time data shows points scattered above and below 0 with no pattern. What can be concluded?
The apparent randomness supports the claim that the relationship is linear, so the simple linear regression model is appropriate for these data. (No pattern in the residuals does not prove linearity, but it is the evidence we check.)
Exam focus
Residual \(=y-\hat y\) (observed minus predicted). Positive residual: model underpredicts; negative: overpredicts.
Residual plot: residuals versus predicted (or \(x\)) values. Random scatter about 0: linear model appropriate. Curvature or other pattern: linear model not the most appropriate.
Always interpret a residual in context, with units and direction.
Practice
The line \(\hat y=12.5+2.8x\) predicts weight (kg) from age. A 6-year-old weighs 28.0 kg. Find and interpret the residual.
Show answer
\(\hat y=12.5+2.8(6)=29.3\). Residual \(=28.0-29.3=-1.3\). The model overpredicted the child's weight by 1.3 kg.
A residual plot shows a funnel shape: residuals close to 0 for small \(x\) and widely spread for large \(x\). What does this mean for predictions?
Show answer
The size of the prediction errors increases with \(x\): predictions are less precise for large \(x\)-values, which is a pattern that a simple linear model does not account for.
What does it mean if a residual equals 0?
Show answer
The observed value equals the predicted value, so the point lies exactly on the regression line.
Why do residuals for a least-squares line sum to 0?
Show answer
The least-squares line balances the points: the sum of the vertical distances above the line equals the sum below, because the line passes through \((\bar x,\bar y)\) and minimizes the squared deviations.
A residual plot shows a clear U shape. Should the linear regression model be used?
Show answer
No. The U shape (curvature) suggests that the relationship is not linear and that the linear model is not the most appropriate model for the data.
A student's residual is \(+8\) points in the exam-score model. Write a sentence interpreting it.
Show answer
The student scored 8 points higher than the model predicted from the hours studied; the model underpredicted this student's score.
Many lines could be drawn through a cloud of points. The least-squares regression line is the one that fits best by a specific, objective criterion. This lesson explains that criterion, what the slope, intercept, \(r\) and \(r^2\) mean, and how to interpret each in context, which is the heart of every regression question on the AP exam.
Required content · 5.5.A, 5.5.B
Learning objectives.
5.5.A. Calculate the coefficients for the least-squares regression line model.
5.5.B. Interpret coefficients for the least-squares regression line model.
Essential knowledge.
5.5.A.1. The simple linear regression model is fit to the data by minimizing the sum of the squares of the residuals. Because of this, the resulting equation is often called the least-squares regression line (LSRL) and is calculated using technology. This regression line will pass through the point \((\bar x,\bar y)\).
5.5.A.2. The slope of the regression line, b, is calculated using technology.
5.5.A.3. The y-intercept of the regression line, a, is calculated using technology.
5.5.A.4. In simple linear regression, the correlation coefficient, r, is calculated using technology.
5.5.A.5. In simple linear regression, the square of the correlation coefficient, \(r^2\), is called the coefficient of determination. The value of \(r^2\) is the proportion of variation in the response variable that is explained by the linear relationship with the explanatory variable.
5.5.B.1. The coefficients of the least-squares regression line model (line of best fit) are the slope, b, and the y-intercept, a, because they are based on a sample of values.
5.5.B.2. The slope of the least-squares regression line can be interpreted as the predicted increase or decrease in the response variable for a one- unit increase in the explanatory variable, and it should be interpreted in context.
5.5.B.3. The y-intercept in the least-squares regression line is the predicted value of the response variable when the explanatory variable is equal to 0, and it should be interpreted in context. Sometimes, the y-intercept of the line does not have a reasonable interpretation in context because x = 0 might be beyond the interval of x-values used to determine the regression line (extrapolation). At other times, the y-intercept of the line does not have a logical interpretation in context because it might be a negative value for a response variable that has no negative values, such as height.
The least-squares criterion
The simple linear regression model is fit to the data by minimizing the sum of the squares of the residuals. Because of this, the resulting line is called the least-squares regression line (LSRL). Its coefficients are calculated with technology, and the line always passes through the point \((\bar x,\bar y)\), the means of the two variables.
Figure 5.8. The least-squares regression line is the line that minimizes the sum of the squares of the residuals (the sum is shown in each panel). For these data it has a smaller sum of squared residuals (44.8) than another reasonable-looking line, \(\hat y=50+4.5x\) (78.6).
In the figure the least-squares line has a sum of squared residuals of 44.8, while a reasonable-looking alternative line, \(\hat y=50+4.5x\), has a sum of 78.6. No other line has a smaller sum than the least-squares line does.
The coefficients and \(r\)
The slope \(b\), the \(y\)-intercept \(a\) and the correlation \(r\) of a simple linear regression are calculated with technology (`STAT` > `CALC` > `8:LinReg(a+bx)` with `Diagnostics` on). They are related by \(b=r\dfrac{s_y}{s_x}\) and \(a=\bar y-b\bar x\). The values \(a\) and \(b\) are coefficients of the model; because they are based on a sample of values, they are estimates.
For the study-time data (\(\bar x=4.3\) hours, \(\bar y=68.9\) points, \(s_x=2.25\), \(s_y=12.22\)): \(r=0.983\), \(b=0.983\cdot\dfrac{12.22}{2.25}=5.34\), \(a=68.9-5.34(4.3)=45.96\), so \(\hat y=45.96+5.34x\).
Interpreting the slope and intercept
The slope can be interpreted as the predicted increase or decrease in the response variable for a one-unit increase in the explanatory variable, in context. Here: "For each additional hour studied, the predicted exam score increases by about 5.34 points."
The \(y\)-intercept is the predicted value of the response when the explanatory variable is 0, in context. Here: "A student who studies 0 hours is predicted to score about 45.96." Sometimes the intercept has no reasonable interpretation: \(x=0\) may be outside the range of \(x\)-values used to find the line (extrapolation), or the predicted value may be impossible (for example a negative weight).
The coefficient of determination
In simple linear regression, the square of the correlation coefficient, \(r^2\), is called the coefficient of determination. The value of \(r^2\) is the proportion of the variation in the response variable that is explained by the linear relationship with the explanatory variable. For the study data, \(r^2=0.983^2=0.967\): "About 96.7% of the variation in exam scores is explained by the linear relationship with hours studied." The remaining 3.3% is unexplained variation (the scatter of the residuals).
Worked example · Interpreting the slope and intercept
A regression of the price of used cars (in thousands of dollars) on age (years, from 1 to 9) gives \(\hat y=24.5-1.9x\) with \(r=-0.94\). Interpret the slope, the intercept and \(r^2\).
Slope: for each additional year of age, the predicted price decreases by about \$1,900 (1.9 thousand dollars). Intercept: a car of age 0 (new) is predicted to cost about \$24,500; this is just outside the range of the data (ages 1 to 9), so it is a slight extrapolation, but it is a reasonable value. \(r^2\): \(r^2=(-0.94)^2=0.884\), so about 88.4% of the variation in used car prices is explained by the linear relationship with age.
Worked example · A meaningless intercept
A regression of weight (pounds) on height (inches, from 60 to 75) gives \(\hat y=-120+4.2x\). Interpret the intercept.
The intercept says that a person with a height of 0 inches is predicted to weigh \(-120\) pounds. This has no meaning: a height of 0 is far outside the data (60 to 75) and a negative weight is impossible. The intercept is needed to position the line, but it should not be interpreted as a prediction here. The slope says that each additional inch of height is associated with a predicted 4.2 pound increase in weight.
Worked example · Computing the slope from summary statistics
For a data set, \(\bar x=10\), \(s_x=2\), \(\bar y=50\), \(s_y=8\), \(r=0.75\). Find the least-squares line and the predicted \(y\) for \(x=12\).
\(b=r\dfrac{s_y}{s_x}=0.75\cdot\dfrac{8}{2}=3\). \(a=\bar y-b\bar x=50-3(10)=20\). So \(\hat y=20+3x\), and for \(x=12\), \(\hat y=20+3(12)=56\). (Check: the line passes through \((\bar x,\bar y)=(10,50)\): \(20+3(10)=50\).)
Worked example · Interpreting r-squared carefully
A student writes "\(r^2=0.967\) means that 96.7% of the students scored as the line predicted." What is wrong?
\(r^2\) is not about the percentage of points on the line (very few points lie exactly on it). It is the proportion of the variation in exam scores that is explained by the linear relationship with hours studied: the line accounts for 96.7% of the variability in the response, and 3.3% is left unexplained.
Calculator
TI-84: turn on diagnostics once (`2nd` `0` (CATALOG) > `DiagnosticOn`). Enter \(x\) in `L1` and \(y\) in `L2`, then `STAT` > `CALC` > `8:LinReg(a+bx)` `L1, L2`. The output gives \(a\), \(b\), \(r^2\) and \(r\). Write the equation with variable names in context, for example \(\widehat{\text{score}}=45.96+5.34(\text{hours})\).
Exam focus
Least squares: the line that minimizes the sum of the squares of the residuals; it passes through \((\bar x,\bar y)\); \(b=r\,s_y/s_x\), \(a=\bar y-b\bar x\).
Slope: for each one-unit increase in \(x\), the predicted \(y\) increases (or decreases) by \(b\), in context.
Intercept: the predicted \(y\) when \(x=0\), in context; often outside the data (extrapolation) or meaningless.
\(r^2\): the proportion of the variation in \(y\) that is explained by the linear relationship with \(x\).
Practice
The least-squares line for predicting a student's weight (lb) from height (in) is \(\hat y=-120+4.2x\). Predict the weight at 70 inches and interpret the slope.
Show answer
\(\hat y=-120+4.2(70)=174\) lb. For each additional inch of height, the predicted weight increases by about 4.2 pounds.
For the study-time data, \(r^2=0.967\). Interpret it in context.
Show answer
About 96.7% of the variation in exam scores is explained by the linear relationship with hours studied.
A regression of fuel economy (mpg) on car weight (thousands of lb, 2 to 5) is \(\hat y=47-6x\) with \(r=-0.91\). Interpret the slope and the intercept, and give \(r^2\).
Show answer
Slope: each additional 1,000 lb of weight is associated with a predicted decrease of 6 mpg. Intercept: a car weighing 0 pounds would be predicted to get 47 mpg, which is meaningless (far outside the data and physically impossible). \(r^2=0.828\): about 82.8% of the variation in fuel economy is explained by the linear relationship with weight.
If \(\bar x=8\), \(\bar y=30\), \(s_x=3\), \(s_y=9\), \(r=-0.6\), find the least-squares line.
Show answer
A regression of test score on study time gives \(r=0.6\). A student says "study time explains 60% of the variation in the score." Correct the statement.
Show answer
The proportion explained is \(r^2=0.36\), so about 36% of the variation in scores is explained by the linear relationship with study time, not 60%.
Why is the least-squares line called "least squares," and why are the residuals squared?
Show answer
The line minimizes the sum of the squares of the residuals. Squaring makes all the terms positive so positive and negative residuals do not cancel, and it penalizes large residuals more heavily.
Unit 5 practice · 10 problems
Unit 5 practice: Regression Analysis
Ten problems covering the whole unit: three multiple-choice questions in the style of Section I and seven free-response problems. Interpret every number in context, with units.
Eight students recorded the number of weekly practice sessions \(x\) (1, 2, 3, 4, 5, 6, 7, 8) and their typing speed improvement \(y\) in words per minute (2, 3, 5, 4, 6, 8, 7, 9). Describe the association in a scatterplot of the data, and use a calculator to find the least-squares line, \(r\) and \(r^2\).
Show answer
The scatterplot shows a positive, linear, strong association with no unusual points: more practice sessions go with larger improvements. The calculator gives \(\hat y=1.214+0.952x\), \(r=0.952\) and \(r^2=0.907\) (LinReg(a+bx) with DiagnosticOn).
Which of the following is a true statement about the correlation coefficient \(r\)?
\(r\) has no units; it is computed from standardized values.
A single outlier can change \(r\) dramatically; it is not resistant.
\(r\) is unit-free, so changing the units of either variable does not change it.
The proportion of variation explained is \(r^2\), which is \(0.81\) here.
For the data in the first problem, predict the typing improvement for 5 sessions and for 12 sessions. Which prediction is more trustworthy, and why?
Show answer
For 5 sessions: \(\hat y=1.214+0.952(5)=5.98\) words per minute. For 12 sessions: \(\hat y=1.214+0.952(12)=12.64\) words per minute. The first is interpolation (5 is within the range 1 to 8 of the data) and is reasonably reliable. The second is extrapolation (12 is outside the range), so it is much less reliable: there is no evidence that the linear pattern continues.
For the data in the first problem, a student with 4 practice sessions improved by 4 words per minute. Find and interpret the residual.
Show answer
\(\hat y=1.214+0.952(4)=5.02\). Residual \(=y-\hat y=4-5.02=-1.02\). The residual is negative: the model overpredicted, since this student's improvement was about 1.0 word per minute less than the line predicts for 4 sessions.
For one data set, \(\bar x=10\), \(s_x=2\), \(\bar y=50\), \(s_y=8\) and \(r=0.75\). Find the least-squares regression line and the predicted \(y\) for \(x=12\).
Show answer
\(b=r\dfrac{s_y}{s_x}=0.75\cdot\dfrac82=3\) and \(a=\bar y-b\bar x=50-3(10)=20\), so \(\hat y=20+3x\). For \(x=12\), \(\hat y=20+3(12)=56\). (The line passes through \((\bar x,\bar y)=(10,50)\): \(20+3(10)=50\).)
The least-squares line for predicting the price (thousands of dollars) of a used car from its age (years) is \(\hat y=24.5-1.9x\). Which is the correct interpretation of the slope?
The model gives predicted values for cars in general; it does not say that every individual car loses exactly that amount.
The slope is the predicted change in the response for a one-unit increase in the explanatory variable: 1.9 thousand dollars less per year of age.
A new car corresponds to the intercept, \(x=0\): the predicted price is about \$24,500.
The slope is not the correlation; \(r\) is always between \(-1\) and 1.
For the car-price line \(\hat y=24.5-1.9x\) (ages in the data range from 1 to 9 years) \(r=-0.94\). Interpret the intercept and \(r^2\) in context, and say whether the intercept is a reasonable prediction.
Show answer
The intercept: a car of age 0 (a new car) is predicted to cost about \$24,500. Age 0 is just outside the data (1 to 9 years), so this is a small extrapolation, but it is a plausible price. \(r^2=(-0.94)^2=0.884\): about 88.4% of the variation in used car prices is explained by the linear relationship with age.
The residual plot for a least-squares line shows a clear U-shaped pattern. What does that indicate?
Apparent randomness in the residual plot supports a linear model; a pattern does the opposite.
Curvature in the residual plot suggests that the linear model is not the most appropriate for the data.
A pattern in the residuals says nothing about \(r\) being close to 1; a curved relationship can have any \(r\).
A U shape involves many points, not a single outlier.
The height of a ball thrown upward is measured every second for 9 seconds, giving the heights 2, 9, 15, 18, 20, 19, 16, 11 and 3 meters. The correlation between time and height is \(r=0.09\). (a) Is a linear regression model appropriate? (b) What would a residual plot for the least-squares line look like?
Show answer
(a) No. The scatterplot shows a clear curved (parabolic) pattern: the ball rises and then falls. The small correlation says there is almost no linear association, but there is a very strong nonlinear relationship, so a linear model should not be fit. (b) The residuals would show a clear curved pattern (negative at both ends and positive in the middle, a hump) rather than random scatter, confirming that the linear model is not appropriate.
A study finds a correlation of \(r=0.78\) between the number of firefighters sent to a fire and the dollar amount of damage. A councilmember says sending fewer firefighters would reduce damage costs. Evaluate the claim.
Show answer
The claim confuses correlation with causation. The strong positive correlation is explained by a lurking variable, the size of the fire: bigger fires cause more damage and also lead to more firefighters being sent. Sending fewer firefighters would not reduce damage, and might increase it. Only a well-designed experiment could show whether the number of firefighters affects the damage.
Unit recap
Unit recap
0:00 / 0:00
Animated recap with on-screen narration. Turn on Voice to
have it read aloud (uses your device's built-in voice). Pressing play
counts as your one free video.
Free preview complete
That's the end of the free preview.
You've opened five lessons, which is
as much as we can show without a subscription. Everything you've
already opened stays available; use the outline on the left to go
back to it.