Hugo speaks with Allen Downey, a curriculum designer at Brilliant, Professor Emeritus at Olin College, and the author of Think Python, Think Bayes, Think Stats, and other computer science and data science books. In 2019-20 he was a Visiting Professor at Harvard University. He previously taught at Wellesley College and Colby College and was a Visiting Scientist at Google. He is also the author of the upcoming book Probably Overthinking It! They discuss Allen's new book and the key statistical and data skills we all need to navigate an increasingly data-driven and algorithmic world. The goal was to dive deep into the statistical paradoxes and fallacies that get in the way of using data to make informed decisions. For example, when it was reported in 2021 that “in the United Kingdom, 70-plus percent of the people who die now from COVID are fully vaccinated,” this was correct but the implication was entirely wrong. Their conversation jumps into many such concrete examples to get to the bottom of using data for more than “lies, damned lies, and statistics.” They cover Information and misinformation around pandemics and the base rate fallacy; The tools we need to comprehend the small probabilities of high-risk events such as stock market crashes, earthquakes, and more; The many definitions of algorithmic fairness, why they can't all be met at once, and what we can do about it; Public health, the need for robust causal inference, and variations on Berkson’s paradox, such as the low-birthweight paradox: an influential paper found that that the mortality rate for children of smokers is lower for low-birthweight babies; Why none of us are normal in any sense of the word, both in physical and psychological measurements; The Inspection paradox, which shows up in the criminal justice system and distorts our perception of prison sentences and the risk of repeat offenders. LINKS The livestream on YouTube (https://youtube.com/live/G8LulD72kzs?feature=share) Allen Downey on Github (https://github.com/AllenDowney) Allen's new book Probably Overthinking It! (https://greenteapress.com/wp/probably-overthinking-it/) Allen on Twitter (https://twitter.com/AllenDowney) Prediction-Based Decisions and Fairness: A Catalogue of Choices, Assumptions, and Definitions by Mitchell et al. (https://arxiv.org/abs/1811.07867) Get full access to Vanishing Gradients at hugobowne.substack.com/subscribe
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
SPEAKER_00Hey there, it's Hugo Bowne-Anderson here, and welcome to the final episode of Vanishing Gradients for 2024. Today, I'm speaking with Alan Downey, a curriculum designer at Brilliant, Professor Emeritus at Olin College, and the author of ThinkPython, ThinkBase, ThinkStats, and many other computer science and data science books. In 2019 to 2020, Alan was also a visiting professor at Harvard University. He previously taught at Wellesley College and Colby College and was a visiting
SPEAKER_00scientist at Google. He is also the author of the recently released book, Probably Overthinking It. Today, we'll be talking about his new book and the key statistical and data skills we all need to navigate an increasingly data-driven and algorithmic world. The goal really will be to dive deep into the statistical paradoxes and fallacies that get in the way of using data to make informed decisions. For example, when it was reported in 2019 that in the United Kingdom, 70 plus percent of the people who die now from COVID are fully
vaccinated.
SPEAKER_00This was technically correct, but the implication was entirely wrong. Our conversation will jump into many such concrete examples to get to the bottom of using data for far more than lies, damn lies and statistics. We'll jump into information and misinformation around pandemics and the base rate fallacy. The tools we need to comprehend the small probabilities of high-risk events such as stock market crashes, earthquakes and more. The many definitions of algorithmic fairness, why they can't all be met at once and what we can do about it.
SPEAKER_00Public health, the need for robust causal inference and variations on Berkson's paradox such as the low birth weight paradox. An influential paper found that the mortality rate for children of smokers is lower for low birth weight babies. We'll also dive into why none of us are normal in any sense of the word, both in physical and psychological measurements, and the inspection paradox, which shows up in the criminal justice system and distorts our perception of prison sentences and the risk of repeat offenders. So a bit of bookkeeping before we jump in.
SPEAKER_00I'd honestly love to hear from you about what resonates with you, what doesn't, and anybody you'd like to hear me speak with, along with topics you'd like to hear more about. The best way to let me know currently is on Twitter. At Vanishing Data is the podcast handle, and I'm at Hugo Bowne. It would be great if you could subscribe to the show on your app of choice, and if you like it, do write us a review on iTunes and or anywhere else. Also, this episode was recorded as a YouTube live stream, so when we occasionally refer to people commenting in the chat, that's what we're on about. We plan to have more such live streams, and you can subscribe to our channel to keep up to date.
SPEAKER_00The link's in the show notes. We also did some live coding at the end of the recording, and although some of it relies on visuals, much of it can be grokked through the audio, so we left it in. If you want to watch it though, do check out the video. I'm your host, Hugo Bowne-Anderson, and welcome to Vanishing Gradients.
Ooh.
SPEAKER_00So welcome everyone. Thank you for joining wherever you're joining from. I'm going to say introduce Alan and then we'll jump in and Alan can either correct me or add anything to my introduction. Alan is a curriculum designer at Brilliant, professor emeritus at Olin College and the author of many books. You can see one of my favorites behind him, ThinkBase, also author of ThinkPython, ThinkStats and other computer science and data science books. Alan has self-published a lot of these books with your Green
Tea Press, correct? And then everyone got so excited about them that O'Reilly really wanted to republish them and help you get even more awareness around all the work you're
SPEAKER_00doing. Is that correct?
SPEAKER_02Yeah, that's right. A lot of them started out projects just for fun, and then some of them take off, and I publish the book. And some of them I then work with a publisher, and O'Reilly and No Starch Press is one of the other publishers I've worked with. They work with free books, so they understand this publication model where there's a free version that's online, but also published versions where they sell hard copies and also electronic versions.
SPEAKER_00Fantastic. And what we'll do as well is link to your GitHub where people can find a lot of all these books and resources. Then in 2019 to 2020, Alan was a visiting professor at Harvard, previously taught at Wellesley College and Colby College, and was a visiting scientist at Google as well. An illustrious history, but I'm really excited to have Alan here because... When I put this announcement live, I refer to it as the upcoming book, probably overthinking it. But in between announcing this live stream and today, your book has been released last Thursday.
SPEAKER_00So congratulations, Alan.
SPEAKER_02Thank you. Yes, I'm very excited. People, if they've pre-ordered it, should be getting copies soon. And I've got my copy.
SPEAKER_00Fantastic. And so we're going to talk about a lot of things today, but many things we're going to dive into. Statistical thinking, statistical literacy, how to think about and work with data to guide decision-making and learning about the world and thinking through some of the common paradoxes we see and fallacies that get in the way of using data to make informed decisions. So maybe without further ado, as we've said already, you've worked on a lot of different things. So I presume there are many books you could have spent your time writing.
SPEAKER_00So why did you choose to write this book in particular? It's partly a reaction to the seesaw of enthusiasm for data science and then a bit
SPEAKER_02of a backlash starting around 2016. I think people became very pessimistic about what we do with data and algorithms. And of course, there was a lot of talk about the post-truth world that we live in now where the facts don't matter. And I don't believe that. I think that we can still use data to answer questions and to settle arguments. And that if we do, we make better decisions and we're better off for it. So part of what I wanted to show in the book is an optimistic
message that says we can do this. We can answer questions with the caveat that sometimes it's a little bit tricky. And I ended up focusing a lot on statistical paradoxes and other examples where
SPEAKER_02things just don't behave the way we expect. And so it takes a little bit of work to get your head around it and to figure out what's going on.
SPEAKER_00Yeah, absolutely. And one example, which you essentially opened the book with, maybe in the third or fourth paragraph or second or something like that, which we'll get to, is in 2021, it was reported that in the UK, 70 plus percent of people who die now from COVID are fully vaccinated. And you make clear that this was correct, but the implication was entirely wrong. And we'll see how that played out and why that happens. And I suppose the teaser is if a hundred percent of people are fully vaccinated,
SPEAKER_00then everyone who dies will be fully vaccinated. Right. So we need to think about what that base rate of vaccination is and how that fallacy then plays out. I am glad that you mentioned 2016 because you and I have been talking on and off about this type of stuff for years now. And you and I did try to reason through after 2016 and There was all the algorithms at play that were doing a lot of things in people's lives, but then there was what seemed like the surprise result of the 2016 election in the United States. So even thinking about how journalists express uncertainty
around predictions and
SPEAKER_00these types of things statistically is quite challenging, right? Yeah.
SPEAKER_02Yes, definitely. And I remember we talked about it at the time, and I think there were at least two things going on. And one were the different models that were generating predictions, and they were based on different assumptions. And some of those models clearly did better than others. But then the other is the interpretation of a probabilistic prediction. If someone says there's a 70% chance that something is going to happen, okay, that's likely, but it is not a sure thing by a long way.
SPEAKER_00Absolutely. And you actually gave a very nice example in a blog post that I state time and time again now, which is if something has a 75% chance of occurring, That's a 25% chance of not occurring. We may think 25% is small, but that's like flipping a coin twice and seeing two heads, which would not surprise any of us. And in all honesty, a 10% chance of something occurring is close to 12.5, which is the chance of flipping a coin three times and seeing three heads.
And although I wouldn't necessarily expect that, if I saw it, I wouldn't be so surprised.
SPEAKER_00And I certainly wouldn't bet strongly against that happening, right? Yeah.
SPEAKER_02No, absolutely. And in fact, this is a case where maybe Australians have an advantage because if you ever play two up, you have a really good idea what the probabilities are for two heads.
SPEAKER_00Oh, don't tease me, Alan. Two up is one of, well, Anzac Day is a very important day in Australia. If anyone looks to see what two up is, it's a game we play mostly at pubs, but it's one of the only unregulated mostly unregulated, where there isn't a casino or a deal you go through. So someone's flipping two coins from a paddle and you're betting with people around you. So it's some form of decentralized gambling, which works at the start of the day before people have had too much to drink, but then it can get pretty serious.
SPEAKER_00So one thing I do really admire and appreciate about your book is... how you ground it in all the work in so many real world examples that are really important from public policy to health. And so these are things I love. I also love how you have a very hands-on approach to data, connecting data to knowledge and decision-making. And I'm wondering what motivated this approach to always get your hands, get hands-on and get dirty with data. I think a lot of ideas... If you take a statistics class,
you might see a lot of mathematics.
SPEAKER_02And that's one way to explain these ideas, and it works for some people. But I think a lot of people come away from that class with just no idea how it applies in the world. They're not seeing it in their lives. If you approach the same topics with data... Those ideas, I think they become clear because they're connected to a context. You know what's happening. You know what it means. The mathematics is mostly counting. If you want to know how often something happens, you want to compute a probability, you can look in a data set and just count how often it happens.
SPEAKER_02So I ended up, there's almost no math in the book. And that's not because I was trying to avoid it because I thought the audience couldn't handle it. It's just I didn't need it. When you look at the data, I think things are just clearer.
SPEAKER_00Absolutely. And I still remember my background, among other things, is in biology and biophysics and cell biology and biology. When I was teaching both in Germany at the Max Planck Institute, then at Yale in New Haven, not so far from you, a lot of the courses would teach first-year biologists they needed to learn statistics and it would teach... the central limit theorem using the calculus, right, which is a mind-boggling approach. And I understand for historical reasons why that's the case,
and it's somewhat generational. But once you actually show someone a data set that's of interest to their work or
SPEAKER_00their life, and then show through sampling, for example, how the central limit theorem emerges through bootstrapping, let's say, then it's quite apparent. And you see these aha moments, these light bulbs almost immediately, right?
SPEAKER_02Absolutely. I think randomization methods like bootstrapping are great, again, just because it's a very simple idea. In calculus, I see this question a lot. People say, I want to get into data science. Where do I start? And people will answer and they'll say, oh, we'll start with calculus. I think that's terrible advice. It's neither necessary nor sufficient.
SPEAKER_01Yeah.
SPEAKER_02Again, when you're working with data, the idea of an integral is a cumulative sum, which is, I think, an idea you can get your head around. And a derivative is just the difference between consecutive elements in a sequence. These are simple ideas. When you do them computationally, they're one-liners. You want to compute a cumulative sum? It's numpy dot cumulative sum. No calculus required.
SPEAKER_00And one thing that I think is fantastic about your book, I'm interested in who your target audience is because from when I read it, I thought there are lots of people who aren't necessarily, not only do they not know the calculus or multivariate calculus or linear algebra, but they probably don't know a lot about statistics and they could get their head around a lot of the examples. So who are you shooting for?
SPEAKER_02Yeah, that's my intent. This one is really for a general audience. Most of my other books are textbooks. They have Python code, and they get into a lot of technical detail. This one does not. No code, no mathematics. But when I say general audience, I do mean people who are willing to think a little bit and spend some time looking at a figure and decoding it. It's definitely going to take a little bit of work. But I'm seeing this now in newspapers and magazines.
SPEAKER_02People are doing sophisticated data visualization, especially online interactive data visualizations, where I think they're really pushing the audience to figure these things out. And I think that's who I'm really aiming for. If you enjoy reading data-driven journalism, my hope is that you'll like this book.
SPEAKER_00And two, that spring to mind that we've discussed before, 538 and the Upshot in the New York Times, which are both fantastic. Are there any others that spring to mind?
SPEAKER_02Yeah. No, those are great. I think The Economist is doing some of the best data journalism around right now. They have a weekly feature where they generate data visualizations that are often really custom representations to communicate difficult ideas. And they're often doing original research. They will commission a survey to get data. And then if you contrast that with he said, she said journalism, where the journalist's job is to just report what people are
saying and they don't
SPEAKER_02try to figure out who's right. This is almost the opposite extreme. This is journalists doing research papers, fact-checking the people they're talking to, generating original work. So I think that's exciting. A lot of online blogs doing that. Washington Post is another example. They collect a lot of data sets. At this point, I believe the Washington Post has a better data set for crime in the United States than the FBI does because they recognize that it was incomplete
and they started
SPEAKER_02generating their own.
SPEAKER_00Wow. Is it an open dataset?
SPEAKER_02I believe so. I haven't looked at it for a little while. I think one of the first datasets they were looking at were interactions with police that ended in violence. And that FBI dataset on that one was very incomplete. Since then, I think they've started collecting more crime data.
SPEAKER_00You open your book by saying, we are better off... when our decisions are guided by evidence and reason and that firstly i totally agree then you go into give heuristics or definitions of how we can think about what these terms mean but we are better off but then as you got to point out and this is a large project within the book is where can we go wrong so what type of fallacies and paradoxes can lead us astray when we're not when we're not careful here
SPEAKER_02Yeah. And this is where I think I might be contradicting myself because I start by saying this does not have to be hard. Sometimes the data almost speak for themselves and you can just see what's happening. But then I spend an entire book talking about all the cases where things are tricky. And partly it's just because I think it's interesting that But partly it's a kind of training. The more you think about these things, the more likely you are to recognize them when you see them in your life or when you read them in a newspaper or a magazine and you see somebody
making an argument
SPEAKER_02that doesn't hold water. Once you start thinking about these things, you start spotting the errors.
SPEAKER_00Yeah. So what are the most important or most what's the first fallacy or paradox that you think people should know about and be able to spot?
SPEAKER_02I think a good one, this is chapter two, is about the inspection paradox, which is another name for length biased sampling. And it's very often a case where the probability that you observe something depends on the size of the thing. And size might mean a physical extent or a duration in time. Or one of my favorite examples to start with is the size of a class, the number of people in a class. where if you go to a college campus and you want to know how big the class sizes
SPEAKER_02are, this is something that the college has advertised. They'll say, our average class size is 30. And you look at that and you think, oh, this is great. I'm going to go there. I'm going to experience a lot of small classes where I interact with the teacher and the other students. And then you get there and it's giant lectures, 200 people, 300 people. And you think, wait a minute. I read the brochure. It said 30. Why am I sitting here in a class with 300 people? And it turns out this is an example where you see very
different averages depending
SPEAKER_02on how you do the sampling. So if you're the dean of the college and you're computing the average, you would have a list of classes. And so you would sample each class once and you would compute that average. And it might be 30. But then a student, if you think about, you walk onto campus, you choose a student at random, and you ask them, okay, what class are you on your way to? Physics. How many students are there? 300. Okay, so you write that down.
SPEAKER_02And you do that sampling process. The average might be more like 90. And the reason is that you are oversampling large classes because every time you do that sample, you have 300 chances that you might choose somebody who's in a 300 person class. But if they're in a 10-person class, there are only 10 of them walking around, you are much less likely to observe them. So it's a kind of sampling bias because it's not a representative sample,
SPEAKER_02but in particular, it's length biased because it's directly proportional to the size of the class.
SPEAKER_00Fantastic. I really love that explanation. And also, it's just great to hear an example of sampling bias, which doesn't involve an image of a World War II plane as well. But also, I think for people who haven't really encountered this type of quote-unquote paradox, and by paradox, it seems paradoxical, but then when you tease it all out, we remove the paradox, right? And perhaps you could show the cover of your book again? Yes. Yes. And as we were discussing before we started,
SPEAKER_00you have this chaos up the top, which can be, maybe these are the paradoxes, which once you do the work and develop these types of explanations, figure out what's happening, you un-tease all the threads and you get order from the chaos.
SPEAKER_02Yes, that was the intent. And maybe someone looking at that cover won't get it immediately. But that's what I try to do in every chapter is to start with something that is surprising, counterintuitive, paradoxical. And then you're right. By the time you explained it, when you really understand it, it's not a paradox at all. None of them are really paradoxes. They are misunderstandings. It's that... You assumed, for example, in class sizes that we were just talking about,
that the average when you talk to the dean and the average when you talk to a
SPEAKER_02student should be the same. And if they're not, that seems paradoxical. But then once you're aware of length biased sampling, you're like, oh, yeah, of course.
SPEAKER_00Yeah. And what I find fascinating is that this is not just a one-off. It isn't as though this only occurs when you talk to a dean and a student. I remember years ago, firstly, you gave a talk about this at PyData NYC, and then you had a wonderful Twitter thread where you're encouraging people to figure out if they had encountered the inspection paradox and length bias sampling in their lives. And two examples that you discuss in the book, which I think are really important, are the criminal justice system, and how length bias sampling distorts our perception of prison
sentences and the
SPEAKER_00risk of repeat offenders. And then you're a runner. So relay races as well. So maybe you could tell us a bit about these examples and how length bias sampling generalizes across the board here.
SPEAKER_02Sure. Yeah, the relay race, that's one of those examples where it occurred to me in real life that I was running a race and several people ran past me very fast. And then I overtook a couple of runners and I... actually went through this thought process. I was like, maybe this is a funny race where it really attracts fast runners and slow runners, but there's nobody in the middle like me. And then I realized, of course, that if somebody else is out on the course, if they're running at the same speed as me,
SPEAKER_02I'm not very likely to see them. But if they're much faster, there's a high probability that they'll overtake me during the time that I'm out there. And if they're much slower, I'm more likely to overtake them. So there's this V-shaped filter that's happening where the probability that I see someone is proportional to the difference between their speed and mine. And it's the same on the highway. Everybody, oh, there's a crazy person going too fast. Oh, there's a person who's going way too slow. There's nobody else out here who's driving at a reasonable,
safe speed like me.
SPEAKER_00Exactly. And of course, the limit case is if someone's driving at the exact same speed as you and you're 100 meters apart or whatever it is, you'll never pass each other because the difference stays the same. It's constant, right?
SPEAKER_02So that was one example. Now, maybe that's not a big deal. That's just maybe a misunderstanding of the world. But the criminal justice examples that you gave, those matter. And one of them is the example of estimating recidivism, which is the probability that if someone is released from prison, that they will be arrested and maybe incarcerated again in the future. So if someone is a repeat offender, they are a recidivist. So What you think the recidivism rate is depends on how you do the
sampling.
SPEAKER_02Because if you follow individuals, so if you chose a cohort of people at the time that they are convicted for the first time, And that's actually important. If you sample first-time offenders and follow them over time, you will get the individual-based recidivism rate, which is the fraction of people, of all the people who commit one offense, what fraction of them ever commit another offense? But if you sample by going to the courtroom and watching cases go by,
SPEAKER_02or if you sample by observing people when they are released from prison, that is an event-based sample. And someone who commits more than one offense is more likely to show up in that sample.
SPEAKER_00Yes. If they commit 10 crimes, there are 10 chances for them to show up in that sample. So if you oversample recidivists, you will overestimate the rate of recidivism Which is important because that's a political argument that people make all the
SPEAKER_02time in favor of being tough on crime. They'll talk about revolving door prisons. And this is the idea that people, they're career criminals. If you let them out, they're just going to commit crimes again. And the data don't support that if you look at it at the individual rate, not the event-based sampling.
SPEAKER_00That's fascinating and incredibly scary as well, right? And I presume it's heavily politicized, as you've hinted at, that when people want to be tough on crime, they can state these things in a particular fashion, a particular recidivism rate, due to the inspection paradox of bias sampling, which will make their arguments stronger.
SPEAKER_02Yeah. And the most common number that you see reported is, in a sense, the wrong one. It's the event-based because it's an easier sample to collect. And if you're not aware of this effect, you wouldn't even think about the experimental design. But at least one of the samples that I looked at, it was a substantial majority of people who were one and done, one-time offenders.
SPEAKER_00Yeah. So- Several other paradoxes and fallacies that I want to get to. One that I think is important, particularly because it rears its head in epidemiology, which of course is key, is Berkson's paradox, and perhaps by extension, Berkson's toaster. So maybe you can tell us a bit about this paradox.
SPEAKER_02Sure. Let's see. I was thinking about which example to start with. I think the low birth weight paradox is a good one. This was one of the first cases that was reported. It was a researcher in California who was looking at babies who were born below 2,500 grams, which is a cutoff for low birth weight. And in the study, they found all the things that they expected, which is that the babies of mothers who smoked were more likely to be low birth weight and the mortality of low birth weight babies is higher.
SPEAKER_02But then because the focus of the research was low birth weight babies, they selected just those. And in that sample, they checked to see who's more likely to survive, the baby of a smoker or the baby of a non-smoker. And it turns out that the babies of smokers, the lightweight babies of smokers, had better outcomes than lower mortality. And that's the paradox. No one expects that. And they were desperate for an explanation.
SPEAKER_02Is there some mechanism where for normal babies, normal birth weight, Maternal smoking is bad, but if the baby is low birth weight, for some reason, maternal smoking has a protective effect. It's beneficial in some way. They didn't know. And it went unexplained for about a decade and then really not a proper explanation for about 20 years into the 90s.
And it was used as well for people to claim that smoking maybe isn't as bad as we
SPEAKER_00thought it was.
SPEAKER_02Yeah, it was the article got picked up in the media and people reported, hey, maternal smoking, maybe it's not so bad after all. The researcher sent a letter to the U.S. Senate when at the time that they were considering restrictions on smoking that was motivated, of course, by the negative health effects. I saw a retrospective article that said that this one piece of research probably slowed down the effort to reduce maternal smoking by a decade.
SPEAKER_00So seriously, real world impacts, very dangerous. So has this been resolved?
SPEAKER_02It has.
SPEAKER_00It has.
SPEAKER_02And the explanation once you hear it is, I won't say obvious, but it does make sense once you get it, which is there are a number of things that can cause low birth weight. Smoking is one of them, but birth defects are another. And if you select all of the low birth weight babies, some of them have mothers who smoked, and some of them have birth defects. Now, having a mother who smoked is not great. It is probably detrimental.
SPEAKER_02But having a birth defect is, on average, averaged across all of the things that can go wrong, is substantially worse. Here's one way to think about it, which is if you are a doctor and you are called to consult on a case because a baby is born low birth weight, and you start to read the details of the case and that the mother is a smoker, you might be relieved because that explains it. And it is a relatively benign explanation of low birth weight. And because maternal smoking explains the low birth weight,
SPEAKER_02that means that the other explanation is a little bit less likely. It is less likely that there's a birth defect. And it's actually, it's the same if the mother is short, The baby is more likely to be lightweight, but that has no negative effect. If the baby is born at high altitude, same thing. So that's the explanation. Here's the analogy that I make that I hope helps with this is Berkson's toaster, which is if you're at home and the smoke alarm goes off and you smell smoke and you
SPEAKER_02go into the kitchen and that there's some burned toast in the toaster, you would be relieved that Because burnt toast isn't good. There's nothing good about burnt toast, but it's better than almost all the alternatives. Of all the things that could cause your smoke alarm to go off, burnt toast is probably the least bad. And so in that sense, it's good news.
SPEAKER_00Fantastic. And Berkson's paradox does rear its head in so many places. I think one of the first examples I saw was... that talent and attractiveness are generally not correlated in the general population, but in celebrity culture, talent and attractiveness are negatively correlated. And people are like, why is this the case? And I think the argument is that you've got to have one of these, right? Something along those lines. If you're not attractive and you're a celebrity,
SPEAKER_00you'll probably have some sort of talent in some dimension. And I think maybe you give an example about looking at your dating history in your book as well. Is that right?
SPEAKER_02That is, I borrowed that one from, I think it's Jordan Ellenberg's book. And that was his example, which is the triangle of dating, which it's very similar to your example, which is that some people are attractive and some people are nice. And if someone is neither attractive nor nice, then you probably won't date them. And if they are both attractive and nice, they're probably too good for you. So of the people that you find in the dating pool, it tends to be one or the other, but not both.
SPEAKER_00Exactly. So these are all ways to start thinking more robustly statistically. Statistical thinking is clearly important, but our life is ruled more and more by algorithms as well. So I think thinking about statistical thinking and algorithmic thinking is important. And one of the places this shows up is in the case of algorithmic fairness. And you do have a section in your book talking about algorithmic fairness, but something you make clear is that there are actually... There's more than one definition of algorithmic fairness,
SPEAKER_00and they can't all be satisfied at once, right?
SPEAKER_02No. And this is a place where I think having some understanding of the data and the mathematics here directly informs our thinking about algorithmic fairness. And one of the examples going back to 2015 was an exchange between ProPublica and the Washington Post. And it started with ProPublica, which wrote an article about systems that were being used, again, in criminal justice to make decisions about who would be released from prison or who would have to stay incarcerated.
SPEAKER_02Now, clearly, you would like to make predictions there about who is more or less likely to commit another crime if they are released. And so they were using a machine learning algorithm to make those predictions. And what ProPublica looked at were the error rates for false positives and false negatives. And they found that the error rates were different in different racial groups. And in particular, African-American defendants were more likely to get a false positive,
SPEAKER_02which is that they would be given a high risk score, even if they did not go on to commit another offense. And white defendants were getting a higher rate of false negatives, meaning a low risk score. And then they did go on and commit another offense. So the reaction to the article is what makes sense, which is that that sounds obviously unfair. What the Washington Post pointed out is that, yes, ideally, you would want those error rates,
SPEAKER_02the false positive and the false negative rate, to be the same. But you would also want the risk score to be calibrated so that, let's say that you get a high score, there should be the same probability that person commits an offense in each group. So those are the predictive values. The positive predictive value means if you get a high score, what's the probability that you commit another offense? The negative predictive value is if you get a low risk score,
SPEAKER_02what's the probability that you in fact do not commit an offense? Now, you would want those things to be equal as well. And it turns out actually that for male and female defendants, they are not. That if you have a male and a female defendant with the same risk score, the female defendant is much less likely to commit an offense. So by that metric, looking at predictive values, The same machine learning algorithm is unfair to women.
SPEAKER_02So you would think, okay, let's fix it. Let's have the same error rates, false positive and false negative. And let's also have the same predictive values for all groups. with this algorithm. And the math tells you, you cannot have both. If there are differences between the groups in the prevalence, whatever the condition is, in this case, it's committing another offense. If different groups have different rates of re-offense, you cannot have all of those different definitions of fairness
at the same time. I want to point out that we started thinking about algorithmic fairness and
SPEAKER_00algorithmic thinking, but the fact that these two definitions of fairness can't be satisfied simultaneously has nothing to do with whether it's algorithmic or not, right? It's purely a statistical. And so this holds given there are lots of important challenges with our algorithmic fairness, in particular, things encoded in computation, how scalable they are, black boxes, all of these types of things. But this is something which holds in the criminal justice system, regardless of whether the decisions are made by machines or humans.
SPEAKER_02That's right. Humans have the same problem, and it's any decision-making process. And in this case, it doesn't matter if you have human judges or if you have a hybrid system where you take the result from the algorithm and then a human makes decisions. You are fighting the inevitable force of mathematics. How do we solve this? I think we do need a different idea of what the criteria are. What are the requirements for fairness? Our intuition here might be misleading.
We either have to accept that nothing is fair, which I suppose that is true.
SPEAKER_02The world is not fair. Or have a different idea of what the requirement is for an algorithm like this. So, for example, transparency is a different criterion. Transparency is not about the outcomes in terms of error rates. It's about how we build the system and who is included in designing it. And does everybody know what the rules are? Because I think one of the objections to this particular
machine learning algorithm
SPEAKER_02is that it was proprietary. It was made by a for-profit company. It was a trade secret. And so if you are a judge making decisions or a defendant whose life decisions are coming out of this algorithm, If it's completely opaque and you have no idea why you are being put into a high-risk category, that seems like a kind of unfairness as well. So we might not be able to fight mathematics, but transparency is something that we can have.
SPEAKER_00Absolutely. And something I'll link to in the show notes, I've got some old friends who thought about different aspects of this a lot. An old friend of mine, Shira Mitchell, who now works on political campaigning and Blue Rose Research. for the Biden campaign in particular, actually. But she did some work thinking through opening up the decision space as well. And part of the problem here is that this algorithm was used to decide whether people go to jail or not. And that part of their work was thinking of this not only in that binary state, but thinking about
Perhaps if we use the information we have to open up decisions around social
SPEAKER_00intervention and rehabilitation and these types of things, right? So thinking more about what types of decisions we can make as opposed to merely do we incarcerate someone or not, which I think recontextualizes everything in a more social framework as well.
SPEAKER_02Yeah, absolutely. I think, as you said, opening up the decision space, that's not going to completely solve the issues because at some point there are binary decisions. People either do or do not go to jail. So that part is hard to avoid. But yes, I think having more options that are available to you, more of a continuum, especially to handle the tricky in-between cases.
SPEAKER_00Exactly. So I think something that's been inherent in a lot of this conversation that we haven't talked about explicitly is causal inference. So one example, if people know a bit about causal graphs and that type of stuff, Berkson's paradox can be reframed as collider bias, right?
SPEAKER_02Yep, exactly.
SPEAKER_00Please.
SPEAKER_02And I was going to say that's part of what happened in that case is, as I said, the original research was from the 70s. In the 80s, there was an explanation that was based on a computer simulation that showed that it was possible to explain the outcome. But the real kind of punchline came in the 90s with a paper that used a causal diagram. And in that, you could see the two arrows you would have in the middle of the figure was low birth weight and an arrow from low birth weight to mortality.
But then there are two arrows that come in to low birth weight, because there are two causes. Could either be maternal smoking or other, and other might often be a birth defect.
SPEAKER_02So as soon as you see two arrows going into one box, in the vocabulary of causal inference, that's a collider, because it's like these two arrows are colliding. And if you select on a collider, either by sampling, deliberately sampling, in this case, low birth weight babies, Or in a regression model, if you add a collider as a control variable, you're thinking it's a control variable, but what you're actually doing is biasing the results. And in both cases, you can get what seems to be a causal relationship,
SPEAKER_02like maternal smoking is beneficial for low birth weight babies, that is, in fact, not a causal relationship.
SPEAKER_00I love this because I don't love that example. I love the example. It's illustrative. I don't love that. That's what happened. But I think this is because where I want to go with this is if we're making decisions, how important is causal inference to that and how elusive is it? And I think that example is illustrative because doing some quote unquote, almost obvious causal inference leads you to the wrong conclusion. because you haven't done it correctly. And causal inference is really tough as well. So I'm wondering how important it is to actually making decisions.
SPEAKER_02Anytime you are intervening, You need to understand causal relationships. If you're not intervening, if you're only trying to make predictions about a system that you have no control over, potentially you could make predictions without worrying about causation. You might be wrong in the future if things change, but at least in the present, you could do okay. That's the one example I can think of where... Maybe you don't really care about causation. But anything in medicine, if you are planning to intervene,
SPEAKER_02you are fundamentally asking a counterfactual question. What would happen if I do this? And what would happen if I don't do this? And what's the difference between those? And so those are fundamentally causal questions. But as you say, it is not easy. I think in some sense, we are all... just starting to figure it out. A lot of the methods are relatively new. A lot of people, if you graduated from college 10 years ago or more, you probably have no exposure to this.
SPEAKER_02So we're all playing catch up on causal methods. To me, it seems like there's almost a two cultures challenge in causal methods as well. We have causal graphs a la Pearl, which can be incredibly instructive and useful.
SPEAKER_00And we have the econometrics on the other side. Do you see that kind of two worlds thing or... two cultures.
SPEAKER_02Yes. And I hesitate to talk about it because I'm not going to get it right. But yes, there are a couple of different approaches out there and they are different. I'm just, I'm not enough of an expert to know if they are compatible and maybe that's different vocabulary for the same idea or if We still have some work to do to figure it all out. I said a minute ago, we're all catching up and I'm included. I am a beginner in causal inference.
SPEAKER_02I do think that there's a lot of leverage from getting started, which is drawing causal graphs, causal graphs, diagrams and some of the vocabulary that comes out of that, like colliders and backdoor paths and mediators. I think if that's all you learn, because I don't want people to be too scared of causal inference. I think if you learn those fundamental ideas, That goes a very long way to avoiding the kinds of errors that
we're talking about,
SPEAKER_02because you'll be aware of collider bias. You'll be aware of what happens when you either control for a mediator or don't, because you want to estimate the total effect or the indirect effect, direct or indirect effect. So again, I'm still not quite getting the vocabulary right. As I say, I'm a beginner here, But I'm encouraging people to start the path because there's a lot there and it's super important.
SPEAKER_00Absolutely. So I think something we do need to talk about, distribution, because when we collect, we want to see certain properties of it and there are certain types of shapes to data. I'm trying to not use the word distributions yet. Certain shapes to data that we collect that have properties that other sets do as well and patterns emerge. When things are patterned similarly, maybe we can describe them using more distributions. And one of my favorite blog posts ever, which whenever I teach statistics,
SPEAKER_00pretty much I send people to it, which is your post. I'm pretty sure it's called, are your data normal hint? No. Something along those lines. Of course, the question I want to ask now takes a slightly different approach to a similar question, but the Gaussian distribution is one that's incredibly... So I'd love to hear from you, firstly, why the Gaussian seems to crop up every... And then you've got this wonderful chapter on the way that none
of us are really normal and the fact that we're all equally weird for some definition of these
SPEAKER_00things. So maybe you can tell us about the Gaussian distribution, then jump into why none of us really set us kind of outliers, if you will.
SPEAKER_02Sure. Yeah.
SPEAKER_00All of us are outliers.
SPEAKER_02All of us are outliers. That's right. There are a lot of things that we measure in the world that are well modeled by a Gaussian distribution. And one example in the chapter comes from anthropometry, which is measuring people. And if you measure height and weight and the length of people's arms and ankles and everything that you might want to measure, physical measurements, actually psychological measurements as well, a lot of things look Gaussian. They look like the bell curve. And there is an explanation for that, which is the central limit theorem,
SPEAKER_02which is mathematically, if you draw a sample from identical distributions and they have certain properties and so on, and you add them up, the result, the sum, tends to converge to a Gaussian distribution. And that's not literally what's happening in the world, but anytime you have a lot of random effects and the total thing that you measure is like the sum. And you can think of like human height as an example. There are many genes and many environmental factors that will
determine someone's height. And each one of those little factors might add a centimeter or subtract a centimeter. And so when you add them up, you get a distribution of human height that actually...
SPEAKER_02fits a Gaussian distribution very well. So they're ubiquitous for that reason. And we have an intuition for them, which is if you look at a bell curve, most people are close to average, and then there are a small number of people that are out in the tails. And so we have an intuition that says that being close to average is normal, and being out in the extremes is weird in some way. And that is true with one measurement, but then you get this weird counterintuitive behavior when you
look at a large
SPEAKER_02number of measurements there are now a lot of ways to be weird. So you might be unusually tall, but you also might have an unusually long width between your two ankle bones, which is one of the measurements in this data set. And obviously some of those things are more noticeable than others. But if there are a thousand different ways to be weird, what you find is that first of all, nobody is close to average on all of them. So in that sense, nobody is normal.
SPEAKER_02Everybody is going to be unusual in at least one and probably many ways. So everyone is weird. And if you now compute the distance from the origin, if you compute some metric of weirdness on how many different measurements are you far from average, it turns out that it converges to... a very common distance, that everybody is roughly the same distance. Everybody is the same amount of weird. If people are familiar with multivariate distributions,
this is the thin shell result that says that almost all of the probability density in a multivariate distribution is in a thin shell that is far away from the origin.
SPEAKER_00Yeah. And also to that point, but you add more and more dimensions and it all fills out to the shell and there's virtually nothing in the middle.
SPEAKER_02That's right. That's right. If you try to count how many people are within one standard deviation of the mean on a thousand different measurements, it's approximately zero.
SPEAKER_00I am very interested. So the Gaussian distribution, incredibly important, perhaps not as important as we were, I mean, as like the one thing, also known as the normal distribution. I'd like to hear just about a couple of other distributions from you, which I think will be instructive. One being the log normal distribution, and then perhaps we can reason through the black swans and what type of long tail distributions we see there. So unlikely, but high risk events.
SPEAKER_02Right. Yeah. And this was the progression in the book. I start with Gaussian and then I have a chapter about log normal in part motivated by adult weight. It turns out of all these measurements, almost all of them fit a Gaussian except weight, which is skewed to the right. There are more heavy people than you would expect if it were Gaussian. And it turns out if you take the logarithms of the weights, the logarithms fit a Gaussian.
SPEAKER_02And that means that the weights themselves fit a log normal. And I proposed there are two mechanisms that I think can generate these log normal distributions. And one of them is in the same way that when you add things up, you get a Gaussian. If you multiply a bunch of random factors, you get a log normal. And one of the ways that happens is proportional gain. So if over the course of your life, you have a tendency to gain or lose an amount of weight that is
proportional to
SPEAKER_02your current weight, and it seems like that is, in fact, what happens, then what you can think of that is each time step is a random multiplicative factor. And when you multiply a bunch of them together over the course of your life, you're going to see a log normal distribution. And what that means is that the tail goes farther out to the right than we expect. This also comes up whenever we measure a capability that develops over the course of your life,
SPEAKER_02like the ability to play a musical instrument or in athletics, in programming. In many fields, you are gradually getting better over the course of your life. And as you get better, you learn to learn differently. And you have access to teachers and resources and interactions with more and more people. So your learning rate accelerates. If you're an athlete and you start competing at a higher level
against better
SPEAKER_02opponents, you will get better fast. So we are born, a lot of our talents, I think, are likely to be Gaussian. But our achievement over the course of a life is likely to be log normal. That's a possible explanation for why outliers are outliers. Because there's the athlete who, in addition to natural talent, has also been practicing over the course of their lives. They might have started with a small lead,
SPEAKER_02but they spent their whole lives lengthening that lead, extending out into the tail of the distribution.
SPEAKER_00Interesting. So then tell us about long-tailed distribution. I mean, these unlikely but high-risk events are really important as well, right? Like stock market crashes, earthquakes, these types of things.
SPEAKER_02Yeah, exactly. So that chapter is all about disasters. And it starts with the distribution of all natural and man-made disasters that had a cost of more than a trillion dollars. And it turns out to follow a very long-tailed distribution. So I said in a log normal that the tail extends farther out to the right than we expect, these distributions, and the student T is one of the ones that I looked at, they have a tail that is much farther. They make a log normal look like nothing.
SPEAKER_02And our intuition cannot keep up with it. The example that I give in the book is long tail world, where the distribution of height follows a long tail distribution. And it has the same 20th percentile and the same 80th percentile as the distribution of height on Earth. Except when you wake up in long-tailed world, what you see is a few people who are normal height.
SPEAKER_02You would be unsurprised if you saw about 10 people. They would likely be between the 20th and 80th percentiles. But if you saw 100 people, one of them would be about 7 feet tall. And you think, oh, okay, that's a little surprising. And if you saw a thousand people, one of them would be 13 feet tall. And that's the point where you would realize that you were not on earth.
SPEAKER_00Something's happening. Yeah, exactly.
SPEAKER_02But that's just the first thousand people. If you then found the tallest person in the United States, they would be so tall that standing on the earth, their head would be one third of the way to the moon.
SPEAKER_00Wild.
SPEAKER_02And the tallest person on the planet, out of, let's say, seven or eight billion people, the tallest person on the planet would be 1,500 light years tall. If the distribution of height was the same as the distribution of disaster, the tallest person would reach from here to Betelgeuse three times over.
SPEAKER_00So when we're having these long-tail distributions... with high impact and high risk. What type of tools can we use to even comprehend these?
SPEAKER_02So in the book, I present a couple of ways to visualize these results. And in particular, I think the clearest picture for these very long tails is to take the survival curve, the tail distribution, on a log-log scale. And the feature of that is that you can see very small probabilities and you can see very high impact events. And in particular, if you now compare two models, If you apply a sort of a typical distribution to data that are
actually long
SPEAKER_02tailed, you will see that it falls catastrophically short out for those extreme values. If you are predicting earthquakes, you will greatly underestimate the probability of a magnitude nine earthquake. If you are predicting stock market crashes, They will happen much more often than you think if you use a short-tailed model. So there's a little bit of good news and bad news here, which is the good news is if you choose an appropriate model,
SPEAKER_02you will make better predictions. But the bad news is you are fundamentally fighting against the limitations of data. Because in order to estimate the probability of a very rare event, like one in a trillion, you need a data set that has a trillion observations in it. And sometimes you can collect data as fast as you want, but if you're looking at earthquakes or solar flares or stock market crashes, they happen when they happen.
SPEAKER_02And you could observe for 500 years and not have a trillion examples, which means that there are probably things happening in the tails of these distributions that are really fundamentally unpredictable. With all the data that we could actually practically obtain, we just cannot predict these very small probabilities. I really love that you mentioned the type of visualization that is useful in seeing
SPEAKER_00the discrepancies and the data here, because we're going to jump into a notebook soon to not look at this example, but have a look at some visualizations and the importance of visualizations. As you've already stated, a lot of what we're doing here is counting stuff, then doing some visualizations as well in order to see how the world corresponds to how we think it is so even recognizing that doing something on log log axes can be very instructive to see where our mental model doesn't align with
with the actual data i think is is very important so i'm excited to jump in in a minute i um before doing
SPEAKER_00that i do want to step step back a bit i think the The provocative version of my question is, do we have some sort of public awareness crisis concerning statistical thinking? I mean, even the fact that this book is, I think, as important as it is and necessary in a lot of ways means that perhaps people don't quite have the tools that they need yet. But public awareness crisis may be too strong a term. So I'm interested in your thoughts on that. Perhaps a provocative question.
SPEAKER_02Yeah, I go back and forth on this. Because again, thinking about 2016 and all the talk about post-truth and facts don't matter, that sounds discouraging. And if you go on social media and people making statistical errors and making invalid arguments... It's frustrating and it sometimes feels like, okay, people don't understand statistics as well as they need to. At the same time, you see a lot of data available now that would have been
unavailable.
SPEAKER_02Only professional researchers would have access to it. And public discussion around these things that... It is never perfect. But seeing people engage with difficult statistical ideas on social media, I think that's really promising. Because it's not just people taking a stats class once in their lives, forgetting everything about it, and never learning anything new. Messy, but I do see people learning.
And the example that I gave earlier about data journalism and the sophistication of
SPEAKER_02what we're seeing in mainstream media, but also even Twitter, which is maybe not the same kind of forum that it was a few years ago. Still, I do see good statistical conversations where people are struggling with difficult ideas. They're not always getting it right, but I think it's a good sign.
SPEAKER_00Yeah, absolutely. I do, I suppose also I'm thinking through, and we didn't actually go into the base rate fallacy. So maybe we can discuss that briefly, but the example of the base rate fallacy during COVID that such and such a proportion of people who've died are vaccinated and the implications of that aren't really what the data is telling us. So it seems like these, if people aren't educated around these types of fallacies, these types of Arguments can be weaponized.
SPEAKER_02Yeah. Actually, there are two examples in the book that come from the same journalist who wrote a book that collected a lot of bad statistics and made a lot of bad arguments. And he got a lot of publicity in particular for two episodes. And one of them is the one that you mentioned. He went on a very famous podcast and he cited a statistic from the National Health Service in the UK that said that at a particular time during the pandemic, 70% of the people who were dying of COVID had been fully vaccinated.
And he was using that to make the argument that the vaccine is possibly useless,
SPEAKER_02possibly even harmful. And it got a lot of attention. People repeated that statistic. So in that sense, it's very discouraging because I don't honestly know whether he was being deliberately misleading or mistaken. It doesn't matter. But he got a very broad platform. A lot of people heard what he said, and probably a lot of people were misled. On the one hand, that is bad. On the other hand... After that happened, on social media, there were many blog articles and explanations of people who
got it exactly right.
SPEAKER_02They pointed out the fallacy, which is what you alluded to earlier, which is at the time, 94% of that demographic that he was talking about had been vaccinated. And 70% of the people who died had been vaccinated. So what that means is that the vaccinated were underrepresented among the dead. And that means that the vaccine was effective.
SPEAKER_00Yes.
SPEAKER_02And in fact, if you do the math, which I do in the chapter, you can figure out not only how effective the vaccine was, but how many lives were being saved. And during that one month that statistic came from, the vaccine saved 7,000 lives in the UK alone, in just one country. So the same statistic that he cited where he implied that the vaccine didn't work. If you interpret it correctly, you can estimate 7000 people who are probably alive today who
would not be alive if
SPEAKER_02they took his advice and didn't get vaccinated.
SPEAKER_00I love that. Well, what I love is that, you know, I gave an example perhaps of where. You know, statistical literacy, there is a crisis around it. But what I'm hearing is that, sure, there are people, perhaps always be people who will say these types of things and suggest things that aren't necessarily the case. But then part of the jostle is other people come out and going, no, actually, look at this is what actually happened. And that conversation happening in public is net positive.
SPEAKER_02Yeah. And it's chaotic. It's messy. It's not always right. But I do think just the fact that those conversations are happening, the fact that anybody could go to the NHS website and download that data, and that every data set that I used in this book, they're all publicly available. I think just a couple of exceptions where I had to contact a researcher. But almost every case, I was able to go get the data and replicate previous results, check to make sure that they were correct, and then often extend them or update them or whatever the next step was.
SPEAKER_02Some positive signs and some reasons for concern.
SPEAKER_00Yeah, fantastic. So I think the time has come. I'd love to do a brief demo. I mean, you have all the notebooks from the chapters available online. And I'll actually put a link to those in the show notes as well. But do you want to share your screen?
SPEAKER_02I will. And we will provide the link. But also, if you go to probablyoverthinking.it, probablyoverthinking.it, that is the landing page for the book. And from there, you can get to everything that you want to see. So this is it. If you go to probably overthinking.it, you'll get to this page.
SPEAKER_00That's a great URL. I am grateful to the Republic of Italy for allowing me to misuse the domain name
SPEAKER_02service and pretend that I'm in Italy. And if you scroll down, I will point out, of course, that there are opportunities to obtain a copy of the book for yourself, but also a link to this GitHub repository, which you can also search for. And that will take you to a landing page that has the notebooks. And there are two options here. If you wanna just read one of the notebooks, you can. So this is the notebook that supports chapter one. And there are also links here
For most of the chapters, I am still in the progress of getting the rest of them up.
SPEAKER_02But for example, if you want to run the chapter that we were just talking about with the long tail distributions, you can click here. That will take you to Colab. And everything that you need is in this notebook. When you run the notebook, it will download some libraries and it will also download the data. So this will take a minute to warm up. But this is going to show the first data set is actually from Wikipedia, that they have collected a list of disasters,
SPEAKER_02natural and man-made, that caused damage of at least a trillion dollars in 2022 dollars once that has warmed up we should be able to see what that distribution looks like and start to focus in on what the tail of that distribution looks like there we go so chernobyl is number one on the list and working your way down and we can see what some of the categories are i had to do a little bit of data cleaning there And then what I've computed here is the magnitudes. So putting dollars onto a log scale.
SPEAKER_02And here's what that distribution looks like. This is a classical way to visualize these distributions. This is a rank size plot where I've numbered the disasters from number one to 125 on the list and plotted their cost on a vertical axis. And this is a curve that's used often in the social sciences. And it gives you a sense of what that shape looks like.
SPEAKER_00And the fact that, I was just going to say, when it's log-log, the fact that it's linear on log-log for most of it suggests there's some sort of power law?
SPEAKER_02Yes. And that is the conclusion that a lot of people have drawn. I come around to making an argument that I think we have been a little bit quick to declare that something follows a power law. Because a lot of these straight lines are, like this curve is a perfect example. It's approximately straight when it's straight. And then it's not.
SPEAKER_00Yes.
SPEAKER_02And then, so the question is, are we just ignoring the curvature part? What are we focusing on?
SPEAKER_00Yeah. I think you point out a good point that power laws often exist only between a certain range as well, right? There's usually a map zone.
SPEAKER_02Yes. Now I haven't run this notebook for a little while and I've just realized that there's an error in it, which I think I will probably not be able to fix live, but I will get this fixed and I'll push the corrected version into the repo.
SPEAKER_00Fantastic. So what you're going to do was to fit a truncated normal to the log log plot.
SPEAKER_02Yes. And that's what I do throughout the chapter is two versions of every model. And one of them is Gaussian on a log scale. And the other one is student T on a log scale. And a student T is very similar to Gaussian, except that it has a thick tail. And what I found is that many of the distributions in this chapter turn out to be very well modeled by the student T distribution. So well that the fit is almost embarrassing in a couple of cases. I would not fake the data this good.
SPEAKER_00And I presume many people have heard of the student T distribution. If not, you've probably heard of... Students' Tea Test, which is one of these things that is useful to a certain extent, but perhaps overused. My background's in biology, so I've seen it abused time and time again. But for those who don't know and are a fan of beer and Guinness in particular, Students' Tea Test was developed by William Gossett, I think his name was, who... He wasn't allowed to use that name because it needed to be anonymous for some reason. But research at Guinness,
I think thinking about the yield of different ways of brewing Guinness with respect
SPEAKER_00to how much and how economically valuable it would be for Guinness. So there you go.
SPEAKER_02Yeah, I think they were doing something very much like A-B testing.
SPEAKER_00Yeah, exactly. So perhaps, do you want to jump into the notebook, perhaps the Berkson's Paradox one, because we spent a good amount of time discussing that? Yes, let's do that. I will need to jump back to the landing page, get to the GitHub repository.
SPEAKER_02And Berkson's Paradox is, and here's where I need a little bit of help for myself, which chapter it is. I think it's seven, but let's find out.
SPEAKER_00Yeah. One way to find out.
SPEAKER_02Yes. This is actually the second of two chapters. So six is the one we want. Yes. All right. Take just a minute to get that warmed up.
SPEAKER_00And while that's warming up, I would. So we see your book. Think Bay is behind you and you're also a self-proclaimed stark raving Bayesian. Yes. And neither in this conversation nor in the book, Has Bayes been mentioned much, if at all? So perhaps you can tell us maybe a bit about your calculus or decisions around not doing a lot of Bayesian stuff in this work.
And then how you can incorporate Bayesian thinking into all of this as well.
SPEAKER_02Right. I would say that the book is Crypto-Bayesian. The chapter that's on the base rate fallacy is very explicitly Bayesian. The best way to understand the base rate fallacy is to look at Bayes tables where you enumerate the possible outcomes and the calculation is a Bayesian update. And then the other place where it comes up, there are a couple of places where I needed to do some inference behind the scenes.
SPEAKER_02So in my methodology, I broke out some Bayesian methods. But I ended up not focusing on it in part because it wasn't necessary for the points that I was trying to make. I wasn't often doing explicit inference where I was trying to quantify a measurement and describe its distribution of uncertainty, which is the bread and butter of Bayesian methods. Most of what I was doing was, like this example, I think is a good one,
wanted to look at the correlation of math and verbal skills and this is a question that i posed on twitter i asked in the general population do you think that they are correlated or anti-correlated and it's easy if you apply the availability
SPEAKER_02heuristic to think about people you know who are very verbal And maybe not really great at math or a math genius who might not be super communicative. So it's easy to think about examples like that. But it turns out that in the general population, they are, in fact, highly correlated. So this is using SAT data. It's a data set that's available from the National Longitudinal Survey of Youth. And the scatter plot here shows that these are in fact correlated.
SPEAKER_02If you're good at one of these things, you're probably good at both. But then when you start selecting people, and this is what colleges do in their admission process, by and large, it's a little bit like the dating example that we gave earlier, which is if you're not good at either of these things, you probably won't be admitted to a competitive college. So of the people that you find on a college campus, they're probably good at one or the other.
SPEAKER_02And the number of people who are good at both is relatively small. So let me show what that looks like. I have a hypothetical elite university where in order to be admitted, your total score has to exceed a threshold. And so now what we're seeing in the figure is all of those orange people in the lower left were not admitted. The blue people of the upper right were admitted. And if you only look at the blue people, you do see a negative correlation.
And that's what that dashed line shows, a negative correlation between verbal and math.
SPEAKER_02And I think that colors people's perceptions. If you go to a top university or you end up at a company where you're working with a lot of smart people, because of that selection process, because everybody has been filtered for one or the other, you're going to tend more often to see an anti-correlation.
SPEAKER_00I really appreciate you showing us this in a notebook, Alan, because just to recap, what you have here is you've got some data that is from an open data set. You've used some relatively straightforward Python code, bit of pandas for data munging, data wrangling, and then used matplotlib. to demonstrate this result in a figure you've used a jupiter notebook which of course has an ipython kernel because i always just want to remind people when people will say jupiter's better than ipython or something like
that we all stand on on the shoulders of giants right and ipython is underlies a lot of the jupiter ecosystem and you're running it on a you've allowed people to run it on a collab
SPEAKER_00notebook as well so nobody can Nobody has to worry with local installations and that type of stuff. So with a whole bunch of pretty much open source infrastructure and a bit of code, you're able to do some pretty cool work and show something important.
SPEAKER_02Yeah, and I'm glad you mentioned that because I'm really grateful to all of the open source software that I'm working with. In particular, as you said, Jupyter and IPython. I'm using a ton of NumPy and Pandas and SciPy and Matplotlib. And they are powerful tools for exploring data, doing statistical analysis, generating these data visualizations. So I'm grateful to all the people who made those tools. And that's one of the things that makes me want to make these notebooks available so that people can now take the code that I've written and
replicate what I've
SPEAKER_02done, extend it, do more experiments, learn from it, I hope.
SPEAKER_00Absolutely. So I'd love to... wrap up by wondering if you have a call to action for our listeners i do want to state first though anyone listening or watching i hope you'll jump into these these notebooks and play around and i presume this will be one of alan's call to actions but also buy and read alan's wonderful book i've enjoyed it immensely and if you've enjoyed this some of this conversation it goes into all of this stuff and more in in greater depth but having had my call to action alan what would you like our listeners to do
SPEAKER_00Thank you. I appreciate that. I hope that people will take this as an invitation to explore data and learn more
SPEAKER_02about these tools. And I hope that by learning about some of the tricky ways that data can fool us, that people will be a little bit more likely to spot errors when they see them, maybe catch people who are making an argument intentionally or not that maybe is not legitimate. A lot of what is in the book is sampling bias of one kind or another. So I wanted to mention one other one that I think is really important, which is the negativity bias that is in both the media and the
way we understand
SPEAKER_02the world. It seems to be just part of our psychology that we pay more attention to negative things than positive things. And that's probably adaptive in the sense that we're better prepared for things that can go wrong. But when you now amplify that with a news media that covers everything bad that happens in the world, we have more exposure now to every bad thing in the world than our brains evolved to handle.
SPEAKER_02And it is not doing us any good. One of the chapters looks at some of the generational differences between just positive outlook about the world and current generations. Every successive generation in this data set is more pessimistic, less positive about human interactions. They ask a number of related questions. They are all going in the wrong direction. And I think that the way we consume media is at least a
contributor to that.
SPEAKER_02So at the same time that you become more aware of sampling bias, also become aware of all of the negativity bias that changes the way we perceive the world.
SPEAKER_00And how can we consume media differently, do you think?
SPEAKER_02That's a good question. And I think it's one that we have to figure out. I am coming around reluctantly to the view that we just have to stop watching the news and find some other way to understand what's happening in the world that's not so misleading. By and large, most things are getting better. But by almost any metric, people are better off now than at any time in human history. Now, obviously, we have problems that we need to solve.
SPEAKER_02So I'm not trying to say that everything is wonderful. But I think it's important to have an accurate picture of where we are, what direction things are going, and how we can keep making it go in positive directions. whether the world is getting better and how to make it better, we will not make good decisions about how to keep making it better.
SPEAKER_00I couldn't agree more. And I think becoming more accustomed to thinking statistically and different types of data thinking, but then being aware of all the types of biases. And I think the negativity bias, because as you say, there's a lot to be optimistic about, but you can feel beaten down by the negativity if that's what you have thrown at you all the time. We have to be vigilant. There are a couple of news sources and maybe I'll get some links to add to the notes.
SPEAKER_02There are a couple of sources of only the good news, which at the very least, I think if you add them to your media mix, it might balance things out a little bit.
SPEAKER_00Yeah. Great. Well, I'd just like to thank everyone for joining. And if you follow us on Twitter at Vanishing Data, I'm Hugo Bowne. We'll let you know when the podcast comes out and follow Alan as well. Alan's wonderfully active with lots of interesting stuff on Twitter all the time at Alan Downey. Is that right? Yes. And so thank you all for joining. But most importantly, thank you, Alan, for both your time and your expertise. It's always such a pleasure to chat with you.
SPEAKER_02Thank you. Thanks for having me. It is always a pleasure to chat with you.
SPEAKER_00Thanks for tuning in, everybody. And thanks for sticking around to the end of the episode. I would honestly love to hear from you about what resonates with you in the show, what doesn't, and anybody you'd like to hear me speak with, along with topics you'd like to hear more about. The best way to let me know currently is on Twitter. At Vanishing Data is the podcast handle, and I'm at Hugo Bowne. See you in the next episode.
Hilary Mason, CEO of Hidden Door, works with agents across software development and creative projects. Drawing on Richard Hamming’s distinction between science and engineering, she describes agents as “bringing the...
Agents can write the code, run the analysis, and produce a convincing explanation. How do you check that they’ve answered the right question, used the data appropriately, and reached a conclusion you can act on? I...
“It’s an LLM, a loop, and enough tokens.” - Nicolay Gerold, Amp Code So why does a coding agent forget your instructions, keep reading tiny pieces of a file, or struggle with an edit another model handles easily?...
“If you feel that a product is hard to eval, or you feel like, ‘I don’t even know how to eval this,’ it’s a strong smell that your product isn’t good.” - Hamel Husain, on AI product design An AI data agent tells you...
“It would be sad if local models were not an option and there were only proprietary models. It’s good to have alternatives. Competition is good for business.” - Sebastian Raschka, on open-weight AI Kimi K3’s weights...