Transcript for:
P-Value Calculation Methods

if you kind of look at all the simulated sample proportions that disagree with the null hypothesis even more than 0.6 one disagrees that's about well 48 plus 48 all right which would be 96 out of 250 which would be 0.38 for so you can also by the way add the tail proportions when the computer calculates this you'll see you'll get these proportions here it'll automatically calculate it for you but in a two-tailed test you actually have to add these together and the old days we'd also just take the tail proportion and multiply it by two so a two tailed a p-value from a two-tailed test will always be twice as big as from a one tail test a right tail and left tailed test so think of these as all these sample proportions and identifying which ones disagree with the null hypothesis even more than the real sample data did all right and that's really what this definition that we're talking about is telling us so this is sort of how you calculate theoretically how p-values are calculated when you're using randomized to simulation and again I'll show you some computer in our next video I'll do some computer work for you and I'll show you how to eat how to use the computer to calculate these simulations for you but this is really the direct way of calculating the p-value now what about the sort of traditional approach okay well again before computers were invented statisticians didn't have the capability of doing this right they they they they couldn't just make you know 5000 random samples and at the drop of the Hat so they have to figure out a way of sort of approximating this right so the way they used it is they use the actual test statistic instead so in the days before computers you would calculate your test statistic and then you would use a theoretical distribution that corresponds to that test statistic to calculate your p-value so think about it traditionally you could you can sort of calculate your approximate p-value based on the probability in the tail corresponding to the test statistic itself so and again we used to use calculus for this before computers you could actually find these problems these areas in the curve with calculus so you think of it this way if I was dealing with a right-tailed test I theoretically I would calculate the test statistic and then I maybe it was that suppose it was a t-test statistic then this curve would be a T curve with the correct degrees of freedom and then I'd look for the percentage in the tail or the proportion in the tail that corresponds to the test statistic and that would be my approximate p-value and the surprising actually gives you pretty similar numbers to what we would get with the randomized simulation so it does work in fact traditional programs often still use this method also if you're dealing with even if you are using some randomized simulation if you start getting into a ten population study or something a lot of times they'll just use the test statistic and the probability in the tail determined by the test statistic so this idea of the p-value is the probability in the tail or tails corresponding to the test statistic is a good idea to have in your head so if this was a left tailed test then then I would look for the test statistic would be sort of where it starts and then that probability in the tail this area under the curve to the left of the test statistic would be the p-value if it was a left tailed test so if this was a z-score curve right I'd have my z-score test because they can I'd look for the probability to the left of that and by the way you can look up these theoretical using the theoretical distribution function in stack key you can actually look up these p-values and you can kind of see that they're actually the same as what you would get in a printout from a computer software like cicada if it was a two-tailed test it kind of works the same way you look at you if your test statistic is sort of on the far right put it there your test statistic is on the left put it there and then again it will calculate the percent in the tail but it also duplicated on the other side so you'll get two tails you'll get a percentage of proportion from the left tail and the right tail and you have to add them together to get the p-value so so I would add these together in the Oh like say in the old days what we would do is just find the percentage in the tail and then we'd multiply that percentage times two and that would be our approximate p-value okay so nowadays a lot of times we use this randomized simulation in the computer age and then theoretically before computers we did a lot of this stuff where we use the test statistic itself to calculate the p-value now it's it's really a good idea to have both ideas in your head because you never know which one is going to be used on a problem but also let's get into a little bit about how does how does all this relate together we have like four key things that we've been looking at test statistics critical values p-value and significance levels we've already said before that we compare the test statistic to the critical value and the test statistic would have to fall in the tail to be significant and then we compare the p-value to the significance level and we said the p-value would have to be lower than the significance level percentage for us to be significant and for it to be unlikely to be written to sampling us are unlikely to be sampling variability but how does that fit together these two graphs I have on the board over here kind of summarize that so if if you kind of look at them it kind of gives you a picture of what's going on so think about it this way the critical value that suppose under stealing with a right tailed test these are both examples of just a right tailed test though the left tail and two tail works very similarly the critical value is sort of the where the tail starves right we talked about that and the person in the tail or the proportion in the tail that corresponds to the critical value is the significance level you choose remember we were looking at critical values by putting in the significance level percentage in the tail and the computer would give us the critical value now how does this work so the test statistic let's suppose the test statistic fell in the tail we said that would indicate that the test statistic significantly disagrees with the null hypothesis well if the test statistic fell in the tail the percentage in the tail that corresponds to the test statistic though this little area right here would be the p-value and what you can see is the p-value area haven't designated in orange but this smaller area over here is actually a lot smaller than the significance level area so the main takeaway from this is when the test statistic falls in the tail determined by the critical value the p-value will be low will be lower smaller than the significance level those two always go together so test statistic in the tail remember tells me significance p-value being lower than the significance level also tells me significance those go together now what about if the pet that uh statistic was not in the tail so again this little green area right here is my significance level area again the where the tail starts is my critical value now I'm thinking okay well what happens if the test statistic did not fall in the tail right the test statistic was not significant the sample data did not significantly disagree with the new hypothesis well again that would mean if I look at the area to the right of the test statistic is now much bigger than the area for the significance level so this area right here in this orange area is much bigger now than the green area for the significance level so the p-value area now is bigger than the significance level so the takeaway when the test statistic does not fall in the tail right not significant the p-value is going to be very big high that means not significant it could just be sampling variability okay so these two graphs sort of show how those four things we've been talking about fit together and a lot of students especially when they first started have a hard time getting these two pictures in your head but this is a good way to kind of think about it alright in our next video we'll look at using computer software to calculate p-values so you can get an idea of you know using some real software to do this this is more of the theory behind it so I hope it was helpful for you so this has been hypothesis test calculating p-value so this is mat to show and intro stats and I'll see you next time