Transcript for:
Understanding P-Values in Hypothesis Testing

hi everyone this is Matt to show with intro stats and today we're continuing our discussion of hypothesis tests last time we looked at the test statistics and critical values and today we're getting to a very famous topic called p-value p-value so today is all about p-value we're gonna just introduce the ideas of p-value today we'll get more into how a p-values are calculated in our next video all right so let's talk a little bit about we've been kind of going through hypothesis testing right how hypothesis test works we saw that there was a null hypothesis a statement about the population that has an equal to part and there's an alternative hypothesis a statement about the population that does not have an equal to part and we kind of looking at we saw last time that the test statistic sort of measures how far the sample data is from the null hypothesis right is it is it a significant disagreement and p-value is sort of another piece of the puzzle so it kind of goes with the test statistic but it answers a different question so let's take a look at a couple things one thing we talked about a little bit last time was this principle of sampling variability that's been a constant principle throughout our class is this idea of random chance or sampling variability that random samples are almost always different and they're usually always different than the population and what that means in terms of a hypothesis test is we can sort of expect our random sample data to almost always disagree with the null hypothesis is just always going to be off from what the null hypothesis said almost always so that's a problem because the null hypothesis might be correct in real life maybe that statement about the population is actually correct but our sample data still disagrees with it right still this agrees with it and we're like well how am I supposed to know if the null hypothesis is right or wrong right that's that's kind of the problem so sampling variability becomes a real key issue here and this is where p-value steps in p-value is a number that we can calculate this sort of helps us with this idea of say I'm dealing with sampling variability so here's the key question of that drives a p-value why does my sample data disagree with the null hypothesis all right you setting sampling break the principle of sampling variability we know the sample date is gonna disagree with the null hypothesis even if the null hypothesis is right or wrong so the question not is does it disagree the question is why does it disagree right why does it disagree and so there's really two answers to this question right why does my sample data disagree one possibility might be that the null hypothesis is wrong maybe that statement about the population and the null hypothesis is actually wrong and the sample data disagrees with it because it's wrong okay that that's a definitely a possibility the other possibility is that the null hypothesis could be correct and the sample data just disagrees with it because of sampling variability or because because all samples all random samples are a little bit off so so there's really sort of two options it's either the sample data disagrees with the null hypothesis because of sampling variability which means the null hypothesis might be correct or the samp the sample data disagrees with the null hypothesis because the new hypothesis is really wrong and that that idea is really what drives this discussion of p-value p-value so when we're trying to figure out this question right this is this very very important question there we calculate something called the p-value again we've done a lot of peas and stats and it's a really overused letter so this is different though this is not this full proportion or a population proportion or people there's some of these other P's that we've looked at in the class or just some general probability this is capital P value p value it's actually something very different and it's connected to hypothesis testing okay so let's take a look at the definition okay what is p value always start in stats with your vocabulary your definitions that's what I've been harping on you on your definitions throughout the class is kind of knowing what things are being able to explain the idea to someone that's a lot of what statisticians and data scientists do we explain data to people so a p-value the probability of getting the sample data or sample statistic or more extreme by sampling variability if the null hypothesis is true okay so that's p-value the probability of getting the sample data or more extreme by sampling variability if the null hypothesis is true now that's a very packed definition it has all kinds of stuff in that definition and we're not really going to be able to unpack everything in this definition today right now but I won't point out a few things first of all notice that it's a conditional probability it's a conditional property it's based on the premise that the null hypothesis is true so whenever computer calculates p-value they're assuming the null hypothesis is true and then they're trying to find the probability of getting the sample data or more extreme so what that kind of refers to is something any other sample that might even more disagree with the null hypothesis than the sample data you're looking at now usually that sample date ever referred to really simsim usually a sample statistic of some kind that's why a lot of times you'll see them use the actual sample statistic like they might use the sample mean or the sample proportion or they might use a test statistic so you might see them even use a test statistic as a representation of the sample data so the probability of getting the sample data by sampling variability so very important that's why this is allowing us to answer the key question about sampling variability right why is my data disagreeing with the null hypothesis is it sampling variability or is it not so the key a p-value is you're trying to rule out sampling variability you're trying to kind of show that sampling variability it's not sampling variability it's not random chance that's not the reason why our sample data is disagreeing with the null hypothesis so here's kind of the idea here think of p-value is a probability right of getting a sample data by sampling variability so if that probability was really really low like almost zero then defined a zero probability that the sample data occurred by sampling variability if the null is true then it's sort of not sampling variability right that's that's kind of the idea of it there's a logic to that right a low probability of something happening means it's unlikely to be happening like if I have a if I have only a 1% chance of my car starting all right Mike it's very unlikely that my car is going to start so if I have a 1% p-value a 1% probability that the sample data occurred by sampling variability it's probably not sampling variability or it's very unlikely to be sampling variability that's the idea you want to have in your head okay now there is more to this definition that what then what we've kind of see on face value and we'll kind of get into it more and more throughout this this unit on basics of hypothesis tests so here's the idea if our p-value was really really love close to zero right that would tell me that it's unlikely to be sampling ability okay it's probably not sampling variability so let's go back to the key question here if I had a low p-value right if I had a low p-value then that would tell me it's not sampling variability it's not this one this is not the reason why my data is disagreeing but then the only alternative one would be that the null must be wrong right you kind of get that if it's not sampling variability if this is not the answer to the key question then it must be this one right that's the logic of it you kind of want to think about you're kind of ruling this one out so if I have if I have a low p-value right a low p-value then it's sort of telling me a low p-value close to zero all right it means it's not this one but that means it probably is this one that's why a lot of times when you have a low p-value they'll say you're gonna reject the null hypothesis because you've you've ruled out sampling variability so the only other alternative would be that the null is probably wrong now we don't know anything for sure we're still looking at sample data trying to say something about millions of people in the population but we'll get to that later that you can make mistakes in this stuff but the idea of p-value is that idea of ruling out random chance or ruling out sampling variability okay so a low p-value would kind of indicate this one is probably the case and that's why when we have a low p-value we reject the null hypothesis okay so it's not unlikely to be sampling variability so we can't reject the null hypothesis reject the null hypothesis we think the null hypothesis is probably not correct okay all right now notice again one of the key things to about p-value is it's directly connected to the null hypothesis not it not the claim not the alternative hypothesis it's always connected to the null and only the null the p-value only tells you something about their null hypothesis because the member of the condition that when you calculate the p-value is if the null hypothesis is true okay so again it's connected to the null hypothesis and only the null hypothesis so kind of keep that in your mind as well later we'll see that we can use logic to sort of apply it to the alternative like if you said the null was wrong you're probably saying the alternative might be correct or you're supporting it right but um the but in general with p-value always think of it as a statement that about that the condition is that it has to have the null hypothesis being true all right now what about a high pvalue what what a high pvalue tell us oh hi p-value so suppose I had a high pvalue so suppose my p-value was high all right well if that's the case if you have a high p-value like even if I just had by the way it doesn't take much for our p-value behind p-values are supposed to be zero or really close to zero think of those p-values you want your p-value can be very very low really close to zero because that's the way you're gonna rule out sampling variability if you get a higher p-value like even if it's a I don't know 20% p-value that's considered a high PB that means it could be just sampling variability I'd have a 20% probability that the sample data just occurred by sampling variability if the null is true so a high key value not not close to zero would tell me that it could be sampling variability now it's just a 20% probability so it doesn't guarantee it is sampling variability but what it tells me is it could be okay so a hot a p-value tells me it could be sampling variability it could be sampling variability so the sampling variability this one it could be the answer to the question of why did