Welcome to Nick Does Stats. We are going to do some confidence intervals today. Let's have a look.
And it's all about one of my favorite things, cheesecake. So, we want to measure the fat content of cheesecake slices. Fair enough.
We're going to measure it using a cheese cake fat content measuring machine. I won't lie. I have no idea how one measures the fat content in cheesecake.
Maybe you eat a lot of it and see how much weight you gain. I'll give it a go. I'm up for it.
Um but what however we measure it, this measurement is known to be normally distributed with a standard deviation of 1. 1 gram. The point is it's not perfect.
If you measure the fat content of the same slice of cheesecake multiple times, you will get that 1. 1 gram standard deviation in your measurements. Not too too bad.
So we are comparing two types of cake. Cake A and cake B. And we measure the fat content of eight slices for each cake.
I think in the original question they go on and tell us that the cake slices are 100 grams. All right. So each cake slice is 100 grams and this one has 21.
9 gram of fat out of 100 grams etc etc etc. Okay. Fine.
Just for context. Just for context. Now our job here is to find a 98% confidence interval for the difference in mean fat content between cakes A and cake B.
And then we're going to play around a little bit in part B. Now, to speed things up, I've already plugged these into my trusty trusty calculator, I do believe. And there we go.
So, calc I'll just double check. List four, list five. And the calculator does tell me that uh the mean for cake a uh xar a is equal to 23.
5. And it's also telling me that the mean for cake B is 22. 3 75.
Now remember then um because it's normally distributed even with a small sample size of eight. We know that Xbar will be normally distributed with a mean mu. Oh, let's go.
Oh, capital X a with mua and we know the variance is 1. 1. So it's 1.
1^ squar over 8. Uh the mean for the mean weight. So this number here is actually normally distributed with mean muub and 1.
1^ squ over 8 which is kind of nice. Right now, we want to compare. We want to look at the difference between the two.
So, I'm going to go X a minus XB. That does make sense. Looking at my numbers, that will be normally distributed with you subtract the means and we're going to add the variances.
So, that will be 1. 1^2 over 8 plus 1. 1^2 over 8.
That is 1. 1^2 over 4 to you and me. Right now, it's a 98% confidence interval.
Right? 98% confidence interval. So, if I'm thinking in terms of zed, that's zero.
I want 1% at the top. I want 1% at the bottom. I did have this in here somewhere, but we'll just grab it again.
2. 326 and that's minus 2. 326.
So my confidence interval is going to be I take my test statistic. So that is 23. 5 minus 22.
375 plus or minus 2. 326 times the standard deviation. My standard deviation is square root of that which is going to be 1.
1 over 2. So let's see what that does for me. 23.
5US 22. 37 plus 2. 326 * 1.
12 2. 443 4043 is my top one and my bottom one let's put a minus in there minus0. 1543 unless I'm very very much mistaken.
So there we go. That is my 98% confidence interval. Again, what does this mean?
Is if I was to do this with lots of different samples of size eight of both of them and I look at the difference, 90% of those should lie in there or 98%. If I do n if I do lots of these intervals, 98% of them will capture the mean. It will be in there somewhere.
It's a weird distinction for confidence intervals, but there we go. Right. What if this was the confidence interval?
Well, what if that was the confidence interval? So, we're going to have to go back up here. So, I ran out of space, didn't I?
Now, the nice thing to know is that well, basically, if I take the width of that confidence interval, well, that is two times the zed value times that standard deviation. Okay? Because the top one is just that plus that and the bottom is that minus that.
So if I subtract them, you get twice that 1. 935 minus 0. 315 1.
62 equals 1. 1 zed. The twos cancel out.
So I get zed is oh what is that? 81 over 55. Cool.
So really what I want to know is well what's these probabilities either side? So I can just go ask the calculator distribution normal. All right, because basically what I want is I'm going to look at the probability of being less than that and I get so the probability that zed is between minus 81.
So depending on your calculator, you can do this in a bunch of different ways, but this is 0. 859. So it is 86%.
That is an 86% confidence interval. And I'm back. Voila.
Nice little bit of confidence interval using a non-paired sample, which is important, right? We do it slightly differently with a non-paired with a paired sample, but these are eight cakes. Eight completely different cakes.
So, it does something slightly different for my uh for my standard deviation. So, that's important to know. Drp us a like, drop us a comment, please subscribe, please hit the bell for notifications so you know when new stuff is coming out.
I was Nick. This was some stats. A little bit different today.
I will see you next time. See you. [Music] Welcome to Nick Does Stats.
We are going to do some confidence intervals today. Let's have a look. And it's all about one of my favorite things, cheesecake.
So, we want to measure the fat content of cheesecake slices. Fair enough. We're going to measure it using a cheese cake fat content measuring machine.
I won't lie. I have no idea how one measures the fat content in cheesecake. Maybe you eat a lot of it and see how much weight you gain.
I'll give it a go. I'm up for it. Um but what however we measure it, this measurement is known to be normally distributed with a standard deviation of 1.
1 gram. The point is it's not perfect. If you measure the fat content of the same slice of cheesecake multiple times, you will get that 1.
1 gram standard deviation in your measurements. Not too too bad. So we are comparing two types of cake.
Cake A and cake B. And we measure the fat content of eight slices for each cake. I think in the original question they go on and tell us that the cake slices are 100 grams.
All right. So each cake slice is 100 grams and this one has 21. 9 gram of fat out of 100 grams etc etc etc.
Okay. Fine. Just for context.
Just for context. Now our job here is to find a 98% confidence interval for the difference in mean fat content between cakes A and cake B. And then we're going to play around a little bit in part B.
Now, to speed things up, I've already plugged these into my trusty trusty calculator, I do believe. And there we go. So, calc I'll just double check.
List four, list five. And the calculator does tell me that uh the mean for cake a uh xar a is equal to 23. 5.
And it's also telling me that the mean for cake B is 22. 3 75. Now remember then um because it's normally distributed even with a small sample size of eight.
We know that Xbar will be normally distributed with a mean mu. Oh, let's go. Oh, capital X a with mua and we know the variance is 1.
1. So it's 1. 1^ squar over 8.
Uh the mean for the mean weight. So this number here is actually normally distributed with mean muub and 1. 1^ squ over 8 which is kind of nice.
Right now, we want to compare. We want to look at the difference between the two. So, I'm going to go X a minus XB.
That does make sense. Looking at my numbers, that will be normally distributed with you subtract the means and we're going to add the variances. So, that will be 1.
1^2 over 8 plus 1. 1^2 over 8. That is 1.
1^2 over 4 to you and me. Right now, it's a 98% confidence interval. Right?
98% confidence interval. So, if I'm thinking in terms of zed, that's zero. I want 1% at the top.
I want 1% at the bottom. I did have this in here somewhere, but we'll just grab it again. 2.
326 and that's minus 2. 326. So my confidence interval is going to be I take my test statistic.
So that is 23. 5 minus 22. 375 plus or minus 2.
326 times the standard deviation. My standard deviation is square root of that which is going to be 1. 1 over 2.
So let's see what that does for me. 23. 5US 22.
37 plus 2. 326 * 1. 12 2.
443 4043 is my top one and my bottom one let's put a minus in there minus0. 1543 unless I'm very very much mistaken. So there we go.
That is my 98% confidence interval. Again, what does this mean? Is if I was to do this with lots of different samples of size eight of both of them and I look at the difference, 90% of those should lie in there or 98%.
If I do n if I do lots of these intervals, 98% of them will capture the mean. It will be in there somewhere. It's a weird distinction for confidence intervals, but there we go.
Right. What if this was the confidence interval? Well, what if that was the confidence interval?
So, we're going to have to go back up here. So, I ran out of space, didn't I? Now, the nice thing to know is that well, basically, if I take the width of that confidence interval, well, that is two times the zed value times that standard deviation.
Okay? Because the top one is just that plus that and the bottom is that minus that. So if I subtract them, you get twice that 1.
935 minus 0. 315 1. 62 equals 1.
1 zed. The twos cancel out. So I get zed is oh what is that?
81 over 55. Cool. So really what I want to know is well what's these probabilities either side?
So I can just go ask the calculator distribution normal. All right, because basically what I want is I'm going to look at the probability of being less than that and I get so the probability that zed is between minus 81. So depending on your calculator, you can do this in a bunch of different ways, but this is 0.
859. So it is 86%. That is an 86% confidence interval.
And I'm back. Voila. Nice little bit of confidence interval using a non-paired sample, which is important, right?
We do it slightly differently with a non-paired with a paired sample, but these are eight cakes. Eight completely different cakes. So, it does something slightly different for my uh for my standard deviation.
So, that's important to know. Drp us a like, drop us a comment, please subscribe, please hit the bell for notifications so you know when new stuff is coming out. I was Nick.
This was some stats. A little bit different today. I will see you next time.
See you.