R-squared, Clearly Explained!!!
R-squared is one of the most useful metrics in statistics. It can give you a sense of how good your model is.
For a complete index of all the StatQuest videos, check out:
statquest.org/video-index/
If you'd like to support StatQuest, please consider...
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...
KZread 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
#statquest #statistics #rsquared
Пікірлер: 708
NOTE: When I first made this video, I was thinking about how R-squared relates to Linear Regression, which will not fit a line worse than the mean of the y-axis values. This is because if the values along the x-axis are truly useless in terms of predicting y-axis values, then the slope of the line used to make predictions will be 0, and the intercept will equal the mean. However, it is possible to simply draw a line that fits the data worse than the mean and get a negative R^2. Support StatQuest by buying my book The StatQuest Illustrated Guide to Machine Learning or a Study Guide or Merch!!! statquest.org/statquest-store/
@mattkilgore7323
4 жыл бұрын
With enough variables in the data set, it would be easy to create a set of r-squared values so that the cumulative percent "explained by" the different variables goes over 100%. That's why I was never a fan of that terminology. Students think it implies causation when it doesn't. Otherwise, great video.
@statquest
4 жыл бұрын
@@mattkilgore7323 Maybe I should have made it more clear, but if you have a large model with a lot of variables, then you don't add together a bunch of individual R-squared values to find the total R-squared. You calculate a single r-squared value fro the entire model. In other words r-squared refers to the models, not the individual variables.
@huiwang2854
4 жыл бұрын
StatQuest with Josh Starmer If you only consider all unbiased lines, (mean of predicted ys equal mean of real ys), then no negative R^2.
@sunilkumarsamji8507
4 жыл бұрын
@@mattkilgore7323 Hi Matt can you explain the point you trying to make in a bit more detailed manner
@mattkilgore7323
4 жыл бұрын
The phrase "explained by" can be deceptive, as students often think it means "caused by." But this is not what it means in the context of r-squared. Does that help?
So glad this channel exists. It's rare that KZread videos on stats are this well done
@statquest
4 жыл бұрын
Thanks!
@shashankkhare1023
4 жыл бұрын
@@statquest You are a lifesaver. I am surprised you dont have more subsciptions. I would recommend your channel to my colleagues, thank you so much :)
@statquest
4 жыл бұрын
@@shashankkhare1023 Thank you very much!!! Recommending my channel to your colleagues is the best complement you can give me. :)
@VinodKumar-nn7go
2 жыл бұрын
you can watch and learn from Dr. Ami Gates. Her videos are great..
You have explained the concept so neatly,clearly ( most importantly in an easier manner ) so that one could get deeper understanding of the concept, a fact that lot many text books / videos / articles failed to do. Keep making such videos !
Thank you so much for making this sooooooo clear, I've struggled to understand the meaning of R2 for a week and you just made it clear to me in 10 min.
@statquest
3 жыл бұрын
Bam! :)
Your videos are so easy to understand, and also explains the intuition behind. I really love the way you start the video, unlike other bouring lectures.
@statquest
5 жыл бұрын
Thank you so much! :)
Your channel is blessing in disguise. Visual aids and the explanations are so smooth and easy to understand. Thank you very much.
@statquest
3 жыл бұрын
Thank you very much! :)
I started following you 4 months ago, now I'm starting over from the very first video, I'll watch them all and understand everything. Thank you very much for this content.
@statquest
Жыл бұрын
Thanks!
I had stats exam coming up and didn't know this particularly well, Thanks for making it much more simpler!
@statquest
3 жыл бұрын
Good luck on the exam! :)
Just recently found your channel. These are by FAR the most straight forward explanations I found so far. You sir are a godsend.
@statquest
Жыл бұрын
Thanks!
I read a lot on R square from different books and articles but this was the really different and very intuitive approach. Visualization is the best way to understand statistics and I think most books lack there.
@statquest
4 жыл бұрын
Thanks! :)
Josh you are the best!!! Your every video has been helpful to god knows how many times in my studies. Much much love
@statquest
4 жыл бұрын
Thank you very much! :)
this is the best channel ever that can exist about statistics :D wonderful explanation and illustrations and the music! :) am glad I found this at the right time !
@statquest
4 жыл бұрын
Thank you so much 😀
@baxtables
4 жыл бұрын
Are u glad u found it or are u asking us if u are glad??😆😆
Amazing explanation!!Made it very simply for me to understand!! :) I went through so much content for this..thank you
@statquest
4 жыл бұрын
Hooray! I'm glad the video was helpful.
Added this to my useful tutorials and math playlists. Thanks StatQuests.
@statquest
4 жыл бұрын
BAM! :)
I can't believe the simple relationship between R^2 and R was never made clear to me! Amazing as always!
@statquest
4 жыл бұрын
Awesome!!!! Thank you very much.
@pablo_brianese
3 жыл бұрын
I also appreciated his comments on the subject, and him sharing his opinions and intuitions.
@bleakmess
Жыл бұрын
Just a quick question?
cool! you have cleared all the fogs around r2 in my head once for all. appreciate your explanation!
@statquest
2 жыл бұрын
Glad to help!
"sniff/weight relationship" debunked by StatQuest. Give this man a Nobel. :)
@statquest
4 жыл бұрын
Thanks! :)
Super useful as always. Please continue with the videos (for example, prediction interval vs. confidence interval or maybe p-values vs. randomization tests or logistic regression...)! I liked your explanation because it never occurred to me that R^2 was basically the same as calculating percent change (diff/original)x100.
No one could make me understand R Squared in such easy way. Watched many videos. All made it complicated. Thanks.
@statquest
5 жыл бұрын
Hooray!!! I'm glad to hear the video was helpful! :)
Could not have even imagined such intuitive explanation of this topic before watching this video. Thanks Josh!
@statquest
Жыл бұрын
Thank you!
I have been looking at a variety of stats videos and these are clearly the best. I am so impressed with StatQuest that I renamed my four dogs, "StatQuest," "StatQuest," "StatQuest," and "John Stamos" because, of course...
@statquest
3 жыл бұрын
BAM! :)
Just impeccable. I don't think any other better illustration exists other than this. Thank you
@statquest
2 жыл бұрын
Thanks!
Very beautifully explained. Many thanks to the folks of Genetics Department at the University of North Carolina at Chapel Hill.
love the way you explain things in casual manner
@statquest
3 жыл бұрын
Thank you!
I have found a great channel for stats and trix.... BAM! it covers all the areas I want to learn.. Double BAM!! It's indeed clearly explained... Triple BAM!!!
@statquest
3 жыл бұрын
Hooray!
You are a rarity ❤️ really love how you explain statistics! Please tell us more 🙏🏻♥️♥️♥️
@statquest
4 жыл бұрын
Thanks! :)
Thank you very much, your video is very easy way to understand, makes me want to go through the Statistics course again.
@statquest
4 жыл бұрын
You can do it!
So all this time I spent sniffing rocks to grow bigger was for nothing???
@statquest
4 жыл бұрын
Ha! You made me laugh. :)
@PeterXLuo
3 жыл бұрын
haha
@antonbagaev1771
3 жыл бұрын
only if you are mouse
@andresrossi9
2 жыл бұрын
I love you hahahaha
@muslimmukhtarkhanov8194
Жыл бұрын
You should have made a powder out of rocks, that would speed up your growing. Especially if your powder of white color🤣🤣🤣
This channel has become my go-to resource for anything stat related.
@statquest
3 жыл бұрын
Bam! :)
@khanhdovanit
3 жыл бұрын
@@statquest Love your Bam and your singing
The introductions are the cutest thing I have ever seen - the videos are also super duper helpful!
@statquest
Жыл бұрын
Thank you! :)
god bless, i have been searching high and low for this kind of video. Thank you!!!!
@statquest
4 жыл бұрын
Hooray! :)
a simple concept explained simply. thank you for the straight forward explanation
@statquest
3 жыл бұрын
Thank you very much! :)
watching this again, thank you very much. I jumped into more advanced stuff because of your videos. 🙏🙏
@statquest
3 ай бұрын
Awesome!
Thank you, this was a life-giver! Josh Starmer, you just might have become a part of something which will be big
@statquest
3 жыл бұрын
Wow, thanks!
These videos are pretty cool. I can always come back and refresh concepts.
@statquest
2 жыл бұрын
Glad you like them!
这样的创作者请给我来一百个!thank you for your videos!I really appreciate what you have done, and look forward to seeing more of them~
@statquest
4 жыл бұрын
Thank you very much! :)
Working on my MPA stats final and this video has been so helpful
@statquest
3 жыл бұрын
bam! :)
Great teachers make everything interesting! Thanks Josh
@statquest
3 жыл бұрын
Thank you! :)
aha! we meet again, and I thank you again!!! wow, I wish you were teaching my class!!
@statquest
4 жыл бұрын
Ha! I'm glad my videos are so helpful. :)
Was struggling to understand this concept but this video explained everything!
@statquest
4 жыл бұрын
Hooray! :)
Really enjoying your videos. Moreover everything is crystal clear and I am able to understand them. Double BAM
@statquest
2 жыл бұрын
Hooray!!! That's great news. BAM! :)
Wonderful explanation again. I easily understood the concept. I'm grateful.
@statquest
Жыл бұрын
Thanks! :)
This helped me clearly understand R^2. Trying to grasp this from reading a textbook was impossible for me.
@statquest
Жыл бұрын
bam! :)
I would rather name this video VERY CLEARLY EXPLAINED. Thank you.
@statquest
2 жыл бұрын
Thank you!
Thank you so much, I've learned so much from you in the past week! Very grateful
@statquest
3 жыл бұрын
Thank you very much! :)
Ah! this is the best video explaining R squared! Thank a lot!
@statquest
5 жыл бұрын
Thank you! :)
Now I understand the R squared much better! Thank goodness for this video!
@statquest
2 жыл бұрын
Glad it helped!
I did not see anyone explain the statistics better than you God bless you ...
@statquest
2 жыл бұрын
Thank you!
Thank you, you're helping us with these videos.
@statquest
4 жыл бұрын
Thank you very much! :)
Really good explanation as to why r squared is significant in describing variation in data. Thank you!
@statquest
Жыл бұрын
Glad you liked it!
really boom...I was confused from past 3 days to understand regression value ...now I understand. Thanks
@statquest
Жыл бұрын
bam! :)
Thanks, every question/doubt that I had instantly got answered about 10 seconds later.
@statquest
3 жыл бұрын
BAM! :)
Thanks very much! Your videos rock. Great pacing, excellent points.
@statquest
2 жыл бұрын
Thank you very much! :)
I never comment, but today is not that day. Thank you so much for this!!!! I am in graduate school and am still struggling to understand these concepts, you're a life saver
@statquest
Жыл бұрын
Thanks!
Thank you for this precious material
@statquest
3 жыл бұрын
I'm glad you like it!
Undoubtedly d best and to the point explanation. Thanks a lot
@statquest
4 жыл бұрын
Thank you! :)
@vitulbansal1719
4 жыл бұрын
totally agree!!
I'm truly grateful for your videos!
@statquest
Жыл бұрын
Thank you!
Thanks for the simple explanation. Much appreciated.
@statquest
4 жыл бұрын
Thanks! :)
wow this is the best explanation ive ever seen, thank u!!!!!
@statquest
4 жыл бұрын
Thank you very much! :)
This video is absoluted amazing! R^2 and R finaly understood!
@statquest
2 жыл бұрын
bam!
Thanks for sharing, Sir. It helps me a lot
@statquest
2 жыл бұрын
Glad to hear that!
Beautiful explanation :)
@statquest
5 жыл бұрын
Thank you! :)
Good explanation and your videos really are funny... good job
@statquest
5 жыл бұрын
Hooray! I'm glad you like the videos and my silly jokes. ;)
AWESOME! thanks for the explanation.
@statquest
5 жыл бұрын
Hooray! I'm glad you like the video! :)
Thank you Josh, this was really a beautiful explanation :-)
@statquest
2 жыл бұрын
Thanks!
Amazing video! Thank you very much!
@statquest
4 жыл бұрын
Thanks! :)
Nice video! I'll recommend it to family and friends.
So proud of me because I'm watching these videos. Very very goood job thanks 😊 👍 👏
@statquest
3 жыл бұрын
Nice!
Nice explanation. To the point.
Well explained. Thank you!!!
@statquest
4 жыл бұрын
Thanks! :)
hats off and thanks a lot you will make me cry. thanks once again.
@statquest
4 жыл бұрын
Thanks! :)
@baxtables
4 жыл бұрын
Why cry mate???
I really love this channel, thank you so much! one question is that is the blue line caculated from the least squared method?
@statquest
3 жыл бұрын
Yes, it is!
Thank You Statquest your video and my knowledge of R^2 have a R^2 of 99.99
@statquest
4 жыл бұрын
BAM! :)
You know what i decided to start watching your videos from the beginnimg .. baaam .. thanks
@statquest
2 жыл бұрын
Awesome! Thank you!
After watching your videos, I aced my stats module!
@statquest
4 жыл бұрын
TRIPLE BAM!!! Congratulations!!! :)
Beutifully explained. Thank you so much.
@statquest
Жыл бұрын
Thank you!
"time spent sniffing a rock"! had me cracking😂.... btw thanks josh for putting such great content up... this channel is the my primary source of building my statistics foundations....
@statquest
Жыл бұрын
Glad you like them!
Very well explained!! Thanks
@statquest
4 жыл бұрын
Thank you! :)
B - E - A - utiful explanation. Thanks
@statquest
4 жыл бұрын
Thank you!!! :)
best video explaining R and R squared ever!
@statquest
3 жыл бұрын
Thank you!
Great video! Thanks a lot!
@statquest
2 жыл бұрын
bam!
phew...!!! finally this concept is clear in my head :) thank you sooo much
@statquest
2 жыл бұрын
Glad it helped!
Very clear explanation!
@statquest
2 жыл бұрын
Glad you liked it!
Hi Josh Starmer Thanks a lot for the explaination. By eye we can see that variation around the mean is higher than variation around the blue line. @ 6 : 15 it is mentioned that size - weigth relationship accounts for the 81% of total variation in the data. However, i feel its the otherway. Variation around the mean contributes higher percentage to the total variation in the data which is 81 % that has been reduced by considering variation around the mean. This means to say that size-wieight relationship contributes to 19 % variation in the data. I have used the word "contributes" instead of "accounts for". Please correct me If am wrong.
@statquest
4 жыл бұрын
I think there are two potential problems with your alternative phrasing. 1) To say "height contributes 19% of the variation in weight", or even " the height-weight relationship contributes 19% of the variation in the data" is to suggest that "height" causes 19% of the variation in "weight". This may be true, but it might not. Since correlation doesn't mean causation, you could run into trouble here. 2) The other thing is about using non-standard terminology that is the reverse of what most people use - this can lead to confusion and unexpected consequences. So you could run into trouble here as well.
Adding to my previous comment , R2 value can be negative when the variance explained by the line is lesser than the variance explained by mean. For example var(mean) = 30 and var(line) = 40 Then R2 = -0.3 There exists such models , perhaps that could be worst models.
@statquest
6 жыл бұрын
This is technically correct, but practically speaking, R-squared is always positive because it is used to compare the least squares residuals for the best fitting model to the least squares residuals for the mean, and the best fitting model can't have larger residuals than the mean, otherwise the best fitting model would be the mean. Does that make sense?
@aamuz1cool
6 жыл бұрын
Completely agree with you in terms of practicality. It doesn't make sense at all. At the end of day you want a model which performs better than the base model. My point was it can be negative. Nevertheless i really like your videos. That comment of mine was just to clarify my understanding and to reach out to you.
@statquest
6 жыл бұрын
I was thinking more about the negative R-squared and how it could be used in practice. I mean, like you said, even if your model is terrible, worse than the mean, it still might be nice quantify how terrible it is - and that's where the negative R-squared could come in handy. It still has the same meaning, except now you're quantifying how much worse your model is than the mean. Interestingly, it still works out even if var(terrible model) is so bad that the R-squared is less than -1. For example, if var(mean) = 50 and var(terrible model) = 100, then R-squared = (50 - 100) / 50 = -1, so "terrible model" is 100% worse than the mean. If var(terrible model) = 150, then R-squared = (50 - 150) / 50 = -2, and now terrible model is 200% worse.
@aamuz1cool
6 жыл бұрын
Right , That's my point. From my own experience , I used to train multiple models on a sample dataset and compute their respected R-squared value to choose the best among those models. There I encountered some models returning negative R-squared value. Those models are practically useless and if you agree that happens when your training data is so huge and the algorithm you are using is so insignificant, like using a multi variant regression for a heavily skewed target variable.That was the motivation behind my comment. I appreciate your time to reply back to my comments. I am glad that it grabbed your attention Mr. Josh.
@spacedustpi
4 жыл бұрын
@@statquest I asked a question about this too and I assumed you meant the best fitting line (even though it was not explicitly stated in the video), or at least one that performed better than the mean line.
woah thanks for this one too Josh! finally gets R2
@statquest
2 жыл бұрын
Triple bam! :)
Zedstatistics coupled with statQuest is just absolutely magnifique
@statquest
4 жыл бұрын
Awesome! :)
Dude..this friggin rocks.. THAKS YOU!!!!!
@statquest
Жыл бұрын
Thanks!
my dude I understood and I am happy 8-year-old video is this good liked, subbed and thank you!
@statquest
Жыл бұрын
My dude! Thank you very much! :)
One of best videos, thanks
@statquest
3 жыл бұрын
Wow, thanks!
6:05 explains R^2 accounts for the variation of relationships
Nice explanation!
@statquest
2 жыл бұрын
Thanks!
Good explanations!
@statquest
2 жыл бұрын
Thanks!
The best explaination I can find
@statquest
3 жыл бұрын
Thanks!
love your videos!
@statquest
5 жыл бұрын
Thanks!
Awesome explanation
@statquest
2 жыл бұрын
Thanks!
Really awesome lecture
@statquest
2 жыл бұрын
Thanks a lot!
Came here from the Pearson's correlation video. Thank you so much for this I just wish that you could show in the video: • how (Var(mean)-Var(line)) / Var(mean) is equal to [Covar(x,y) / (Var(x)^-2)(Var(y)^-2)]^2 • whether (Var(mean)-Var(line)) / Var(mean) using mean and differences from the x-axis also yields the same value Again, thank you for the video
@statquest
9 ай бұрын
I'll keep that in mind.
the best explanation as usual
@statquest
5 жыл бұрын
Thanks! :)
You goddamm beautiful man, Im eating your videos like candy nowadays, Im finishing an electrical and comms engineering degree and working with some computer science and I usually get hammered with statistical questions when I finish presenting my models, thanks to your uploads i've held my own against some nasty expert old timers, thank you for this.
@statquest
2 жыл бұрын
Awesome! TRIPLE BAM! :)