Expected Value The concept of expected value allows us to analyze games that involve randomness, like Roulette. (credit: “Roulette Table and Roulette Wheel in a Casino with People betting on numbers” by Marco Verch/Flickr, CC BY 2.0) Learning Objectives After completing this section, you should be able to: Calculate the expected value of an experiment. Interpret the expected value of an experiment. Use expected value to analyze applications. The casino game roulette has dozens of different bets that can be made. These bets have different probabilities of winning but also have different payouts. In general, the lower the probability of winning a bet is, the more money a player wins for that bet. With so many options, is there one bet that’s “smarter” than the rest? What’s the best play to make at a roulette table? In this section, we’ll develop the tools we need to answer these questions. Expected Value Many experiments have numbers associated with their outcomes. Some are easy to define; if you roll 2 dice, the sum of the numbers showing is a good example. In some card games, cards have different point values associated with them; for example, in some forms of the game rummy, aces are worth 15 points; 10s, jacks, queens, and kings are worth 10; and all other cards are worth 5. The outcomes of casino and lottery games are all associated with an amount of money won or lost. These outcome values are used to find the expected value of an experiment: the mean of the values associated with the outcomes that we would observe over a large number of repetitions of the experiment. (See Conditional Probability and the Multiplication Rule for more on means.) That definition is a little vague; How many is “a large number?” In practice, it depends on the experiment; the number has to be large enough that every outcome would be expected to appear at least a few times. For example, if we’re talking about rolling a standard 6-sided die and we note the number showing, a few dozen replications should be enough that the mean would be representative. Since the probability of each outcome is 1 6 , we would expect to see each outcome about 8 times over the course of 48 replications. However, if we’re talking about the Powerball lottery, where the probability of winning the jackpot is about 1 292 , 000 , 000 , we would need several billion replications to ensure that every outcome appears a few times. Luckily, we can find the theoretical expected value before we even run the experiment the first time. Expected Value: If O represents an outcome of an experiment and n ( O ) represents the value of that outcome, then the expected value of the experiment is: ∑ n ( O ) × P ( O ) , where Σ is the “sum,” meaning we add up the results of the formula that follows over all possible outcomes. Finding Expected Values Find the expected values of the following experiments. Roll a standard 6-sided die and note the number showing. Roll two standard 6-sided dice and note the sum of the numbers showing. Draw a card from a well-shuffled standard deck of cards and note its rummy value (15 for aces; 10 for tens, jacks, queens, and kings; 5 for everything else). Step 1: Let’s start by writing out the PDF table for this experiment. Value Probability 1 1 6 2 1 6 3 1 6 4 1 6 5 1 6 6 1 6 Step 2: To find the expected value, we need to find n ( O ) × P ( O ) for each possible outcome in the table below. Value Probability n ( O ) × P ( O ) 1 1 6 1 × 1 6 = 1 6 2 1 6 2 × 1 6 = 1 3 3 1 6 3 × 1 6 = 1 2 4 1 6 4 × 1 6 = 2 3 5 1 6 5 × 1 6 = 5 6 6 1 6 6 × 1 6 = 1 Step 3: We add all of the values in that last column: 1 6 + 1 3 + 1 2 + 2 3 + 5 6 + 1 = 7 2 = 3.5 . So, the expected value of a single roll of a die is 3.5. Back in , we made this table of all of the equally likely outcomes ( ): Step 1: Let’s use to create the PDF for this experiment, as shown in the following table: Value Probability 2 1 36 3 1 18 4 1 12 5 1 9 6 5 36 7 1 6 8 5 36 9 1 9 10 1 12 11 1 18 12 1 36 Step 2: We can multiply each row to find n ( O ) × P ( O ) as shown in the following table: Value Probability n ( O ) × P ( O ) 2 1 36 1 18 3 1 18 1 6 4 1 12 1 3 5 1 9 5 9 6 5 36 5 6 7 1 6 7 6 8 5 36 10 9 9 1 9 1 10 1 12 5 6 11 1 18 11 18 12 1 36 1 3 Step 3: We can add the last column to get the expected value: 1 18 + 1 6 + 1 3 + 5 9 + 5 6 + 7 6 + 10 9 + 1 + 5 6 + 11 18 + 1 3 = 7 . So, the expected value is 7. Step 1: Let’s make a PDF table for this experiment. There are 3 events that we care about, so let’s use those events in the table below: Event Probability {A} 1 13 {10, J, Q, K} 4 13 {2, 3, 4, 5, 6, 7, 8, 9} 8 13 Step 2: Let’s add a column to the following table for the values of each event: Event Probability Value {A} 1 13 15 {10, J, Q, K} 4 13 10 {2, 3, 4, 5, 6, 7, 8, 9} 8 13 5 Step 3: We’ll add the column for the product of the values and probabilities to the table below: Event Probability Value n ( O ) × P ( O ) {A} 1 13 15 15 13 {10, J, Q, K} 4 13 10 40 13 {2, 3, 4, 5, 6, 7, 8, 9} 8 13 5 40 13 Step 4: We’ll find the sum of the last column: 15 13 + 40 13 + 40 13 = 95 13 ≈ 7.3 . Thus, the expected Rummy value of a randomly selected card is about 7.3. Let’s make note of some things we can learn from . First, as Exercises 1 and 3 demonstrate, the expected value of an experiment might not be a value that could come up in the experiment. Remember that the expected value is interpreted as a mean, and the mean of a collection of numbers doesn’t have to actually be one of those numbers. Second, looking at Exercise 1, the expected value (3.5) was just the mean of the numbers on the faces of the die: 1 + 2 + 3 + 4 + 5 + 6 6 = 3.5 . This is no accident! If we break that fraction up using the addition in the numerator, we get 1 6 + 2 6 + 3 6 + 4 6 + 5 6 + 6 6 , which we can rewrite as 1 × 1 6 + 2 × 1 6 + 3 × 1 6 + 4 × 1 6 + 5 × 1 6 + 6 × 1 6 . That’s exactly the computation we did to find the expected value! In fact, expected values can always be treated as a special kind of mean called a weighted mean , where the weights are the probabilities associated with each value. When the probabilities are all equal, the weighted mean is just the regular mean. Interpreting Expected Values As we noted, the expected value of an experiment is the mean of the values we would observe if we repeated the experiment a large number of times. (This interpretation is due to an important theorem in the theory of probability called the Law of Large Numbers.) Let’s use that to interpret the results of the previous example . Interpreting Expected Values Interpret the expected values of the following experiments. Roll a standard 6-sided die and note the number showing. Roll 2 standard 6-sided dice and note the sum of the numbers showing. Draw a card from a well-shuffled standard deck of cards and note its Rummy value (15 for aces; 10 for tens, jacks, queens, and kings; 5 for everything else). If you roll a standard 6-sided die many times, the mean of the numbers you roll will be around 3.5. If you roll a pair of standard 6-sided dice many times, the mean of the sums of the numbers you roll will be about 7. If you draw a card from a well-shuffled deck many times, the mean of the Rummy values of the cards would be around 7.3. Pascal’s Wager The French scholar Blaise Pascal (1623–1662) was among the earliest mathematicians to study probabilities, and was the first to accurately describe and compute expected values. In his book Pensées ( Thoughts ), he turned the analysis of expected values to his belief in the Christian God. He said that there is no way for people to establish the probability that God exists, but since the “winnings” on a bet that God exists (and that you then lead your life accordingly) are essentially infinite, the expected value of taking that bet is always positive, no matter how unlikely it is that God exists. Using Expected Value Now that we know how to find and interpret expected values, we can turn our attention to using them. Suppose someone offers to play a game with you. If you roll a die and get a 6, you get $10. However, if you get a 5 or below, you lose $1. Is this a game you’d want to play? Let’s look at the expected value: The probability of winning is 1 6 and the probability of losing is 5 6 , so the expected value is $ 10 × 1 6 + ( − $ 1 ) × 5 6 = 5 6 ≈ $ 0.83 . That means, on average, you’ll come out ahead by about 83 cents every time you play this game. It’s a great deal! On the other hand, if the winnings for rolling a 6 drop to $3, the expected value becomes $ 3 × 1 6 + ( − $ 1 ) × 5 6 = − 1 3 ≈ − $ 0.33 , meaning you should expect to lose about 33 cents on average for every time you play. Playing that game is not a good idea! In general, this is how casinos and lottery corporations make money: Every game has a negative expected value for the player. Expected Values in Football In the 21st century, data analytics tools have revolutionized the way sports are coached and played. One tool in particular is used in football at crucial moments in the game. When a team faces a fourth down (the last possession in a series of four possessions, a fairly common occurrence), the coach faces a decision: Run one play to try to gain a certain number of yards, or kick the ball away to the other team. Here’s the interesting part of the decision: If the team “goes for it” and runs the play and they are successful, then they keep possession of the ball and can continue in their quest to score more points. If they are unsuccessful, then they lose possession of the ball, giving the other team an opportunity to score points. If, instead, the team punts, or kicks the ball away, then the other team gets possession of the ball, but in a worse position for them than if the original team goes for it and fails. To analyze this situation, data analysts have generated empirical probabilities for every fourth down situation, and computed the expected value (in terms of points) for each decision. Coaches frequently use those calculations when they decide which option to take! Pierre de Fermat and Blaise Pascal In 1654, a French writer and amateur mathematician named Antoine Gombaud (who called himself the Chevalier du Mére) reached out to his gambling buddy Blaise Pascal to answer a question that he’d read about called the “problem of points.” The question goes like this: Suppose you’re playing a game that is scored using points, and the first person to earn 5 points is the winner. The game is interrupted with the score 4 points to 2. If the winner stood to win $100, how should the prize money be divided between the players? Certainly the person who is 1 point away from victory should get more, but how much more? We have developed tools in this section to answer this question. At its heart, it’s a question about conditional probabilities and expected value. At the time that Pascal first started thinking about it, though, those ideas hadn’t yet been invented. Pascal reached out to a colleague named Pierre de Fermat, and over the course of a couple of months, their correspondence with each other would eventually solve the problem. In the process, they first described conditional probabilities and expected values! Apart from their work in probability, these men are famous for other work in mathematics (and, in Pascal’s case, philosophy and physics). Fermat is remembered for his work in geometry and in number theory. After his death, the statement of what came to be called “Fermat’s Last Theorem” was discovered scribbled in the margin of a book, with the note that Fermat had discovered a “marvelous proof that this margin is too small to contain.” The theorem says that any equation of the form a n + b n = c n has no positive integer solutions if n ≥ 3 . No proof of that theorem was discovered until 1994, when Andrew Wiles used computers and new branches of geometry to finally prove the theorem! Pascal is remembered for the “arithmetical triangle” that is named for him (though he wasn’t the first person to discover it; see the section on the binomial distribution for more), as well as work in geometry. In physics, Pascal worked on hydrodynamics and air pressure (the SI unit for pressure is named for him), and in philosophy, Pascal advocated for a mathematical approach to philosophical problems. Using Expected Values In the casino game keno, a machine chooses at random 20 numbers between 1 and 80 (inclusive) without replacement. Players try to predict which numbers will be chosen. Players don’t try to guess all 20, though; generally, they’ll try to predict between 1 and 10 of the chosen numbers. The amount won depends on the number of guesses they made and the number of guesses that were correct. At one casino, a player can try to guess just 1 number. If that number is among the 20 selected, the player wins $2; otherwise, the player loses $1. What is the expected value? At the same casino, if a player makes 2 guesses and they’re both correct, the player wins $14; otherwise, the player loses $1. What is the expected value? Players can also make 3 guesses. If 2 of the 3 guesses are correct, the player wins $1. If all 3 guesses are correct, the player wins $42. Otherwise, the player loses $1. What is the expected value? Which of these games is the best for the player? Which is the best for the casino? There are 20 winning numbers out of 80, so if we try to guess one of them, the probability of guessing correctly is 20 80 = 1 4 . The probability of losing is then 3 4 , and so the expected value is $ 2 × 1 4 + ( − $ 1 ) × 3 4 = − $ 0.25 . There are 20 C 2 = 190 winning choices out of 80 C 2 = 3 , 160 total ways to choose 2 numbers. So, the probability of winning is 190 3 , 160 and the probability of losing is 3 , 160 − 190 3 , 160 = 2 , 970 3 , 160 . So, the expected value of the game is $ 14 × 190 3 , 160 + ( − $ 1 ) × 2970 3160 ≈ − $ 0.10 . Step 1: Let’s start with the big prize. There are 20 C 3 = 1 , 140 ways to correctly guess 3 winning numbers out of 80 C 3 = 82 , 160 ways to guess three numbers total. That means the probability of winning the big prize is 1 , 140 82 , 160 ≈ 0.01388 . Step 2: Let’s find the probability of the second prize. The denominator is the same: 82,160. Let’s figure out the numerator. To win the second prize, the player must pick 2 of the 20 winning numbers and one of the 60 losing numbers. The number of ways to do that can be found using the Multiplication Rule for Counting: there are 20 C 2 = 190 ways to pick 2 winning numbers and 60 ways to pick 1 losing number, so there are 190 × 60 = 11 , 400 ways to win the second prize. So, the probability of winning that second prize is 11 , 400 82 , 160 ≈ 0.13875 . Step 3: Since the overall probability of winning is 1 , 140 82 , 160 + 11 , 400 82 , 160 = 12 , 540 82 , 160 ≈ 0.15263 , the probability of losing must be 1 − 0.15263 = 0.84737 . So, the expected value is $ 42 × 0.01388 + $ 1 × 0.13875 + ( − $ 1 ) × 0.84737 ≈ − $ 0.13 . The bet that’s the best for the player is the one with the highest expected value for the player, which is guessing two numbers. The best one for the casino is the one with the lowest expected value for the player, which is guessing one number. Make Your Own Lottery By yourself or with a partner, devise your own lottery scheme. Assume you would have access to one or more machines that choose numbers randomly. What will a lottery draw look like? How many numbers are players choosing from? How many will be drawn? Will they be drawn with replacement or without replacement? What conditions must be met for a player to win first or second (or more!) prize? Once you’ve decided that, decide the payoff structure for winners, and how much the game will cost to play. Try to make the game enticing enough that people will want to play it, but with enough negative expected value that the lottery will make money. Aim for the expected value to be about −0.25 times the cost of playing the game. Check Your Understanding Key Terms expected value Key Concepts The expected value of an experiment is the sum of the products of the numerical outcomes of an experiment with their corresponding probabilities. The expected value of an experiment is the most likely value of the average of a large number of replications of the experiment. Formulas If O represents an outcome of an experiment and n ( O ) represents the value of that outcome, then the expected value of the experiment is: ∑ n ( O ) × P ( O ) where Σ stands for the sum, meaning we add up the results of the formula that follows over all possible outcomes. Projects The Binomial Distribution is one of many examples of a discrete probability distribution . Other examples include the Geometric, Hypergeometric, Multinomial, Poisson, and Negative Binomial Distributions. Choose one of these distributions, and find out what makes it different from the Binomial Distribution. In what situations can it be applied? How is it used? Once you have an idea of how it’s used, write a series of five questions like the ones in this chapter that can be answered with that distribution, and find the answers. Binomial is a word that also comes up in algebra; the word describes polynomials with two terms. At first glance, there isn’t much to indicate that these two uses of the word are related, but it turns out there is a connection. Explore the connection between the Binomial Distribution and the algebraic concept of binomial expansion, (the process of multiplying out expressions like ( x + y ) n for a positive whole number n ). Search for a connection with the mathematical object known as Pascal’s Triangle. Hazard is a dice game that was mentioned in Chaucer’s Canterbury Tales . It was a popular game of chance played in taverns and coffee houses well into the 18th century; its popularity at the time of the foundation of probability theory means that it was a common example in early texts on finding expected values and probabilities. Find the rules of the game, and get some practice playing it. Then, analyze the choices that the caster gets to make, and decide which is most advantageous, using the language of expected values. Chapter Review The Multiplication Rule for Counting Permutations Combinations Tree Diagrams, Tables, and Outcomes Basic Concepts of Probability Probability with Permutations and Combinations What Are the Odds? The Addition Rule for Probability Conditional Probability and the Multiplication Rule The Binomial Distribution Expected Value Chapter Test

