How to calculate p-values
HTML-код
- Опубликовано: 26 июн 2024
- In this StatQuest we learn how to calculate p-values using both discrete data (like coin tosses) and continuous data (like height measurements). At the end, we explain the differences between 1 and 2-sided p-values and why you should avoid 1-sided p-values if possible.
NOTE: This StatQuest assumes that you are already familiar with what p-values are and how to interpret them. If not, check out the quest:
p-values: What they are and how to interpret them.
For a complete index of all the StatQuest videos, check out:
statquest.org/video-index/
If you'd like to support StatQuest, please consider...
Support StatQuest by buying The StatQuest Illustrated Guide to Machine Learning!!!
PDF - statquest.gumroad.com/l/wvtmc
Paperback - www.amazon.com/dp/B09ZCKR4H6
Kindle eBook - www.amazon.com/dp/B09ZG79HXC
Patreon: / statquest
...or...
RUclips Membership: / @statquest
...a cool StatQuest t-shirt or sweatshirt:
shop.spreadshirt.com/statques...
...buying one or two of my songs (or go large and get a whole album!)
joshuastarmer.bandcamp.com/
...or just donating to StatQuest!
www.paypal.me/statquest
Lastly, if you want to keep up with me as I research and create new StatQuests, follow me on twitter:
/ joshuastarmer
0:00 Awesome song and introduction
0:58 p-value for getting two heads
6:39 p-value defined as the sum of three parts
9:30 p-value for getting four heads and 1 tails
12:31 p-values for continuous data, like how tall people are
14:31 A borderline p-value
16:59 A significant p-value
17:47 An insignificant p-value
20:12 One-sided vs two-sided p-values
24:20 Summary of concepts
#statquest #pvalue
NOTE: If you are still wondering why we add rarer events to the p-value, consider this: At the start of the video I got 2 heads and though, "wow! This is special!!!". However, if I got 2 tails, I would have thought the exact same thing. We tend to think that whatever we see is special, even though there are other events that are just as rare, or rarer. Adding them to the p-value compensates for our observational bias.
Support StatQuest by buying my book The StatQuest Illustrated Guide to Machine Learning or a Study Guide or Merch!!! statquest.org/statquest-store/
The idea of NHST or null hypotheses as used here is, to be frank, nonsense. These are point hypotheses because the p-value assumes that the coin is _perfectly_ fair. (Also see my comment on the other p-value video why the p-value shouldn't even be used.)
Combine both and you got a testing regime that is GUARANTEED to reject the null hypothesis eventually. Even if you deem the coin "fair".
Also, 2 heads in a row is very little information but it is still information which a Bayesian approach does not throw away.
Why the standard is 0.05? What can you say about making changes in the significance value to prove a point? Why 5%?
@CogitoErgoCogitoSum seriously? if you toss a coin 100 times and obtain 99 heads, what do you think between theese 2 options?
1) this is absolutely possible because the result belong to the set of possible events, so I can say the coin is fair;
2) even if this is possible, this result it's so rare than I can conclude ALMOST CERTAINLY that the coin it's not balanced (so belong to another distribution, the distribution of not balanced coins)
I'm still trying to wrap my head why "or rarer" is added to p-value, and how that's related to 1 & 2 tailed tests.
Suppose a baseball company claims their bats are 100 cm long, with std.dev of 5 cm. Assuming Normal, that means if we look at 100 random bats, 95 of them should be between 90 - 110 cm, while 2.5 bats < 90cm and 2.5 bats > 110cm.
Now I'm an investigator who wants to test if the company is lying. To do that - if I sample 100 bats, and more than 5 bats are outside the 90-110 cm range, I can sue them. Right ?
If I find a random bat that is 110cm long, I'd think 'wow that's rare, but not impossible'.
But I'm struggling to see how or why I'd suddenly start thinking along the lines of 'I found a bat that is 110cm. What are the chances of finding > 110cm or < 90cm bats'.
Why would/should I think that way ?
@@av3499 I think regardless of the samples you took, your example is very important. Finding a really extreme value could result in suing the company according to 95% confidence.
The P-value of this content being normal is less than 0.05, it's super!
BAM! Thank you very much! :)
Lets hope it is a one sided p-value and H0 is this content is not better than normal ;) Otherwise (for a two sided p value), it could be that the content was super bad, which is definitely not the case :D
we can safely reject the null hypothesis that this content is no different than other people's content
It means we will reject that the content is normal right?
The p-value that your lectures are special < 0.000001.
Bam! :)
wait a minute
Triple Bam!!!
H0 - your lectures are normal (null hypothesis)
H1 - your lectures are brilliant (alternate hypothesis)
P value < 0.05 means H1 is true and we can reject h0 right?
@@A_Proud_Indian yes. He saying StatQuest is 1 in a million. Rare to find such quality. Extremely low probability that StatQuest is of a normal distribution of stat teachers.
god gifted or extremely hard working teacher. good to live in the times where such education is freely available.
you are really a gift to the humanity as I believe a lot of people in future will make things (after learning from your videos and not giving up).
Thank you very much! :)
I can't believe how concepts can be made so simple and at the same time so comprehensive. this is mindblowing :)
Hooray!!! :)
Triple BAM!!! I learned so much as a teacher from this video. Those classroom learning during my graduating time did not come with this excitement and visuals. So lucid and easy you made it. Not just to understand but also to take away the teaching method -- TRIPLE BAM!!!
Hooray! I'm glad the videos are helpful.
You should be given a Nobel Prize for all the efforts you put into your illustration guided lectures. I wish I had learnt Statistics from you during my undergrad studies, I would not be scared away and would learn enthusiastically like I am doing right now. Hat’s off to you with immense respect and thanks ❤
Thank you!
I support this idea. @@statquest
It is extremely rare to find a so comprenhensive explanation like this one.
Thank you!
My life would be SO different if I had seen this video 10 years ago. My heart brakes thinking where I could be today and fills me with anger to think that this was simple and my teachers didn't care to teach me and people publishing the class textbooks only cared about impressing their colleagues but never cared about the students. Thank you, Josh. Thank you for bringing this to the world. You're changing lives.
Thank you!
I am watching this video today and need to use this concept in research but i am dumb enough to understand these things.. How stupid i am.
That's why they bad teacher spoils lives of millions of students.
Finally happy to realise what the p value actually means. Thank you Josh for all the great efforts to make it so simple and showing that anything complex can be made simple if explained in the way it should be.
Thank you very much!
Oh, my god. I just had the most satisfying aha! moment of my life. What a comprehensive, yet concise, and easy to understand explanation. This deserves more likes, you deserve more subscribers. Incredible content.
Thank you very much! :)
Ever since my sister highly recommended StatQuest, it has been my favorite RUclips channel since it clears up every concept magically. But the old p-value video still let me confused about what p-value really is... and BAMMM. This video came out! It is fantastic and deserves a million views. Thanks always.
Awesome! :)
@@statquest BAMMM.
This deserves a million likes. Brilliant!
Thank you very much! :)
Nice video! One thing I notice while teaching statistics to students is that many of them are confused between confidence interval and p-value. This video elaborates nicely about what p-value is. As someone who is also teaching statistics, this video inspires me a lot.
Awesome! Thank you very much! :)
You are incredible josh, and since you mentioned brazil, know that we brazilians see your videos a lot, they are the best, and it's very good that you write what you say in the videos, it helps a lot of non-natives who besides learning statistics still want train english. Your work is commendable, I really appreciate your dedication of time and effort. Thank you very much.
Muito obrigado! Eu amo do Brasil!
I have told this concept to my professor. He was very happy to see this explanation. He is on the list of the top 2% of scientists in the world. But as a statistician, he seeks clarification of the statement that "one-sided p values have the potential to be dangerous".
Happy to help! :)
Although I really love these videos and concepts, I think the true motivation comes from anticipation of the opening song. No doubt these videos are highly insightful and educational due to the way Josh explains them but it's uncanny how Josh's voice is so under-appreciated. Great job. Keep them videos coming!! :)
Wow! Thank you! :)
Two days in a row watching your videos and learning a lot! Thank you from Brazil!
Muito obrigado!
"..and since failing to detect that SuperDrug is making things worse would be bad, one sided p-values are tricky and should be avoided..." .. that final line helped clarify your position on one sided p-values, thank you.
Hooray!
These lectures are worth binge-watching! Thanks a lot Sir!
Glad you like them!
I'm currently in IB and recently they rolled out a new Math system and I joined Applications and Interpretations which means that there's gonna be lots of stats going on, from descriptive stats, uncertainty, to testing for Spearman's and X2 tests. this youtube channel has been such a blessing for learning those concepts because the new book that I've been using (Oxford book) has lots of mistakes and was incredibly confusing. Thank you!!
Hooray! I'm glad the videos are helpful.
Hooray! I just got accepted at Statistics College and my classes starts only in August!
Your videos has proved to be very much helpful
and i shall keep studying then till there!
I'm brazilian by the way and wanted to thank you for the enlightening content!
Muito obrigado!!! :)
since I was a student, I didn't like statistics much. I think the reason for that was I've never understood these topics well.
You are the best teacher I have ever had. :)
Wow! Thank you! :)
The way you are making videos and explaining these concepts with such an ease....it shows how passionate you are to pass on the knowledge.....!! Keep up the great work....You have earned a Subscriber....!!!
Thank you so much 😀
I couldn't help but dreaming a scenario where they want contenders to find as much special coins as possible from a bag mixed with normal coins and I calculate p values to find special coins. Thanks a lot Josh, it's always a pleasure to learn with you
Thank you very much! :)
@StatQuest with Josh Stammer .. you are literally saving many student asses who are trying to learn data science . Love from India(Andhra Pradesh)
in telugu :
Devudu pampina dootha
Dandam ra dootha niku .
BAM!!! What's "BAM" in telugu?
Beautiful! Explained so succinctly the difference between probability and p-value
Thank you! :)
I love this guy. Heaven is there for beautiful people like Josh. He is a gem of a person.. protect him at all costs.
Thank you!
„These values are considered equal to or more extreme, because they are as far from the mean or further“ this sentence explained the missing part from the last videos and the saved my day :D .. Great as usual!! thanks a lot
Hooray!
currently , after a month watching this channel I react with bam and double bam on every thing😅 u have your own effect tbh😂😂
BAM! :)
I love the tricky one-side p value explanation part!
Thanks!
Thanks, I have learnt 2 important things as a master.
First, you use the height between 155.4 and 156 cm to tell us why we should include equal rare and more rare things. This is so AMAZING! Good idea! I understand why we should include equal rare and more rare things for the first time in my life!
Second, you use a bad drug as a example to tell us why One-Sided p-values test avoid something bad.
bam!
Josh Barmer may you live upto 200 years and please keep spreading the joy as you are right now
Thank you! :)
Simply awesome! Basic concepts clarified, and on to more complex, tangential topics
Glad you liked it!
Man, your work is so awesome that the words can't even describe it!
Thank you so much 😀
I would like to send my thankful to you! Your explain is really clear and interesting! Hope you always are healthy and make more interesting lessons
Thank you very much. :)
Really good explanation. Already understood it by text book reading, which took me way longer than 20 minutes.. Nice too see I understood it correctly though. Keep up the nice work.
Awesome! :)
After watching this video I told my self BAAAM!! that was a great explanation.
BAM! :)
This is the best explanation I've ever seen! Thank you so much for it!
Thank you!
wow this is the best explanation of p value I have seen
Thank you!
Best StatQuest I have seen yet! Crystal clear!
Thank you!
The flower example deserves a BAM!
bam!
So surprised at 19:43 that we obtain p-value=1 ... Thanks for the great video again!
bam!
All your tutorials are just amazing!! 😍
Thank you so much!
Finally I am getting a fair idea of what p value means
To learn what it means, see: ruclips.net/video/vemZtEM63GY/видео.html
@@statquest thanks. I did watch that too 👍
So many videos, but this summarizes and I think is best video to understand P value
Thank you! :)
This is the finest content I've got in my whole education years
Wow! Thanks!
Top notch video , congrats for being so concise 🎉🎉
Thanks!
Thank you so much for this! I am so confused on EVERYTHING stats but this made tons of sense. I'm gonna go watch the other ones now! Thank you!!!
Glad it was helpful!
You make all topics so easy. Thank you so much !
Glad you like them!
I can't help but jam out when the opening song comes on StatQuest videos.
BAM! :)
Damn such a well timed video, I was just watching the old p value video, and I was confused hahaha, great explanation, and thanks!
Hooray! I'm glad this cleared things up.
Bam
@@ahfodder Yes! :)
very good, finished immediately after u upload
Thank you! :)
Your videos are so clear and helpful! Keep it up!! You earned a new subscriber 😊👍
Thank you! :)
wooh !! was trying to understand this topic for last two days. finally only you could teach me that. thanx a lot...
Happy to help!
Again! Excellent information, crystal clear! Good instructor!!
Thanks again!
Il m'a fallu attendre cette video en anglais pour comprendre la Valeur-p : Excellent !
All other videos failed to clearly explain what p-value really means. Bravo!!!!!!
Merci beaucoup!
@@statquest You clearly explained that P-value is not validating a theory but can only tell if we can trust it or not ... Of course we know that p(x/Ho) is not p(Ho/x) while we have so many temptations to cheat and accept p(x/Ho) = p(Ho/x). The point that enlighted my brain came when you associated the HHHHT serie to the TTTTH.... Yes, both are equally weird and HHHHH or TTTTT are worst.
We cannot doubt about our coin because of funny series until reaching a certain threshold.
I've made a colored simulation to illustrate this
docs.google.com/spreadsheets/d/1zWzQfMPUtCmbcS7_DB8l9VKO5SMMuUteAZxWRGxlVa4/edit?usp=sharing
Then when Ho is rejected , our test doesn't give us a clue about "what is the acceptable theory?" question . We just have to test a new theory and apply to it the same torture.
I think this is frustrating because we think such a rigorous test can do it. Finally hypothesis test aim is quite modest but smart.
I spend so much time to understand the deep meaning of it.... Not intuitive at all but you have done the job perfectly.
You are really WAAAW! everything becomes easy with you♥ thank you for this great job you helped me a lot to understand many difficult concepts with your funny method BAAAAM!
Hooray and Bam!!!! :)
Thank you so much to share this. You're very generous and emphatic to explain.
Thanks!
12:50 p value calculation for probability density functions.
P value = probability of the event happening + probability of all events equally rare + probability of all events rarer
Rarer here means “more extreme”, farther away from the mean
Yep
Best statistics teacher on RUclips!!!!
Thank you! :)
Richard Feynman once said something that I think helps to conceptualise why we include things that are equally rare in the p-value:
"You know, the most amazing thing happened to me tonight... I saw a car with the license plate ARW 357. Can you imagine? Of all the millions of license plates in the state, what was the chance that i would see that particular one tonight? Amazing!"
In this example it is easy to see that, although the chance of seeing that particular numberplate is tiny, any other numberplate you could have seen would by definition have been exactly as rare. It would be impossible to have any observation less rare. Therefore the observation is not remarkable at all unless we have something else to say about it.
That's great! :)
Absolutely insightful thanks
Thanks! :)
Your method of explaining things is unique, you make complex concepts so easy to grasp. Can you please mention some textbooks (preferably intermediate to advanced level) of probability and Statistics that you yourself have read?
All of the statistics textbooks that I've used have been really bad. That's one reason why I created this channel to begin with.
Deserves million likes.
Thank you!
This channel is absolutely epic dude
Thank you!
Unlike other videos of 66 days of Data this video was not clear completely. Thank you
What time point (minutes and seconds) was hard to understand?
really great channel !! clears doubts also within less time better than a paid course .. your just brilliant and unique from what others do .. A warm hearthly thank you sir
I'm so glad you are enjoying my videos. :)
@@statquest yea really my intuition has become even stronger
@@statquest yes really btw why not upload projects on the concepts u teach
I cannot thank you enough, lots of love from India ❤❤❤
Thanks!
Thanks to all people who worked to make these videos ... 👏👌
Thank you so much 😀
This is beyond gold
Thanks!
This is the best p-value explanation.also can u make one on the null hypothesis
keep up the good work!!
I'm working on one.
Thank you, masterful work! Exactly want I needed.
Thanks!
Very clear and comprehensive thx
Thanks!
I love the graphics, thank you!
Glad you like them!
After I watched this video twice, I finally understand why one tail is dangerous, because the null hypothesis is specific for “shorter “, and probably only expert would make a hypothesis for longer!!!
bam!
This did blow my mind.
BAM! :)
excellent explanation....in a simple way
Glad you liked it!
You are a hero to the world.
Thank you! :)
you teach amazingly
Thank you! :)
Thanks a lot for the video Josh
Thanks! :)
Is it only me who could not stop thinking about grape and normal Fantas during this statquest?
:)
Excellent Josh!
Thank you! :)
I have seen many videos and read so much about p-values. I never felt such plesent experience. Why dont Prof wont teach at universities like this? Love you Josh. Please recommend some good reference for ML and Statistics.
Thank you! A great book for ML is An introduction to statistical learning in R.
@@statquest Thanks Josh.
Perfect & so intuitive thank you very much Sir
Thanks!
AMAZING. Thank you SO MUCH!!
Thanks!
Amazing description!
Thanks! :)
thanks for BAMing that knowledge into my brain
:)
Great explanation. Thanks a lot.
Thanks!
super! thank you, bought your book
Thank you very much for supporting StatQuest! :)
I understood more from this video than I did from one semester of lectures.
BAM! :)
Thank you josh…love from India
Thanks!
This beautiful video teaches us the essence of p-values and that , if not well understood, p-values could be dangerous as some fancy super drugs. Triple BAM!
:)
Thanks from Brazil for the high quality teaching you’re doing here. :)
De nada! :)
This video helped me get through my first quiz in my regressions analysis class. One thing I did't see: How might we determine the likelihood that two sample means are part of the same population.
I'm glad my video was helpful. From here you might want to learn about t-tests. I have a StatQuest on that, but I teach it in an unusual way - I teach it from the perspective of Linear Regression. It's all part of my Linear Regression playlist: ruclips.net/p/PLblh5JKOoLUIzaEkCLIUxQFjPIlapw8nU
ps. Thank you so much for supporting me! :)
@@statquest Thank you! That's actually extremely relevant since my next module in school is linear regression :)
@@Patrick-ew3to Awesome! :)
Your a great teacher man
Thank you!
this is PURE GOLD
BAM! :)
StatQuest with Josh Starmer omg josh replied to me im gonna tell my mom 😭😭😭
The woh woh at 8:03 got me
:)
Actually understandable at 2x speed.
Very clean production
2xBam! :)
I am struggling with when to use chi squared p values or Mcnemars or some other method of calculating p value, it would be awesome if you would make a video explaining when each of those are appropriate.
Thanks for your material, it’s great
I'll keep that in mind.