In this #statistics tutorial, we learn how to use paired t-test (dependent sample t-test) to compare means of 2 matched, paired, or dependent groups. We also cover building a confidence interval for the mean difference, as well as how this can be used to test a hypothesis. To learn how to conduct paired t-test with R watch this video: (ua-cam.com/video/yD6aU0fY2lo/v-deo.html) 👍🏼Find Best Statistics & R Programming Tutorials here: ( goo.gl/4vDQzT ) ►► Like to support us? You can Donate (bit.ly/2CWxnP2), Share our Videos, Leave us a Comment, Give us a Like or Write us a Review! Either way, We Thank You!
I love the way you teach. There are concepts that you've already taught us so many many times in previous lectures but you kept bringing them up to do a "memory refresh". This way, we won't forget about them anymore.
Sir your quality of teaching is significantly good. After adopting for Data Science I had trouble with statistics,but this set of vedios cleared my doubts and gave me confidence in stats. Thank you sir...!Hope u will make more such high quality vedios in future.
Sir Your quality of teaching is so good. I mean even after paying on MOOC's we don't get such quality and you are providing it for free. Thank you sir we are very grateful to you. This world need teachers like you, salman sir, 3B1B and many more. You are a hope for students like us.
@@YourDad-dh6fj no matter how much you know there is always more to learn ;) glad to hear it went better than expected! best of luck with your studies.
Since the research question (alternative) is to see if it lowered, The null hypothesis should be greater or equal than 0. Hypothesis 101 says both alternative and null have to account for all possibilities. What happens if mean difference is greater than 0?
you can write Ho that way as well. here, Ha: mean=0. here is the thing. first, you are never trying to "prove a null" and so if Ho is mean=0, or mean>=0 you never prove/provide evidence for the null (you are interested in providing evidence that Ha is true), and so it doesn't matter too much how you express Ho it in terms of the notation. also, in terms of how the test is carried out, you begin by assuming Ho to be true, and then working out how likely you would be to observe the sample estimate/statistic you did, or one even more extreme if Ho were true (called the p-value). regardless of if you express it as Ho: mean=0, or Ho: mean>=0, when calculating a p-value you will work with a null value for the estimate/statistic (its expected value) of mean=0. what i mean by that is, with Ho:mean=0, assuming Ho to be true means you assume the true/population mean difference is 0. and if you assume that Ho: mean>=0, then assuming Ho to be true means you are assuming that the true/population mean difference is 0 or larger...and the smallest value you will assume if mean>=0 is to assume the mean equals 0. the point of that whole last paragraph is to say that regardless of whether you write Ho:mean=0, or Ho: mean>=0, all of the test is carried out in the exact same way, and the conclusions you can draw are the exact same, and it makes no difference. i tend to prefer to always write Ho as = some hypothesized value, because in order to carry out a hypothesis test, you have to assume some value (not a range of values) under the null hypothesis, and expressing Ho this way is a bit clear i believe.
Hi, thank you for your video! I would like to know how do you obtain the t= 2.22 use in the minute 11:09. I am looking at the table of T-distribution One tail df=8 and alpha=0.05 and the number that comes up is 1.86. Could you explain it? Thank you!
For hypothesis testing, can we use p-value cut-off as 0.05 as you have done but choose Confidence at 99%. Or does it always follow like (0.05 p value for 95% CI) and (0.01 for 99% CI) and so on.
Is the reason why we are assuming normal differences that we cannot apply the central limit theorem? Otherwise the CLT would guarantee us the normality of the mean no? In case my first question/assumption is true, why would we need a t-distribution? We know then that the mean is normal right?
Thank you for the very clear lecture. At 13:57 where you discuss what to do if the large-n assumption is not met, isn't this assumption not met for the example you presented with 11 samples? This data isn't normally distributed but rather T-distributed, but your analysis is still valid, since you are using the T-test (rather than the Z-test) to estimate p
Started this playlist over a year ago and quit, now I'm back to finish it. Statistics defeated me twice in college (got a D then a C when forced to retake it for my major) but I'm going to win in the end.
Thank you so much to create this videos. All of them are great! Congratulations! I'm not sure if understand right but the t-value (at 10:28) don't should be 1.812 (95% C.I., df=10)?
Thanks, we appreciate that! a t value of 1.812 with df=10 would have 5% above it (and 5% below -1.812)..and so using a t=1.812 would have 90% in between -1.812 and +1.812, and would result in a 90% confidence interval. i hope that helps clear it up
at 9:40 I don't see at all how the 95% changes the result of the calculation you did for the confidence interval. 0.95 appears no where in the calculations
Hi, I'm a bit unclear if you asking about the order in which they are subtracted, or just why the two are subtracted, so i will try and address both. We take the difference between the two paired observations (Y1 - Y2) so that we can see the change/difference (di) for each pair of individuals. they can be subtracted in any order, it doesn't matter, as long as yo interpret it correctly. here, we subtract them as (after-before) so that we can see the how the after measurement compares to the before, and subtracting in this order means that if the measurement after is lower (if it decreased) then the difference will come out to be a negative number (e.g. it before=10 and after=7, then there has been a decrease of 3, and di=after-before=7-10=-3). yip could of course subtract them in the opposite order (and just make sure the interpretation is correct), e.g. before-after=10-7=+3, the measurement was 3 higher before the treatment. hope that clarifies things.
Why is it after minus before? I believe you explained it, but I'm not sure I understand 100%. In my assignment, I am doing it keeps changing back and forth.
Dear sir, please tell me which statistical test is appropriate for me , if there are two groups and two different emotions are there and i need to compare between two emotions for both the groups.
It is more interpretable that way. If before is 125 and after is 120, then (aft - bef) is -5, or a decrease of 5. But if you reverse the order only the sign changes, so that is fine too. If you did (bef - aft) you’d get +5, or that it was 5 higher before. Only the sign changes so it doesn’t really matter, but it’s a bit simpler to interpret in the order I’ve subtracted them
Would the Independent variable be: the individual being tested. And there be one dependant variable & two levels: the blood pressure before and after treatment?
The independent variable is time (before/after), and the dependent variable is blood pressure. But since the before-after measurements are paired, we can take their difference and then work with the difference in blood pressure
So my mean of the difference between the two sets of values ended up being 0. Does that mean something special about the data I'm given or I should take the absolute values of difference?
this seems pretty unlikely for it to come out to exactly 0....but what that is telling you is that the average difference/change is 0....on average, there is no change/difference in the two paired measurements
a rough guideline is that n>20 to n>30 is "large enough". this is just a guide. the more symmetric the distribution of the individual values is, the smaller the sample size can be, and the more skewed the individual values/population is the larger the sample size needs to be....but 20-30 is a general rough guideline for "large enough"
"Satisthics is hard to say"... I subscribed while watching because this was such a great tutorial, but if I haden't already, I definitely would have subscribed for the cute kid at the end :D
Hi, that is the value of t )for the degrees of freedom in the problem) that contains 95% within +/- t. The value would be found manually either using a t table, or if could be found using statistical software
it doesn't really matter, as long as you interpret it correctly. probably more intuitive to subtract as (After-Before), so that a negative number would mean that the after is smaller...or that there has been a decrease after treatment....but really it doesn't matter as long as you interpret the change correctly.
We take the difference between the two paired observations (Y1 - Y2) so that we can see the change/difference (di) for each pair of individuals. they can be subtracted in any order, it doesn't matter, as long as you interpret it correctly. here, we subtract them as (after-before) so that we can see the how the after measurement compares to the before, and subtracting in this order means that if the measurement after is lower (if it decreased) then the difference will come out to be a negative number (e.g. it before=10 and after=7, then there has been a decrease of 3, and di=after-before=7-10=-3). you could of course subtract them in the opposite order (and just make sure the interpretation is correct), e.g. before-after=10-7=+3, the measurement was 3 higher before the treatment. hope that clarifies things.
many of my students get caught up here.... these 2 videos should help explain why we divide by (n-1) when calculating the SD, and why we divide by (n) for the SE... Standard deviation: ua-cam.com/video/nlm9gfso4mw/v-deo.html Standard Error of The Mean: ua-cam.com/video/-Xz89dB_Hco/v-deo.html
it's a cool, yet simple concept. the piece of glass im writing on is between me and the camera,...after recording the image is then flipped/mirrored, so the writing appears the correct way. im actually right handed, but i appear left handed because of the mirroring of the image.
hi, you are simply making a calculation error i believe. have you tried calculating the mean again? regarding the SD, it is calculated in the usual way, working through the formula for SD...for each observation you take the difference between the value and the mean (-6.18), then you square these, sum them all up, and divide by n-1. we have a separate video showing the formula for calculating the SD. we also dont focus on this formula, as you would rarely ever calculate the SD by hand...all of this is done using software, and so we choose to focus on the concepts, and not the formulas to calculate this by hand. hope that clears things us
it is fine to think of it that way....essentially we want to test if the means are different...BUT, we express it as first taking the difference (x1-y1), (x2-y2),... and then calculating the mean of these, as this expression notes that we are incorporating the fact that observations are paired/dependent...and working with the difference between the paired observations....which will result in a different standard error for the estimate
In this video I show the formula for SD. ua-cam.com/video/nlm9gfso4mw/v-deo.html But, in the real world you will almost never calculate a SD by hand...and so I focus more on the concepts in these videos
Hi, there is not a "formula" for calculating the p-value. you either have to look it up in a "t-table" (a sort of old fashioned way of doing it), or have software calculate it for you...we have a video showing how to do that using R here: (ua-cam.com/video/ETd-jPhI_tE/v-deo.html). you can also find things online where you can enter a t-value and its degrees of freedom, and have the p-value returned to you.
In this #statistics tutorial, we learn how to use paired t-test (dependent sample t-test) to compare means of 2 matched, paired, or dependent groups. We also cover building a confidence interval for the mean difference, as well as how this can be used to test a hypothesis. To learn how to conduct paired t-test with R watch this video: (ua-cam.com/video/yD6aU0fY2lo/v-deo.html) 👍🏼Find Best Statistics & R Programming Tutorials here: ( goo.gl/4vDQzT ) ►► Like to support us? You can Donate (bit.ly/2CWxnP2), Share our Videos, Leave us a Comment, Give us a Like or Write us a Review! Either way, We Thank You!
I've just subscribed to you cuz you can write in mirror 👐👐
Thank you for such a good video, do you have stats courses using python or whom can you recommend?
Love the technique of showing a reversed 'blackboard' with the lecturer speaking to us. Have not seen this before but it is very engaging and helpful.
I love the way you teach. There are concepts that you've already taught us so many many times in previous lectures but you kept bringing them up to do a "memory refresh". This way, we won't forget about them anymore.
Sir your quality of teaching is significantly good. After adopting for Data Science I had trouble with statistics,but this set of vedios cleared my doubts and gave me confidence in stats. Thank you sir...!Hope u will make more such high quality vedios in future.
thanks! we plan to keep making videos for the foreseeable future.
Sir Your quality of teaching is so good. I mean even after paying on MOOC's we don't get such quality and you are providing it for free. Thank you sir we are very grateful to you. This world need teachers like you, salman sir, 3B1B and many more. You are a hope for students like us.
thanks, we put a lot of time and effort into creating these, and appreciate hearing that!
Was able to follow along with you as I worked with my own data! You are amazing, thank you so much!!!
Thanks for your tutoring video. Your one video explains clearly everything that my professor tried to teach for 2 classes.
Glad you found the video useful Sean!
This is really good!! You're great at boiling down these confusing topics and ordering them in a sensical way
thanks, appreciate that!
This is clearly explains the p-value. Thank you very much.
This was really informative in a way i can understand! My biostatistics exam is coming up and i appreciate this immensely, thankyou so much!
you're welcome :) hope the exam went well!
@@marinstatlectures it went better than i thought, there is still, as always, alot more to learn. Thankyou again!
@@YourDad-dh6fj no matter how much you know there is always more to learn ;) glad to hear it went better than expected! best of luck with your studies.
Since the research question (alternative) is to see if it lowered, The null hypothesis should be greater or equal than 0. Hypothesis 101 says both alternative and null have to account for all possibilities. What happens if mean difference is greater than 0?
you can write Ho that way as well. here, Ha: mean=0. here is the thing. first, you are never trying to "prove a null" and so if Ho is mean=0, or mean>=0 you never prove/provide evidence for the null (you are interested in providing evidence that Ha is true), and so it doesn't matter too much how you express Ho it in terms of the notation.
also, in terms of how the test is carried out, you begin by assuming Ho to be true, and then working out how likely you would be to observe the sample estimate/statistic you did, or one even more extreme if Ho were true (called the p-value). regardless of if you express it as Ho: mean=0, or Ho: mean>=0, when calculating a p-value you will work with a null value for the estimate/statistic (its expected value) of mean=0. what i mean by that is, with Ho:mean=0, assuming Ho to be true means you assume the true/population mean difference is 0. and if you assume that Ho: mean>=0, then assuming Ho to be true means you are assuming that the true/population mean difference is 0 or larger...and the smallest value you will assume if mean>=0 is to assume the mean equals 0.
the point of that whole last paragraph is to say that regardless of whether you write Ho:mean=0, or Ho: mean>=0, all of the test is carried out in the exact same way, and the conclusions you can draw are the exact same, and it makes no difference. i tend to prefer to always write Ho as = some hypothesized value, because in order to carry out a hypothesis test, you have to assume some value (not a range of values) under the null hypothesis, and expressing Ho this way is a bit clear i believe.
Hi, thank you for your video! I would like to know how do you obtain the t= 2.22 use in the minute 11:09. I am looking at the table of T-distribution One tail df=8 and alpha=0.05 and the number that comes up is 1.86. Could you explain it? Thank you!
Shouldn't you be using a df of 10 instead of 8. But yeah I also got different number, 1.812.
make sure you use the t table for two-tailed tests. i've checked it and it was 2.22
sir you are a great teacher
Hi - why do you do (after-before) instead of (before-after)? Can you do both and still get a valid answer? Thanks.
Same question I had before. I had tried both using SPSS and get a valid answer.
For hypothesis testing, can we use p-value cut-off as 0.05 as you have done but choose Confidence at 99%. Or does it always follow like (0.05 p value for 95% CI) and (0.01 for 99% CI) and so on.
Is the reason why we are assuming normal differences that we cannot apply the central limit theorem? Otherwise the CLT would guarantee us the normality of the mean no?
In case my first question/assumption is true, why would we need a t-distribution? We know then that the mean is normal right?
Thank you for the very clear lecture. At 13:57 where you discuss what to do if the large-n assumption is not met, isn't this assumption not met for the example you presented with 11 samples? This data isn't normally distributed but rather T-distributed, but your analysis is still valid, since you are using the T-test (rather than the Z-test) to estimate p
hmm i guess that is for the sake of simplicity. He could have use 100-200 observation but he didn't have enough inverted board to write :))))
Started this playlist over a year ago and quit, now I'm back to finish it. Statistics defeated me twice in college (got a D then a C when forced to retake it for my major) but I'm going to win in the end.
Thank you so much to create this videos. All of them are great! Congratulations!
I'm not sure if understand right but the t-value (at 10:28) don't should be 1.812 (95% C.I., df=10)?
Thanks, we appreciate that! a t value of 1.812 with df=10 would have 5% above it (and 5% below -1.812)..and so using a t=1.812 would have 90% in between -1.812 and +1.812, and would result in a 90% confidence interval. i hope that helps clear it up
I get it now! Thank you so much for clear it up!
@@marinstatlectures Thank you sir for explanation.
While calculating the confidence interval either the lower bound or the upper bound is needed right? as it is a one-sided test
at 9:40 I don't see at all how the 95% changes the result of the calculation you did for the confidence interval. 0.95 appears no where in the calculations
Can you please tell why you subtract X1from X2?is it because it says the value before and after? And to determine Di When we will subtract from X1-X2?
Hi, I'm a bit unclear if you asking about the order in which they are subtracted, or just why the two are subtracted, so i will try and address both. We take the difference between the two paired observations (Y1 - Y2) so that we can see the change/difference (di) for each pair of individuals. they can be subtracted in any order, it doesn't matter, as long as yo interpret it correctly. here, we subtract them as (after-before) so that we can see the how the after measurement compares to the before, and subtracting in this order means that if the measurement after is lower (if it decreased) then the difference will come out to be a negative number (e.g. it before=10 and after=7, then there has been a decrease of 3, and di=after-before=7-10=-3). yip could of course subtract them in the opposite order (and just make sure the interpretation is correct), e.g. before-after=10-7=+3, the measurement was 3 higher before the treatment.
hope that clarifies things.
Thanks so much. It helps a lot. Cheers!!
"p-value is a guide not a magic number"- By Marin
Great words😂😂
Great quality tutorial sir. Hoping for more statistics lectures.
thanks! we're hoping to begin working on more stats lectures over the coming months
This is well done, how do you create the light pen on-screen effect?!
Why is it after minus before? I believe you explained it, but I'm not sure I understand 100%. In my assignment, I am doing it keeps changing back and forth.
Thank you brother; Lord Jesus will Bless you.
Excellent video!!
Thanks :)
Thank you, it is really helpful
Dear sir, please tell me which statistical test is appropriate for me , if there are two groups and two different emotions are there and i need to compare between two emotions for both the groups.
If they’re both categorical variables then you can do chi square test, fishers exact, RR, OR, ...
Why are you substracting (after - before) what if we do otherwise could you explain
It is more interpretable that way. If before is 125 and after is 120, then (aft - bef) is -5, or a decrease of 5. But if you reverse the order only the sign changes, so that is fine too. If you did (bef - aft) you’d get +5, or that it was 5 higher before. Only the sign changes so it doesn’t really matter, but it’s a bit simpler to interpret in the order I’ve subtracted them
@@marinstatlectures thank you
Great explanation, thanks!
Would the Independent variable be: the individual being tested. And there be one dependant variable & two levels: the blood pressure before and after treatment?
The independent variable is time (before/after), and the dependent variable is blood pressure. But since the before-after measurements are paired, we can take their difference and then work with the difference in blood pressure
Thank you, this very helpful
How did he find the p value using the t-stat?
Why I am not getting your feeds.. I thought you went away.. so relieved !!!
i am so sorry... but im quite confused where you get the Standard deviation? i am so sorry...
So my mean of the difference between the two sets of values ended up being 0. Does that mean something special about the data I'm given or I should take the absolute values of difference?
this seems pretty unlikely for it to come out to exactly 0....but what that is telling you is that the average difference/change is 0....on average, there is no change/difference in the two paired measurements
very nice !great explanation :)
thanks!
Thank you so much for your generosity! 🙏 If I may ask, when can we consider our sample large pr small?
a rough guideline is that n>20 to n>30 is "large enough". this is just a guide. the more symmetric the distribution of the individual values is, the smaller the sample size can be, and the more skewed the individual values/population is the larger the sample size needs to be....but 20-30 is a general rough guideline for "large enough"
"Satisthics is hard to say"... I subscribed while watching because this was such a great tutorial, but if I haden't already, I definitely would have subscribed for the cute kid at the end :D
Hi could you please explain how we obtain 2.22 as the 't' value. I would really appreciate it.
Hi, that is the value of t )for the degrees of freedom in the problem) that contains 95% within +/- t. The value would be found manually either using a t table, or if could be found using statistical software
@@marinstatlectures if we use the T table... How do we figure out which one is it?
Great video!
thanks!
When do we subtract before from after and after from before? or it doesn't matter?
it doesn't really matter, as long as you interpret it correctly. probably more intuitive to subtract as (After-Before), so that a negative number would mean that the after is smaller...or that there has been a decrease after treatment....but really it doesn't matter as long as you interpret the change correctly.
@@marinstatlectures Thank you!
roses are red, violets are blue, there's always a youtube video better than school :)
Did you fail literature?
Thank you!!
You’re welcome
Why not before - after? Does it matter? The sign of the value would change..can explain?
We take the difference between the two paired observations (Y1 - Y2) so that we can see the change/difference (di) for each pair of individuals. they can be subtracted in any order, it doesn't matter, as long as you interpret it correctly. here, we subtract them as (after-before) so that we can see the how the after measurement compares to the before, and subtracting in this order means that if the measurement after is lower (if it decreased) then the difference will come out to be a negative number (e.g. it before=10 and after=7, then there has been a decrease of 3, and di=after-before=7-10=-3). you could of course subtract them in the opposite order (and just make sure the interpretation is correct), e.g. before-after=10-7=+3, the measurement was 3 higher before the treatment.
hope that clarifies things.
how to get formula for sd?? i dont get itttt 😭
Only if I had a teacher like him...
Come to UBC and you will :)
Shouldn't we use sqrt(10) instead of sqrt(11) since that's the degree of the freedom?
Nope when you calculate Standard error you should be dividing by square root of total observations
many of my students get caught up here.... these 2 videos should help explain why we divide by (n-1) when calculating the SD, and why we divide by (n) for the SE...
Standard deviation: ua-cam.com/video/nlm9gfso4mw/v-deo.html
Standard Error of The Mean: ua-cam.com/video/-Xz89dB_Hco/v-deo.html
you go you
how did you do the video, you writing but facing audiance?
it's a cool, yet simple concept. the piece of glass im writing on is between me and the camera,...after recording the image is then flipped/mirrored, so the writing appears the correct way. im actually right handed, but i appear left handed because of the mirroring of the image.
@@marinstatlectures
Thx man
People like you, giving knowledge to everyone should be rewarded. I hope you are.
Good video but I think being a one tailed test critical t should be 1.8124.
when i calculate the mean, i end up with -6.8 instyead of -6.18 and i have no clue how you calculated the standard deviation :(
hi, you are simply making a calculation error i believe. have you tried calculating the mean again?
regarding the SD, it is calculated in the usual way, working through the formula for SD...for each observation you take the difference between the value and the mean (-6.18), then you square these, sum them all up, and divide by n-1.
we have a separate video showing the formula for calculating the SD.
we also dont focus on this formula, as you would rarely ever calculate the SD by hand...all of this is done using software, and so we choose to focus on the concepts, and not the formulas to calculate this by hand.
hope that clears things us
Couldn't i set Ho as '(Ua-Ub) >= 0' ?
I think it more makes sense.
it is fine to think of it that way....essentially we want to test if the means are different...BUT, we express it as first taking the difference (x1-y1), (x2-y2),... and then calculating the mean of these, as this expression notes that we are incorporating the fact that observations are paired/dependent...and working with the difference between the paired observations....which will result in a different standard error for the estimate
How to calculate Sd???
In this video I show the formula for SD. ua-cam.com/video/nlm9gfso4mw/v-deo.html
But, in the real world you will almost never calculate a SD by hand...and so I focus more on the concepts in these videos
omg how are you writing backwards???!
I wish I found your channel earlier.
👍🏻
Hi Sir how can you get the P value? what’s the exact formula? thanks
Hi, there is not a "formula" for calculating the p-value. you either have to look it up in a "t-table" (a sort of old fashioned way of doing it), or have software calculate it for you...we have a video showing how to do that using R here: (ua-cam.com/video/ETd-jPhI_tE/v-deo.html). you can also find things online where you can enter a t-value and its degrees of freedom, and have the p-value returned to you.
I honestly thought Mike Glennon was teaching stats
Really, Mike Glennon? At least give me someone like Nick Foles...an overachieving backup (or underachieving starter) ;)
@@marinstatlectures haha I can see the Nick Foles a little too. Super Bowl Champ Nick Foles it is :)
MVP! ;)
are you writing backwards wtf
ok
i am dumb
“...statistical significance is different from clinical significance...”
Literally don’t care. Just wanna pass my stats test tmr 🙏🙏🙏