Math


Introduction Statistics can be used to decide on a fair salary for sports stars. (credit: “Jasmine Powell goes up for a shot in a game against Jacksonville” by Lorie Shaull/Flickr, CC BY 2.0) Before the 2021 WNBA season, professional basketball player Candace Parker signed a contract with the Chicago Sky, which entitled her to a salary of $190,000. This amount was the 23rd highest in the league at the time. How did the team’s management decide on her salary? They likely considered some intangible qualities, like her leadership skills. However, much of their deliberations probably took into account her performance on the court. For example, Parker led the league in rebounds in the 2020 season (214 of them) and scored 14.7 points per game (which ranked her 18th among all WNBA players). Further, Parker brought 13 seasons of experience to the team. All of these factors played a role in deciding the terms of her contract. Estimating the value of one variable (like salary) based on other, measurable variables (points per game, experience, rebounds, etc.) is among the most important applications of statistics, which is the mathematical field devoted to gathering, organizing, summarizing, and making decisions based on data.

Math


Gathering and Organizing Data Surveys are commonly used to gather data. (credit: “survey” by Donnell King/Flickr, CC0 1.0 Public Domain) Learning Objectives After completing this section, you should be able to: Distinguish among sampling techniques. Organize data using an appropriate method. Create frequency distributions. When a polling organization wants to try to establish which candidate will win an upcoming election, the first steps are to write questions for the survey and to choose which people will be asked to respond to the survey. These can seem like simple steps, but they have far-reaching implications in the analysis the pollsters will later carry out. The process by which samples (or groups of units from which we collect data) are chosen can strongly affect the data that are collected. Units are anything that can be measured or surveyed (such as people, animals, objectives, or experiments) and data are observations made on units. One of the most famous failures of good sampling occurred in the first half of the twentieth century. The Literary Digest was among the most respected magazines of the early twentieth century. Despite the name, the Digest was a weekly newsmagazine. Starting in 1916, the Digest conducted a poll to try to predict the winner of each US Presidential election. For the most part, their results were good; they correctly predicted the outcome of all five elections between 1916 and 1932. In 1936, the incumbent President Franklin Delano Roosevelt faced Kansas governor Alf Landon, and once again the Digest ran their famous poll, with results published the week before the election. Their conclusion? Landon would win in a landslide, 57% to 43%. Once the actual votes had been counted, though, Roosevelt ended up with 61% of the popular vote, 18% more than the poll predicted. What went wrong? The short answer is that the people who were chosen to receive the survey (over ten million of them!) were not a good representation of the population of voting adults. The sample was chosen using the Digest's own base of subscribers as well as publicly available lists of people that were likely adults (and therefore eligible to vote), mostly phone books and vehicle registration records. The pollsters then mailed every single person on these lists a survey. Around a quarter of those surveys were returned; this constituted the sample that was used to make the Digest ’s disastrously incorrect prediction. However, the Digest made an error in failing to consider that the election was happening during the Great Depression, and only the wealthy had disposable income to spend on telephone lines, automobiles, and magazine subscriptions. Thus, only the wealthy were sent the Digest ’s survey. Since Roosevelt was extremely popular among poorer voters, many of Roosevelt’s supporters were excluded from the Digest ’s sample. Another more complicated factor was the low response rate; only around 25% of the surveys were returned. This created what’s called a non-response bias. Sampling and Gathering Data The Digest's failure highlights the need for what is now considered the most important criterion for sampling: randomness. This randomness can be achieved in several ways. Here we cover some of the most common. A simple random sample is chosen in a way that every unit in the population has an equal chance of being selected, and the chances of a unit being selected do not depend on the units already chosen. An example of this is choosing a group of people by drawing names out of a hat (assuming the names are well-mixed in the hat). A systematic random sample is selected from an ordered list of the population (for example, names sorted alphabetically or students listed by student ID). First, we decide what proportion of the population will be in our sample. We want to express that proportion as a fraction with 1 in the numerator. Let’s call that number D . Next, we’ll choose a random number between one and D . The unit at that position will go into our sample. We’ll find the rest of our sample by choosing every D th unit in the list, starting with our random number. To walk through an example, let’s say we want to sample 2% of the population: 2 % = 2 100 = 1 50 . (Note: If the number in the denominator isn’t a whole number, we can just round it off. This part of the process doesn’t have to be precise.) We can then use a random number generator to find a random number between 1 and 50; let's use 31. In our example, our sample would then be the units in the list at positions 31, 81 (31 + 50), 131 (81 + 50), and so forth. A stratified sample is one chosen so that particular groups in the population are certain to be represented. Let’s say you are studying the population of students in a large high school (where the grades run from 9th to 12th), and you want to choose a sample of 12 students. If you use a simple or systematic random sample, there’s a pretty good chance that you’ll miss one grade completely. In a stratified sample, you would first divide the population into groups (the strata ), then take a random sample within each stratum (that’s the singular form of “strata”). In the high school example, we could divide the population into grades, then take a random sample of three students within each grade. That would get us to the 12 students we need while ensuring coverage of each grade. A cluster sample is a sample where clusters of units are chosen at random, instead of choosing individual units. For example, if we need a sample of college students, we may take a list of all the course sections being offered at the college, choose three of them at random (the sections are the clusters), and then survey all the students in those sections. A sample like this one has the advantage of convenience: If the survey needs to be administered in person, many of your sample units will be located in one place at the same time. Random Sampling For each of the following situations, identify whether the sample is a simple random sample, a systematic random sample, a stratified random sample, a cluster random sample, or none of these. A postal inspector wants to check on the performance of a new mail carrier, so she chooses four streets at random among those that the carrier serves. Each household on the selected streets receives a survey. A hospital wants to survey past patients to see if they were satisfied with the care they received. The administrator sorts the patients into groups based on the department of the hospital where they were treated (ICU, pediatrics, or general), and selects patients at random from each of those groups. A quality control engineer at a factory that makes smartphones wants to figure out the proportion of devices that are faulty before they are shipped out. The phones are currently packed in boxes for shipping, each of which holds 20 devices. The engineer wants to sample 100 phones, so he selects five crates at random and tests every phone in those five crates. A newspaper reporter wants to write a story on public perceptions on a project that will widen a congested street. She stands on the side of the street in question and interviews the first five people she sees there. An executive at a streaming video service wants to know if her subscribers would support a second season of a new show. She gets a list of all the subscribers who have watched at least one episode of the show, and uses a random number generator to select a sample of 50 people from the list. An agent for a state’s Department of Revenue is in charge of selecting 100 tax returns for audit. He has a list of all of the returns eligible for audit (about 12,000 in all), sorted by the taxpayer’s ID number. He asks a computer to give him a random number between 1 and 120; it gives him 15. The agent chooses the 15th, 135th, 255th, 375th, and every 120th return after that to be audited. To decide which type of random sample is being used in each of these, we need to focus on how the randomization is being incorporated. The surveys are being given to households, so households are the units in this case. But households aren’t being chosen randomly; instead, streets are being chosen at random. These form clusters of units, so this is a cluster random sample. In this case, the administrator isn’t selecting patients at random from the entire list of patients. Instead, she is choosing at random from the patients who were in each of the departments (ICU, pediatrics, general) separately. The departments form strata , so this is a stratified random sample. The engineer is testing whether the phones are faulty, so those are the units. But the random process is being used to select the crates of phones. Those crates form clusters, so this is a cluster random sample. The reporter isn’t using a random process at all, so this sample doesn’t belong to any of the types we have been talking about. A sample like this one is sometimes described as a convenience sample , and shouldn’t be used in a statistical setting. The executive is choosing her sample completely at random from the full population, so this is a simple random sample. The agent is choosing from the full population, but is only choosing the first unit for the sample at random; the rest are chosen by skipping down the list systematically. Thus, this is a systematic random sample. George Gallup George Gallup was a founder of survey sampling techniques, and his legacy lives on to this day. (credit: "George Gallup at the National Press Club, Washington, D.C., 1969" by Bernard Gotfryd/Library of Congress Prints & Photographs Division, public domain) George Gallup (1901–1984) rose to fame in 1936 when his prediction of the percentage of the vote going to each candidate in that year’s U.S. Presidential election was more accurate than the one published in Literary Digest , and he did so using a sample that was much smaller than the Digest . He even took it one step farther, predicting with high accuracy the erroneous results of the poll that the Literary Digest would end up publishing! Gallup’s theories on public opinion polling essentially created that field. In 1948, Gallup’s reputation took a bit of a hit, when he famously, but incorrectly, predicted that Thomas Dewey would beat incumbent Harry Truman in that year’s Presidential election. Over the following decades, however, public trust in Gallup’s polls recovered and even steadily increased. The company Gallup founded continues to conduct daily public opinion polls, as well as provides consulting services for businesses. Organizing Data Once data have been collected, we turn our attention to analysis. Before we analyze, though, it’s useful to reorganize the data into a format that makes the analysis easier. For example, if our data were collected using a paper survey, our raw data are all broken down by respondent (represented by an individual response sheet). To perform an analysis on all the responses to an individual question, we need to first group all the responses to each question together. The way we organize the data depends on the type of data we’ve collected. There are two broad types of data: categorical and quantitative. Categorical data classifies the unit into a group (or category). Examples of categorical data include a response to a yes-or-no question, or the color of a person’s eyes. Quantitative data is a numerical measure of a property of a unit. Examples of quantitative data include the time it takes for a rat to run through a maze or a person’s daily calorie intake. We’ll look at each type of data in turn when considering how best to organize. Categorical Data Organization The best way to organize categorical data is using a categorical frequency distribution . A categorical frequency distribution is a table with two columns. The first contains all the categories present in the data, each listed once. The second contains the frequencies of each category, which are just a count of how often each category appears in the data. Creating a Categorical Frequency Distribution A teacher records the responses of the class (28 students) on the first question of a multiple choice quiz, with five possible responses (A, B, C, D, and E): A A C A B B A E A C A A A C E A B A A C A B E E A A C C Create a categorical frequency distribution that organizes the responses. Step 1: For each possible response, count the number of times that response appears in the data. In the responses for this class, “A” appears 14 times, “B” 4 times, “C” 6 times, “D” 0 times, and “E” 4 times. Step 2: Make a table with two columns. The first column should be labeled so that the reader knows what the responses mean, and the second should be labeled “Frequency.” Response to First Question Frequency A 14 B 4 C 6 D 0 E 4 Step 3: Check your work. If you add up your frequencies, you should get the same number as the total number of responses. Twenty-eight students answered that first question, and 14 + 4 + 6 + 0 + 4 = 28 . Quantitative Data We have a couple of options available for organizing quantitative data. If there are just a few possible responses, we can create a frequency distribution just like the ones we made for categorical data above. For example, if we’re surveying a group of high school students and we ask for each student’s age, we’ll likely only get whole-number responses between 13 and 19. Since there are only around seven (and likely fewer) possible responses, we can treat the data as if they’re categorical and create a frequency distribution as before. Creating a Quantitative Frequency Distribution Attendees of a conflict resolution workshop are asked how many siblings they have. The responses are as follows: 1 0 1 1 2 0 3 1 1 4 1 2 0 1 3 1 2 1 2 4 1 0 1 3 0 1 2 2 1 5 Create a frequency distribution to organize the responses. Step 1: Count the number of times you see each unique response: “0” appears 5 times, “1” appears 13 times, “2” appears 6 times, “3” appears 3 times, “4” appears twice, and “5” appears once. Step 2: Make a table with two columns. The first column should be labeled so that the reader knows what the responses mean, and the second should be labeled “Frequency.” Then fill in the results of our count. Number of Siblings Frequency Number of Siblings Frequency 0 5 3 3 1 13 4 2 2 6 5 1 Step 3: Check your work. If you add up your counts, you should get the same number as the total number of responses. Looking back at the raw data, there were 30 responses, and 5 + 13 + 6 + 3 + 2 + 1 = 30 . If there are many possible responses, a frequency distribution table like the ones we’ve seen so far isn’t really useful; there will likely be many responses with a frequency of one, which means the table will be no better than looking at the raw data. In these cases, we can create a binned frequency distribution . A binned frequency distribution groups the data into ranges of values called bins , then records the number of responses in each bin. For example, if we have height data for individuals measured in centimeters, we might create bins like 150–155 cm, 155–160 cm, and so forth (making sure that every data value falls into a bin). We must be careful, though; in this scenario, it’s not clear which bin would contain a response of 155 cm. Usually, responses on the edge of a bin are placed in the higher bin, but it’s good practice to make that clear. In cases where responses are rounded off, you can avoid this issue by leaving a gap between the bins that couldn’t contain any responses. In our example, if the measurements were all rounded off to the nearest centimeter, we could make bins like 150–154 cm, 155–159 cm, etc. (since a response like 154.2 isn’t possible). We’ll use this method going forward. How do we decide what the boundaries of our bins should be? There’s no one right way to do that, but there are some guidelines that can be helpful. Every data value should fall into exactly one bin. For example, if the lowest value in our data is 42, the lowest bin should not be 45–49. Every bin should have the same width. Note that if we shift the upper limits of our bins down a bit to avoid ambiguity (like described above), we can’t simply subtract the lower limit from the upper limit to get the bin width; instead, we subtract the lower limit of the bin from the lower limit of the next bin. For example, if we’re looking at GPAs rounded to the nearest hundredth, we might choose bins like 2.00–2.24, 2.25–2.49, 2.50–2.74, etc. These bins all have a width of 0.25. If the minimum or maximum value of the data falls right on the boundary between two bins, then it’s OK to bend the rule just a little in order to avoid having an additional bin containing just that one value. We’ll see an example of this in just a moment. If we have too many or too few bins, it can be difficult to get a good sense of the distribution. Seven or eight bins is ideal, but that’s not a firm rule; anything between five and twelve is fine. We often choose the number of bins so that the widths are round numbers. Creating a Binned Frequency Distribution The GPAs of students enrolled in an advanced sociology class are listed in the following table. At this institution, 4.00 is the maximum possible GPA. 3.93 3.43 2.87 2.51 2.70 1.91 2.32 2.85 3.06 3.03 3.49 1.84 3.72 2.56 1.99 3.40 3.74 3.23 1.98 3.05 1.43 2.90 1.20 3.72 3.56 3.07 2.58 4.00 2.79 3.81 2.60 3.69 2.88 3.34 1.51 3.63 3.45 1.89 2.30 2.98 3.04 2.70 Create a binned frequency distribution for the data. Step 1: Identify the max and min values in your bins. Looking at the dataset, you can see that the lowest value is 1.20, and the highest is 4.00. Step 2: Get a rough idea of bin widths. Aim for seven or eight bins, give or take a couple. For eight bins, the minimum width can be found by taking the difference between the largest and smallest data values and dividing by the number of bins: maximum - minimum # of bins = 4.00 - 1.20 8 = 0.35 . If we use 0.35 for our widths, starting at our minimum value of 1.20, we’ll get bins with these boundaries: 1.20, 1.55, 1.90, 2.25, 2.60, 2.95, 3.30, 3.65, 4.00. Step 3: Consider the context of the values. Because these are GPAs, there are natural breaks at 2.00 and 3.00 that are important. (People like whole numbers!) Since 0.35 is very close to 1 3 , let’s use that for our bin width instead, and make sure that whole numbers fall on the boundaries. That means our first bin needs to start at 1.00 and go up to 1.33 to make sure our minimum value is included. The next bin will run from 1.34 to 1.66, and so forth. Step 4: Create the distribution table. We start our distribution table by filling in the bins: GPA Range Frequency GPA Range Frequency GPA Range Frequency 1.00–1.33 2.00–2.33 3.00–3.33 1.34–1.66 2.34–2.66 3.34–3.66 1.67–1.99 2.67–2.99 3.67–4.00 Notice that the last bin doesn’t follow the pattern; since our maximum data value is right on the upper boundary of that last bin, this is a case where we can bend that rule just a little to avoid creating a bin for 4.00–4.33 (which wouldn’t really make sense in the context of these GPAs anyway, since 4.00 is the maximum possible GPA). Step 5: Complete the table with the frequencies. Finish the table by counting the number of data values that fall in each bin, and recording them in the frequency column: GPA Range Frequency GPA Range Frequency GPA Range Frequency 1.00–1.33 1 2.00–2.33 2 3.00–3.33 6 1.34–1.66 2 2.34–2.66 4 3.34–3.66 7 1.67–1.99 5 2.67–2.99 8 3.67–4.00 7 Step 6: Check your work. Add up the frequencies to make sure all the data values are included. We started with forty-two data values, and 1 + 2 + 5 + 2 + 4 + 8 + 6 + 7 + 7 = 42 . Check Your Understanding Key Terms sample units data population simple random sample systematic random sample stratified sample cluster sample quantitative data categorical data categorical frequency Distribution binned frequency distribution Key Concepts Categorical data places units into groups (categories), while quantitative data is a numerical measure of a property of a unit. The sampling method for a study depends on the way that randomization is used to select units for the sample. Frequency distributions help to summarize data by counting the number of units that fall into a particular category or range of quantitative values.

Math


Visualizing Data Data visualizations can help people quickly understand important features of a dataset. (credit: "Group of diverse people having a business meeting" by Rawpixel Ltd/Flickr, CC BY 2.0) Learning Objectives After completing this section, you should be able to: Create charts and graphs to appropriately represent data. Interpret visual representations of data. Determine misleading components in data displayed visually. Summarizing raw data is the first step we must take when we want to communicate the results of a study or experiment to a broad audience. However, even organized data can be difficult to read; for example, if a frequency table is large, it can be tough to compare the first row to the last row. As the old saying goes: a picture is worth a thousand words (or, in this case, summary statistics)! Just as our techniques for organizing data depended on the type of data we were looking at, the methods we’ll use for creating visualizations will vary. Let’s start by considering categorical data. Visualizing Categorical Data If the data we’re visualizing is categorical, then we want a quick way to represent graphically the relative numbers of units that fall in each category. When we created the frequency distributions in the last section, all we did was count the number of units in each category and record that number (this was the frequency of that category). Frequencies are nice when we’re organizing and summarizing data; they’re easy to compute, and they’re always whole numbers. But they can be difficult to understand for an outsider who’s being introduced to your data. Let’s consider a quick example. Suppose you surveyed some people and asked for their favorite color. You communicated your results using a frequency distribution. Jerry is interested in data on favorite colors, so he reads your frequency distribution. The first row shows that twelve people indicated green was their favorite color. However, Jerry has no way of knowing if that’s a lot of people without knowing how many people total took your survey. Twelve is a pretty significant number if only twenty-five people took the survey, but it’s next to nothing if you recorded a thousand responses. For that reason, we will often summarize categorical data not with frequencies, but with proportions . The proportion of data that fall into a particular category is computed by dividing the frequency for that category by the total number of units in the data. Proportion of a category = Category frequency Total number of data units Proportions can be expressed as fractions, decimals, or percentages. Finding Proportions Recall , in which a teacher recorded the responses on the first question of a multiple choice quiz, with five possible responses (A, B, C, D, and E). The raw data was as follows: A A C A B B A E A C A A A C E A B A A C A B E E A A C C We computed a frequency distribution that looked like this: Response to First Question Frequency A 14 B 4 C 6 D 0 E 4 Proportion of a category = Category frequency / Total number of data units Now, let's compute the proportions for each category. Step 1: In order to compute a proportion, we need the frequency (which we have in the table above) and the total number of units that are represented in our data. We can find that by adding up the frequencies from all the categories: 14 + 4 + 6 + 0 + 4 = 28 . Step 2: To find the proportions, we divide the frequency by the total. For the first category (“A”), the proportion is 14 28 = 1 2 = 0.5 = 50 % . We can compute the other proportions similarly, filling in the rest of the table: Response to First Question Frequency Proportion A 14 14 28 = 50 % B 4 4 28 = 14.3 % C 6 6 28 = 21.4 % D 0 0 28 = 0 % E 4 4 28 = 14.3 % Step 3: Check your work: If you add up your proportions, you should get 1 (if you’re using fractions or decimals) or 100% (if you’re using percentages). In this case, 50 % + 14.3 % + 21.4 % + 0 % + 14.3 % = 100 % . If you need to round off the results of the computations to get your percentages or decimals, then the sum might not be exactly equal to 1 or 100% in the end due to that rounding error. Now that we can compute proportions, let’s turn to visualizations. There are two primary visualizations that we’ll use for categorical data: bar charts and pie charts. Both of these data representations work on the same principle: If proportions are represented as areas, then it’s easy to compare two proportions by assessing the corresponding areas. Let’s look at bar charts first. Bar Charts A bar chart is a visualization of categorical data that consists of a series of rectangles arranged side-by-side (but not touching). Each rectangle corresponds to one of the categories. All of the rectangles have the same width. The height of each rectangle corresponds to either the number of units in the corresponding category or the proportion of the total units that fall into the category. Building a Bar Chart In , we computed the following proportions: Response to First Question Frequency Proportion A 14 50% B 4 14.3% C 6 21.4% D 0 0% E 4 14.3% Draw a bar chart to visualize this frequency distribution. Step 1: To start, we’ll draw axes with the origin (the point where the axes meet) at the bottom left: Step 2: Next, we’ll place our categories evenly spaced along the bottom of the horizontal axis. The order doesn’t really matter, but if the categories have some sort of natural order (like in this case, where the responses are labeled A to E), it’s best to maintain that order. We'll also label the horizontal axis: Step 3: Now, we have a decision to make: Will we use frequencies to define the height of our rectangles, or will we use proportions? Let’s try it both ways. First, let’s use frequencies. Notice that our frequencies run from zero to 14; this will correspond to the scale we put on the vertical axis. If we put a tick mark for every whole number between 0 and 14, the result will be pretty crowded; let’s instead put a mark on the multiples of 3 or 5: Step 4: Now, let’s draw in the first rectangle. The frequency associated with “A” is 14. So we’ll go to 14 on the vertical axis, and place a mark at that height above the “A” label: Step 5: Then, draw vertical lines straight down from the edges of your mark to make a rectangle: Step 6: Finally, we can build the rest of the rectangles, making sure that the bases all have the same length of the base = width of the rectangle, and the rectangles don’t touch. Notice that, since the frequency for “D” is zero, that category has no rectangle (but we’ll leave a space there so the reader can see that there is a category with frequency zero). Here’s the result: Step 7: That’s it! Now, let’s use proportions instead of frequencies. We'll label the vertical axis with evenly spaced numbers that run the full range of the percentages in our table: 0% to 50%. We can divide that into five equal parts (so that each has width 10%), and use that to label our vertical axis: Step 8: Then, we can fill in the rectangles just as we did before. The height of the “A” rectangle is 50%, the “B” rectangle goes up to 14.3%, “C” goes to 21.4%, there is no rectangle for “D” (since its proportion is 0%), and the “E” rectangle also goes up to 14.3%: Step 9: Notice that the rectangles are basically identical in our two final bar charts. That’s no coincidence! Bar charts that use proportions and those that use frequencies will always look identical (which is why it doesn’t really matter much which option you choose). Here’s why: look at the bars for “B” and “C”. The frequencies for these are 4 and 6 respectively. Notice that 6 is 50% bigger than 4 (since 6 = 1.5 × 4 ), which means that the “C” bar will be 50% higher than the “B” bar. Now look at the same bars using proportions: since 21.4 % = 1.5 × 14.3 % , the bar for “C” will be 50% higher than the bar for “B.” The same relationships hold for the other bars, too. In practice, most graphs are now made with computers. You can use Google Sheets , which is available for free from any web browser. Make a Simple Bar Graph in Google Sheets Now that we’ve explored how bar graphs are made, let’s get some practice reading bar graphs. Reading Bar Graphs The bar graph shown gives data on 2020 model year cars available in the United States. Analyze the graph to answer the following questions. (data source: consumerreports.org/cars) What proportion of available cars were sports cars? What proportion of available cars were sedans? Which categories of cars each made up less than 5% of the models available? The bar for sports cars goes up to 10%, so the proportion of models that are considered sports cars is 10%. The bar corresponding to sedan goes up past 30% but not quite to 35%. It looks like the proportion we want is between 33% and 34%. We’re looking for the bars that don’t make it all the way to the 5% line. Those categories are hatchback and wagon. Candy Color: Frequency and Distribution M&Ms, Skittles, and Reese’s Pieces are all candies that have pieces that are uniformly shaped, but which have different colors. Do the colors in each bag appear with the same frequency? Get a bag of one of these candies and make a bar chart to visualize the color distribution. Pie Charts A pie chart consists of a circle divided into wedges, with each wedge corresponding to a category. The proportion of the area of the entire circle that each wedge represents corresponds to the proportion of the data in that category. Pie charts are difficult to make without technology because they require careful measurements of angles and precise circles, both of which are tasks better left to computers. Create Pie Charts Using Google Sheets Pie charts are sometimes embellished with features like labels in the slices (which might be the categories, the frequencies in each category, or the proportions in each category) or a legend that explains which colors correspond to which categories. When making your own pie chart, you can decide which of those to include. The only rule is that there has to be some way to connect the slices to the categories (either through labels or a legend). Making Pie Charts Use the data that follows to generate a pie chart. Type Percent Type Percent SUV 43.6% Minivan 5.5% Sedan 33.6% Hatchback 3.6% Sports 10.0% Wagon 3.6% (data source: www.consumerreports.org/cars) First, enter the chart above into a new sheet in Google Sheets. Next, click and drag to select the full table (including the header row). Click on the “Insert” menu, then select “Chart.” The result may be a pie chart by default; if it isn’t, you can change it to a pie chart using the “Chart type” drop-down menu in the Chart Editor. (data source: consumerreports.org/cars) You can choose to use a legend to identify the categories, as well as label the slices with the relevant percentages. Florence Nightingale Florence Nightingale (1820–1910) is best remembered today for her contributions in the medical field; after witnessing the horrors of field hospitals that tended to the wounded during the Crimean War, she championed reforms that encouraged sanitary conditions in hospitals. For those efforts, she is today considered the founder of modern nursing. Florence Nightingale's significant contribution to the field of statistical graphics cannot be understated. (credit: "Florence Nightingale" by Library of Congress Prints and Photographs Division/http://hdl.loc.gov/loc.pnp/pp.print, public domain) Nightingale is also remembered for her contributions in statistics, especially in the ways we visualize data. She developed a version of the pie chart that is today known as a polar area diagram , which she used to visualize the causes of death among the soldiers in the war, highlighting the number of preventable deaths the British Army suffered in that conflict. In 1859, the Royal Statistical Society honored her for her contributions to the discipline by electing her to join the organization. She was the first woman to be so honored. She was later named an honorary member of the American Statistical Association. Nightingale's status as a revered pioneer in both nursing and statistics is a complex one, because some of her writings and opinions demonstrate a colonialist mindset and disregard for those who lost their lives and lands at the hands of the British. Her core statistical writings indicated that she felt superior to the Indigenous people she was treating. Members of both fields continue to debate her near-iconic role. Visualizing Quantitative Data There are several good ways to visualize quantitative data. In this section, we’ll talk about two types: stem-and-leaf plots and histograms. Stem-and-Leaf Plots Stem-and-leaf plots are visualization tools that fall somewhere between a list of all the raw data and a graph. A stem-and-leaf plot consists of a list of stems on the left and the corresponding leaves on the right, separated by a line. The stems are the numbers that make up the data only up to the next-to-last digit, and the leaves are the final digits. There is one leaf for every data value (which means that leaves may be repeated), and the leaves should be evenly spaced across all stems. These plots are really nothing more than a fancy way of listing out all the raw data; as a result, they shouldn’t be used to visualize large datasets. This concept can be difficult to understand without referencing an example, so let’s first look at how to read a stem-and-leaf plot. Reading a Stem-and-Leaf Plot A collector of trading cards records the sale prices (in dollars) of a particular card on an online auction site, and puts the results in a stem-and-leaf plot: 0 5 8 9 1 0 0 0 3 4 4 5 5 5 5 6 9 9 2 0 0 0 0 5 5 9 9 3 0 0 0 5 5 4 0 0 5 5 6 0 Answer the following questions about the data: How many prices are represented? What prices represent the five most expensive cards? The five least expensive? What is the full set of data? Each leaf (the numbers on the right side of the bar) represents one data value. So, on the first row (which looks like 0 | 5 8 9), there are three data values (one for each leaf: 5, 8, and 9). The next row has thirteen leaves, then eight, five, three, zero, and one. Adding those up, we get 3 + 13 + 8 + 5 + 3 + 0 + 1 = 33 data points or prices. The most expensive card is the last one listed. Its stem is 6 and its leaf is 0, so the price is $60. There are no leaves associated with the 5 stem, so there were no cards sold for $50 to $59. The next most expensive cards are then on the 4 stem: $45, $40, and $40 (remember, repeated leaves mean repeated values in the dataset). So, we have our four most expensive cards. The fifth would be on the next stem up. The biggest leaf on the 3 stem is a 5, so the fifth-most expensive card sold for $35. As for the five least-expensive cards, the smallest stem is 0, with leaves 5, 8, and 9. So, the three least expensive cards sold for $5, $8, and $9 (notice that we don’t write down that leading 0 from the stem in the tens place). The next two least-expensive cards will be the two smallest leaves on the next stem: $10 and $10. The full list of data is: 5, 8, 9, 10, 10, 10, 13, 14, 14, 15, 15, 15, 15, 16, 19, 19, 20, 20, 20, 24, 25, 25, 29, 29, 30, 30, 30, 35, 35, 40, 40, 45, 60. Stem-and-leaf plots are useful in that they give us a sense of the shape of the data. Are the data evenly spread out over the stems, or are some stems “heavier” with leaves? Are the heavy stems on the low side, the high side, or somewhere in the middle? These are questions about the distribution of the data, or how the data are spread out over the range of possible values. Some words we use to describe distributions are uniform (data are equally distributed across the range), symmetric (data are bunched up in the middle, then taper off in the same way above and below the middle), left-skewed (data are bunched up at the high end or larger values, and taper off toward the low end or smaller values), and right-skewed (data are bunched up at the low end, and taper off toward the high end). See below figures. Looking back at the stem-and-leaf plot in the previous example, we can see that the data are bunched up at the low end and taper off toward the high end; that set of data is right-skewed. Knowing the distribution of a set of data gives us useful information about the property that the data are measuring. Now that we have a better idea of how to read a stem-and-leaf plot, we’re ready to create our own. Constructing a Stem-and-Leaf Plot An entomologist studying crickets recorded the number of times different crickets (of differing species, genders, etc.) chirped in a one-minute span. The raw data are as follows: 89 97 82 102 84 99 93 103 120 91 115 105 89 109 107 89 104 82 106 92 101 109 116 103 100 91 85 104 104 106 Construct a stem-and-leaf plot to visualize these results. Step 1 : Before we can create the plot, we need to sort the data in order from smallest to largest: 82 82 84 85 89 89 89 91 91 92 93 97 99 100 101 102 103 103 104 104 104 105 106 106 107 109 109 115 116 120 Step 2: Next, we identify the stems. To do that, we cut off the final digit of each number, which leaves us with stems of 8, 9, 10, 11, and 12. Arrange the stems vertically, and add the bar to separate these from the leaves: 8 9 10 11 12 Step 3: Write down the leaves on the right side of the bar, giving just the final digit (that we cut off to make the stems) of each data value. List these in order, and make sure they line up vertically: 8 2 2 4 5 9 9 9 9 1 1 2 3 7 9 10 0 1 3 3 4 4 4 5 6 6 7 9 9 11 5 6 12 0 As we mentioned above, stem-and-leaf plots aren’t always going to be useful. For example, if all the data in your dataset are between 20 and 29, then you’ll just have one stem, which isn’t terribly useful. (Although there are methods like stem splitting for addressing that particular problem, we won’t go into those at this time.) On the other end of the spectrum, the data may be so spread out that every stem has only one leaf. (This problem can sometimes be addressed by rounding off the data values to the tens, hundreds, or some other place value, then using that place for the leaves.) Finally, if you have dozens or hundreds (or more) of data values, then a stem-and-leaf plot becomes too unwieldy to be useful. Fortunately, we have other tools we can use. Histograms Histograms are visualizations that can be used for any set of quantitative data, no matter how big or spread out. They differ from a categorical bar chart in that the horizontal axis is labeled with numbers (not ranges of numbers), and the bars are drawn so that they touch each other. The heights of the bars reflect the frequencies in each bin. Unlike with stem-and-leaf plots, we cannot recreate the original dataset from a histogram. However, histograms are easy to make with technology and are great for identifying the distribution of our data. Let’s first create one histogram without technology to help us better understand how histograms work. Constructing a Histogram In , we built a stem-and-leaf plot for the number of chirps made by crickets in one minute. Here are the raw data that we used then: 89 97 82 102 84 99 115 105 89 109 107 89 101 109 116 103 100 91 93 103 120 91 85 104 104 82 106 92 104 106 Construct a histogram to visualize these results. Step 1: Add data to bins. Histograms are built on binned frequency distributions, so we’ll make that first. Luckily, the stem-and-leaf plot we made earlier can help us do this much more quickly: 8 2 2 4 5 9 9 9 9 1 1 2 3 7 9 10 0 1 2 3 3 4 4 4 5 6 6 7 9 9 11 5 6 12 0 If we’re using bins of width 10, we can compute the frequencies by counting the numbers of leaves associated with the corresponding stem: Bin Frequency 80-89 7 90-99 6 100-109 14 110-119 2 120-129 1 (Note that, when we made binned frequency diagrams in the last module, we noted that if the biggest data value was right on the border between two bins, it was OK to lump it in with the lower bin. That’s not recommended when building histograms, so the data value 120 is all alone in the 120-129 bin.) Step 2: Create the axes. On the horizontal axis, start labeling with the lower end of the first bin (in this case, 80), and go up to the higher end of the last bin (120). Mark off the other bin boundaries, making sure they’re all evenly spaced. On the vertical axis, start with zero and go up at least to the greatest frequency you see in your bins (14 in this example), making sure that the labels you make are evenly spaced and that the difference between those numbers is the same. Let’s count off our vertical axis by threes: Step 3: Draw in the bars. Remember that the bars of a histogram touch, and that the heights are determined by the frequency. So, the first bar will cover 80 to 90 on the horizontal axis, and have a height of 7: Now, we can fill in the others: Step 4: Let’s compare the histogram we just created to the stem-and-leaf plot we made earlier: Notice that the leaves on the rotated stem-and-leaf plot match the bars on our histogram! We can view stem-and-leaf plots as sideways histograms. But, as we’ll see soon, we can do much more with histograms. Now that we’ve seen the connection between stem-and-leaf plots and histograms, we are ready to look at how we can use Google Sheets to build histograms. Make a Histogram Using Google Sheets Let’s use Google Sheets to create a histogram for a large dataset. Creating a Histogram in Google Sheets The data in “AvgSAT” contains the average SAT score for students attending every institution of higher learning in the US for which data is available. Create a histogram in Google Sheets of the average SAT scores. Use bins of width 50. Are the data uniformly distributed, symmetric, left-skewed, or right-skewed? Using the procedure described in the video above, we get this: (data source: https://data.ed.gov) The data are fairly symmetric, but slightly right-skewed. Bar Charts for Labeled Data Sometimes we have quantitative data where each value is labeled according to the source of the data. For example, in the Your Turn above, you looked at in-state tuition data. Every value you used to create that histogram was associated with a school; the schools are the labels. In YOUR TURN 8.11 , you found a histogram of the wins of every Major League Baseball team in 2019. Each of those win totals had a label: the team. If we’re interested in visualizing differences among the different teams, or schools, or whatever the labels are, we create a different version of the bar graph known as a bar chart for labeled data . These graphs are made in Google Sheets in exactly the same way as regular bar graphs. The only change is that the vertical axis will be labeled with the units for your quantitative data instead of just “Frequency.” Building a Bar Chart for Labeled Data The following table shows the gross domestic product (GDP) for the United States for the years 2010 to 2019: Year GDP (in $ trillions) Year GDP (in $ trillions) 2010 14.992 2015 18.225 2011 15.543 2016 18.715 2012 16.197 2017 19.519 2013 16.785 2018 20.580 2014 17.527 2019 21.433 (source: https://data.worldbank.org) Construct a histogram that represents these data. In this case, the years are the labels, and the data we are interested in are the GDP numbers. Once you have the table above (including the labels) entered into a spreadsheet, click and drag to select the full table. Then, in the “Insert” menu, click “Chart.” The result may not be a bar chart; if it’s not, select “Column chart” in the drop-down menu “Chart type” in the Chart Editor. If you want, you can edit things like the chart title in the “Customize” tab in the Chart Editor. (data source: https://data.worldbank.org) Misleading Graphs Graphical representations of data can be manipulated in ways that intentionally mislead the reader. There are two primary ways this can be done: by manipulating the scales on the axes and by manipulating or misrepresenting areas of bars. Let’s look at some examples of these. Misleading Graphs The table below shows the teams, and their payrolls, in the English Premier League, the top soccer organization in the United Kingdom. Team Salary (£1,000,000s) Team Salary (£1,000,000s) Manchester United F.C. 175.7 Newcastle United F.C. 56.9 Manchester City F.C. 136.5 Aston Villa F.C. 52.3 Chelsea F.C. 132.8 Fulham F.C. 52.1 Arsenal F.C. 130.7 Southampton F.C. 49.6 Tottenham Hotspur F.C. 129.2 Wolverhampton Wanderers F.C. 49.5 Liverpool F.C. 118.6 Brighton & Hove Albion 43.7 Crystal Palace 85.0 Burnley F.C. 35.5 Everton F.C. 82.5 West Bromwich Albion F.C. 23.8 Leicester City 73.7 Leeds United F.C. 22.5 West Ham United F.C. 69.2 Sheffield United F.C. 19.7 (source: www.spotrac.com) How might someone present this data in a misleading way? Step 1: Let’s focus on the top five teams. Here’s a bar chart of their payrolls: (data source: www.spotrac.com) Step 2: Now, here’s another bar chart visualizing exactly the same data: (data source: www.spotrac.com) Step 3: You should notice that despite using the same data, these two graphs look strikingly different. In the second graph, the gap between Manchester United and the other four teams looks significantly larger than in the first graph. The scale on the vertical axis has been manipulated here. The first graph's axis starts at zero, while the lowest value on the second graph's axis is 120. This trick has a strong impact on the viewer’s perception of the data. Beware of vertical axes that don’t start at zero! They overemphasize differences in heights. Step 4: To further emphasize the difference this creates in our perception, let's look at that data again, but this time using graphics instead of colored areas on our bar graph. (data source: www.spotrac.com) This graph uses an image of a £10 banknote in place of the bars. Using an image that evokes the context of the data in place of a standard, “boring” bar is a common tool that people use when creating infographics . However, this is generally not a good practice because it distorts the data. Notice that our “bars” (the banknotes) are just as tall here as they were in the previous figure. But, to maintain the right proportions, the widths had to be adjusted as well, which changes the area (height × width) of each bar. A key point is that when looking at rectangles, the human eye tends to process areas more easily than heights. Beware of infographics! Areas overemphasize a difference that should be measured with a height! Step 5: Now, let’s look at all 20 teams. This histogram indicates that the data are right-skewed, with the highest number of teams having a payroll between £40 million and £80 million: (data source: www.spotrac.com) Step 6: Now let's view this same data in another chart: (data source: www.spotrac.com) Step 7: Even though this chart uses the same data, the skew seems to be reversed. Why? Well, even though this graph looks like a histogram, it isn’t. Look closely at the labels on the horizontal axis; they don't correspond to spots on the axis, but instead provide a range, meaning this is a bar graph based on a binned frequency distribution. When we review these ranges, we can see that the last range is misleading as it consists of all data “over 80.” If the bins all had the same width, that last bin would run from 80 to 120. However, we can see from the histogram that the maximum value for this data is between 160 and 200. If the last bin in this bar graph were labeled honestly, it would read “80–200,” which would drive home the fact that the width of that bar is misleading. Always check the horizontal axis on histograms! The widths of all the bars should be equal. How to Spot a Misleading Graph Napoleon's Failed Invasion One of the most famous data visualizations ever created is the cartographic depiction by Charles Joseph Minard of Napoleon’s disastrous attempted invasion of Russia. Minard’s Napoleon Map (credit: Carte de Charles Minard/Wikimedia, public domain) Minard’s chart is remarkable in that it shows not just how the size of Napoleon’s army shrank drastically over time, but also the location on the map, the direction the army was traveling at the time, and the temperature during the retreat. Check Your Understanding Key Terms proportion bar chart pie chart stem-and-leaf plot distribution (of quantitative data) histogram bar chart for labeled data Key Concepts Categorical data can be visualized using pie charts or bar charts; quantitative data can be visualized using stem-and-leaf plots or histograms. Areas in pie charts and bar charts represent proportions of the data falling into a particular category, while areas in histograms represent proportions of the data that fall into a given range of data values (or “bins”). Stem-and-leaf plots are visual representations of entire datasets. By manipulating the axes, changing widths of bars, or making bad choices for bins, we can create data visualizations that misrepresent the distribution of data. Videos Make a Simple Bar Graph in Google Sheets Create Pie Charts Using Google Sheets Make a Histogram Using Google Sheets How to Spot a Misleading Graph

Math


Mean, Median and Mode What does it mean to say someone has average height? (credit: modification of work “I’m the tallest” by Jenn Durfey/Flickr, CC BY 2.0) Learning Objectives After completing this section, you should be able to: Calculate the mode of a dataset. Calculate the median of a dataset. Calculate the mean of a dataset. Contrast measures of central tendency to identify the most representative average. Solve application problems involving mean, median, and mode. What exactly do we mean when we describe something as "average"? Is the height of an average person the height that more people share than any other? What if we line up every person in the world, in order from shortest to tallest, and find the person right in the middle: Is that person’s height the average? Or maybe it’s something more complicated. Imagine a game where you and a friend are trying to guess the typical person’s height. Once the guesses are made, you bring in every person and measure their height. You and your friend figure out how far off each of your guesses were from the actual value, then square that number. The result is the number of points you earn for that person. After we check every height and award points accordingly, the person with the lower score wins (because a lower score means that person’s guess was, overall, closer to the actual values). Could we define the average height to be the number that you should guess to give you the smallest possible score? Each of these three methods of determining the “average” is commonly used. They are all methods of measuring centrality (or central tendency ). Centrality is just a word that describes the middle of a set of data. All give potentially different results, and all are useful for different reasons. In this section, we’ll explore each of these methods of finding the “average.” The Mode In our discussion of average heights, the first possible definition we offered was the height that more people share than any other. This is the mode , or the value that appears most often. If there are two modes, the data are bimodal . Let’s look at some examples. Finding the Mode Using a Stem-and-Leaf Plot In , we looked at a stem-and-leaf plot of the sale prices (in dollars) of a particular collectible trading card: 0 5 8 9 1 0 0 0 3 4 4 5 5 5 5 6 9 9 2 0 0 0 0 5 5 9 9 3 0 0 0 5 5 4 0 0 5 5 6 0 What is the mode price? The mode is the price that appears most often. Both 15 and 20 appear 4 times, more than any other values. So, they are the modes (and we can conclude that this set of data is bimodal). When we have a complete list of the data or a stem-and-leaf plot, it’s pretty straightforward to find the mode; we just need to find the number that appears most often. If we’re given a frequency distribution instead, the technique is different (but just as straightforward): we’re looking for the number with the highest frequency. Finding the Mode Using a Frequency Distribution In , we created a frequency distribution of the number of siblings of conflict resolution class attendees. Number of Siblings Frequency 0 5 1 13 2 6 3 3 4 2 5 1 What is the mode of the number of siblings? The mode is the value that appears the most often, which means it has the greatest frequency. Thirteen of the respondents have one sibling, more than any other number. So, the mode is 1. What happens if there is no number in the data that appears more than once? In that case, by our definition, every data value is a mode. But according to some other definitions, the data would have no mode. In practice, though, it doesn’t really matter; if no data value appears more than once, then the mode is not helpful at all as a measure of centrality. The Median Let's revisit our example of trying to identify the height of the “average” person. If we lined everyone up in order by height and found the person right in the middle, that person’s height is called the median , or the value that is greater than no more than half and less than no more than half of the values. Let’s look at a really simple example. Consider the following list of numbers: 11, 12, 13, 13, 14. Is the first number on the list, 11, the median? There are no values less than 11 (that’s 0%), and there are four values greater than 11 (that’s 80%). Since more than 50% of the data are greater than 11, the definition is violated; it’s not the median. Here’s a chart with the rest of the data, with red shading to show where the definition is violated: Data Value Number of Values Below Percentage of Values Below Number of Values Above Percentage of Values Above 11 0 0% 4 80% 12 1 20% 3 60% 13 2 40% 1 20% 14 4 80% 0 0% Only 13 has no violations, so it’s the median according to the definition. In practice, we find the median just like we described in the average height example: by lining up all the data values in order from smallest to largest and picking the value in the middle. For our easy example (with data values 11, 12, 13, 13, 14), that first 13 is right in the middle; there are two values to the left and two values to the right. If there’s not one value right in the middle, we pick the two closest, then choose the number exactly between them. For example, let’s say we have the data 41, 44, 46, 53. Since there are an even number of data values in our list, we can’t pick the one right in the middle. The two closest to the middle are 44 and 46, so we’ll choose the number halfway between those to be the median: 45. As this example shows, the median (unlike the mode) doesn’t have to be a number in our original set of data. In the examples we’ve looked at so far, it’s been pretty easy to identify which number is right in the middle. If we had a very large dataset, though, it might be harder. Fortunately, we have some formulas to help us with that. Suppose we have a set of data with n values, ordered from smallest to largest. If n is odd, then the median is the data value at position n + 1 2 . If n is even, then we find the values at positions n 2 and n 2 + 1 . If those values are named a and b , then the median is defined to be a + b 2 . Let’s put those formulas to work in an example. Finding the Median Using a Stem-and-Leaf Plot In , we looked at a stem-and-leaf plot that contained 33 sale prices (in dollars) of a particular collectible trading card: 0 5 8 9 1 0 0 0 3 4 4 5 5 5 5 6 9 9 2 0 0 0 0 5 5 9 9 3 0 0 0 5 5 4 0 0 5 5 6 0 What is the median price? Step 1: Since 33 is odd, the median is the data value at position n + 1 2 , where n is the number of values in the dataset. There are 33 total values, so our formula becomes 33 + 1 2 = 17 . That means we want to look for the 17th number in the dataset. Step 2: We'll want to count from the lowest value to the 17th number. We can use our stem and leaf plot to do this. 1 2 3 0 5 8 9 4 5 6 7 8 9 10 11 12 13 14 15 16 1 0 0 0 3 4 4 5 5 5 5 6 9 9 17 2 0 0 0 0 5 5 9 9 3 0 0 0 5 5 4 0 0 5 5 6 0 The seventeenth number is 20, so the median is 20. Now, let’s tackle an example with an even number of values. Finding the Median In , we looked at the number of times different crickets (of differing species, genders, etc.) chirped in a one-minute span. That data is again provided below: 89 97 82 102 84 99 115 105 89 109 107 89 101 109 116 103 100 91 93 103 120 91 85 104 104 82 106 92 104 106 Find the median. Step 1 : In order to find the median, we first need to sort the data so that they’re in order, smallest to largest: 82 82 84 85 89 89 89 91 91 92 93 97 99 100 101 102 103 103 104 104 104 105 106 106 107 109 109 115 116 120 Step 2 : Next, we figure out how many data values we have. Counting them up, we see there are 30, which is even. Step 3 : Since we have an even number of data values, we need to find the values in positions 30 2 = 15 and 30 2 + 1 = 16 . These are 101 and 102. Step 4 : We use the formula to compute the median: 101 + 102 2 = 101.5 . Finding the Median Using a Frequency Distribution In , we created a frequency distribution of the number of siblings of the people who attended a conflict resolution class. Let's review that data again: Number of Siblings Frequency 0 5 1 13 2 6 3 3 4 2 5 1 What is the median of the number of siblings? There are 30 data values total, so the median is between the 15th and 16th values in the ordered list. There are five 0s and thirteen 1s according to the frequency distribution, so items one through five are all 0s and items six through eighteen are all 1s. Since both items fifteen and sixteen are 1s, the median is 1. The Mean Recall our example of ways we could identify the “average” height of an individual. The last method we discussed was also the most complicated. It involved a game where the player guesses a height, then figures out how far off that guess is from every single person’s height. Those differences get squared and added together to get a score. Our next measure of centrality gives the lowest possible score: No other guess would beat it in the game. Given a dataset containing n total values, the mean of the dataset is the sum of all the data values, divided by n . This is a computation you have likely done before. In many places, including spreadsheet programs like Microsoft Excel and Google Sheets, this number is called the average . For statisticians, though, the word average has too many possible meanings, so they prefer the one we’ll use: mean. Finding the Mean Compute the mean of the numbers 12, 15, 17, 18, 18, and 19. The mean is the sum of the values, divided by the number of values on the list. So, we get: 12 + 15 + 17 + 18 + 18 + 19 6 = 99 6 = 16.5 . Finding the Mean Using a Frequency Distribution Refer again to the frequency distribution of the number of siblings people who attended a conflict resolution class reported: Number of Siblings Frequency 0 5 1 13 2 6 3 3 4 2 5 1 What is the mean of the number of siblings? Step 1: We compute the mean by adding up all the data values and then dividing by the number of data values on the list. Step 2: Adding up the frequencies, we get 5 + 13 + 6 + 3 + 2 + 1 = 30 data values in our list. Step 3: Now, to find the sum of all the data values, we could simply reconstruct the raw data and add up all the numbers there. But, there’s an easier way: Remember that repeatedly adding a number to itself is the definition of multiplication. So, for example, since there are six 2s in our data, the sum of all those 2s must be 6 × 2 = 12 . Step 4: Let’s add a column to our distribution for these products: Number of Siblings Frequency (Number of Siblings) × (Frequency) 0 5 0 1 13 13 2 6 12 3 3 9 4 2 8 5 1 5 Step 5: So, the sum of all our data values is 0 + 13 + 12 + 9 + 8 + 5 = 47 . The mean is 47 30 ≈ 1.567 . As the number of data values we are considering grows, the computation for the mean gets more and more complicated. That’s why people generally trust technology to perform that computation. Compute Measures of Centrality Using Google Sheets Note that a recent update to Google Sheets introduced a new function called “MODE.MULT,” which will find every mode (not just the first one on the list). Using Google Sheets to Compute Measures of Centrality The dataset "InState" contains the in-state tuitions of every college and university in the country that reported that data to the Department of Education. Find the mode, median, and mean of those in-state tuition values. Step 1: To find the mode, we select an empty cell type “=MODE(”, click on the header of the column to insert a reference to the column into our formula, and then close the parentheses. When we hit the enter key, our formula is replaced with the mode: $13,380. Step 2: We can find the median and mean using the same process, except using the functions “MEDIAN” and “AVERAGE” in place of “MODE”. We find that the median is $11,207 and the mean is $15,476.79. Which Is Better: Mode, Median, or Mean? If the mode, median, and mean all purport to measure the same thing (centrality), why do we need all three? The answer is complicated, as each measure has its own strengths and weaknesses. The mode is simple to compute, but there may be more than one. Further, if no data value appears more than once, the mode is entirely unhelpful. As for the mean and median, the main difference between these two measures is how each is affected by extreme values. Consider this example: the mean and median of 1, 2, 3, 4, 5 are both 3. But what if the dataset is instead 1, 2, 3, 4, 10? The median is still 3, but the mean is now 4. What this example shows is that the mean is sensitive to extreme values, while the median isn’t. This knowledge can help us decide which of the two is more relevant for a given dataset. If it is important that the really high or really low values are reflected in the measure of centrality, then the mean is the better option. If very high or low values are not important, however, then we should stick with the median. The decision between mean and median only really matters if the data are skewed. If the data are symmetric, then the mean and median are going to be approximately equal, and the distinction between them is irrelevant. If the data are skewed, the mean gets pulled in the direction of the skew (i.e., if the data are right-skewed, then the mean will be bigger than the median; if the data are left-skewed, the opposite relation is true). Choosing Which Measure of Centrality to Use For the following situations, decide which measure(s) of centrality would be best: You found a used car that you like, and you want to know if the price is too high or too low. You find a list of sale prices for that make and model, and you see that the distribution of those prices is skewed to the right. Some of the prices at the high end are close to the original sale price of the car, so you guess that those cars might have really low mileage, or have other enhancements added on that increased the value (but which don’t apply to the car you found). You are asked to analyze the responses to a survey. One of the questions asked, “How strongly do you agree with the statement, ‘I believe my elected representatives have my best interests in mind when they vote’?” Responses are a number between 1 and 5, with 1 representing “strongly disagree” and 5 representing “strongly agree.” You are asked to find the “average” household income for a zip code. Those values are skewed right. Thinking back to the situation at the beginning of this section: you want to find “average” height. The data you’ve collected seem to be distributed symmetrically. In this situation, the high values are not comparable to the value of the car you found and we don’t want them to affect the results. Also, we’re unlikely to find many repeated values, so the mode is probably not useful. Median is best. Here, we want to know what a typical result is. The mean doesn’t really make sense; it involves adding the numbers together, so it would treat two “strongly disagree” and two “strongly agree” responses (those add to 1 + 1 + 5 + 5 = 12 ) as exactly the same as four “neutral” responses ( 3 + 3 + 3 + 3 = 12 ). But those are really different situations; the first shows a strong polarization in the responses, while the second represents strong indifference. The mode is probably the best choice (because the data are actually categorical), but the median would be good too. The mode isn’t going to be useful in this situation because it’s unlikely you will find many households that have exactly the same income. The mean and median will be different because of the skew, so the choice comes down to the extreme values. Remember that the data are skewed right, so high values are prevalent. Because these high values are important for our analysis, we want them to be reflected in the results. Thus, the mean is best. That being said, the median is also useful; it allows us to say something like “50% of the households surveyed make more than” the median. Because we aren’t likely to find many people with exactly the same height, the mode won’t be useful. Since the data are symmetric, the mean and the median will be about the same. So, it doesn’t really matter which of those two we choose. Check Your Understanding Key Terms mode bimodal median mean Key Concepts The mode of a dataset is the value that appears the most frequently. The median is a value that is greater than or equal to no more than 50% of the data and less than or equal to no more than 50% of the data. The mean is the sum of all the data values, divided by the number of units in the dataset. The median of a dataset is not affected by outliers, but the mean will be biased toward outliers. This distinction might affect which measure of centrality is used to summarize a dataset. Formulas Suppose we have a set of data with n values, ordered from smallest to largest. If n is odd, then the median is the data value at position n + 1 2 . If n is even, then we find the values at positions n 2 and n 2 + 1 . If those values are named a and b , then the median is defined to be a + b 2 . Videos Compute Measures of Centrality Using Google Sheets

Math


Range and Standard Deviation Measures of spread help us get a better understanding of test scores. (credit: "Standardized test exams form with answers bubbled" by Marco Verch Professional Photographer/Flickr, CC BY 2.0) Learning Objectives After completing this section, you should be able to: Calculate the range of a dataset Calculate the standard deviation of a dataset Measures of centrality like the mean can give us only part of the picture that a dataset paints. For example, let’s say you’ve just gotten the results of a standardized test back, and your score was 138. The mean score on the test is 120. So, your score is above average! But how good is it really ? If all the scores were between 100 and 140, then you know your score must be among the best. But if the scores ranged from 0 to 200, then maybe 140 is good, but not great (though still above average). Knowing information about how the data are spread out can help us put a particular data value in better context. In this section, we’ll look at two numbers that help us describe the spread in the data: the range and the standard deviation. These numbers are called measures of dispersion. The Range Our first measure of dispersion is the range , or the difference between the maximum and minimum values in the set. It’s the measure we used in the standardized test example above. Let’s look at a couple of examples. Finding the Range You survey some of your friends to find out how many hours they work each week. Their responses are: 5, 20, 8, 10, 35, 12. What is the range? The maximum value in the set is 35 and the minimum is 5, so the range is 35 - 5 = 30 . For large datasets, finding the maximum and minimum values can be daunting. There are two ways to do it in a spreadsheet. First, you can ask the spreadsheet program to sort the data from smallest to largest, then find the first and last numbers on the sorted list. The second method uses built-in functions to find the minimum and maximum. Find the Minimum and Maximum Using Google Sheets In either method, once you’ve found the maximum and minimum, all you have to do is subtract to find the range. Finding the Range with Google Sheets The data in “AvgSAT” contains the average SAT score for students attending every institution of higher learning in the US for which data is available. What is the range of these average SAT scores? Step 1: To find the maximum, click on an empty cell in the spreadsheet, type “=MAX(”, and then click on the letter that marks the top of the column containing the AvgSAT data. That inserts a reference to the column into our function. Then we close the parentheses and hit the enter key. The formula is replaced with the maximum value in our data: 1566. Step 2: Using the same process (but with “MIN” instead of “MAX”), we find the minimum value is 785. Step 3: So, the range is 1566 - 785 = 781 . The range is very easy to compute, but it depends only on two of the data values in the entire set. If there happens to be just one unusually high or low data value, then the range might give a distorted measure of dispersion. Our next measure takes every single data value into account, making it more reliable. The Standard Deviation The standard deviation is a measure of dispersion that can be interpreted as approximately the average distance of every data value from the mean. (This distance from the mean is the “deviation” in “standard deviation.”) The standard deviation is computed as follows: s = ∑ ( x - x ¯ ) 2 n - 1 Here, x represents each data value, x ¯ is the mean of the data values, n is the number of data values, and the capital sigma ( Σ ) indicates that we take a sum. To compute the standard deviation using the formula, we follow the steps below: Compute the mean of all the data values. Subtract the mean from each data value. Square those differences. Add up the results in step 3. Divide the result in step 4 by n - 1 Take the square root of the result in step 5. Let’s see that process in action. Computing the Standard Deviation You surveyed some of your friends to find out how many hours they work each week. Their responses were: 5, 20, 8, 10, 35, 12. What is the standard deviation? Let’s follow the six steps mentioned previously to compute the standard deviation. Step 1 : Find the mean: x ¯ = 5 + 20 + 8 + 10 + 35 + 12 6 = 15 . Step 2 : Subtract the mean from each data value. To help keep track, let’s do this in a table. In the first row, we’ll list each of our data values (and we’ll label the row x ); in the second, we’ll subtract x ¯ = 15 from each data value. x 5 20 8 10 35 12 x − x ¯ −10 5 –7 –5 20 –3 Step 3: Square the differences. Let’s add a row to our table for those values: x 5 20 8 10 35 12 x − x ¯ −10 5 –7 –5 20 –3 ( x − x ¯ ) 2 100 25 49 25 400 9 Step 4: Add up those squares: 100 + 25 + 49 + 25 + 400 + 9 = 608 . Step 5: Divide the sum by n - 1 . Since we have 6 data values, that gives us 608 6 - 1 = 121.6 . Step 6: Take the square root of the result: 121.6 ≈ 11.027 . Thus, the standard deviation is s ≈ 11.027 . The computation for the standard deviation is complicated, even for just a small dataset. We’d never want to compute it without technology for a large dataset! Luckily, technology makes this calculation easy. Find the Standard Deviation Using Google Sheets Finding the Standard Deviation with Google Sheets The data in “AvgSAT” contains the average SAT score for students attending every institution of higher learning in the US for which data is available. What is the standard deviation of these average SAT scores? To find the standard deviation, we click in an empty cell in our spreadsheet and then type “=STDEV(”. Next, click on the letter at the top of the column containing our data; this will put a reference to that column into our formula. Then close the parentheses with and hit the enter key. The formula is replaced with the result: 125.517. Check Your Understanding Key Terms range standard deviation Key Concepts The range of a dataset is the difference between its largest and smallest values. The standard deviation is approximately the mean difference (in absolute value) that individual units fall from the mean of the dataset. Formulas s = ∑ ( x - x ¯ ) 2 n - 1 Here, s is the standard deviation, x represents each data value, x ¯ is the mean of the data values, n is the number of data values, and the capital sigma ( Σ ) indicates that we take a sum. Videos Find the Minimum and Maximum Using Google Sheets Find the Standard Deviation Using Google Sheets

Math