 All right, we're going to continue to talk about the normal distribution in this video and in particular we're going to learn how to actually calculate the confidence interval from the normal distribution. And so, in the past, we have defined our 95% confidence interval. As the mean plus or minus the two times the standard deviation. And so, in effect, that looked something like using our data from above, we calculated the mean and standard error of our p hat distribution mean r minus two times s e r comma mean r plus two times s e r. Then we can print the confidence interval. And so here we can see that the 95% confidence interval is that is 0.37 to 0.63. But this is an approximation. Normally, our value here is usually calculated from something known as a z star z or z statistic. So in order to do that, we need to specify the interval equals 95. And then we calculate the z star, which is just using stats.norm.interval of p divided by 100. And what we want to do is convert this into an array. So we can run that. You can look at z star, which is minus 0.1.95 plus 1.95. And we can see how that is very close to two. So what we have been doing so far in this class is using two as a very easy approximation for the actual z star value, which is 1.95996398. So if we want to do confidence interval with this z star, we can really use the same formula. I'm going to copy this down. But instead of two, we can use the actual value. So we don't need to do an array because this value already has the negative and the positive here. So I'm going to erase that. Still say mean R, but replace two with z star times the standard error for R. So we can run this. And we can see that it has lifted. We do this, change this to a plus. It goes back to the order smaller versus larger because that's adding a negative and then adding a positive. And so we can see that it actually is very similar. Once it gets out to this third digit is where we start to see differences in the confidence interval. But the benefit to doing this type of methodology is that we can easily change our confidence interval to whatever confidence level we want by just changing this p value. So if we want the 80th confidence interval, all I need to do is change that to 80. My z star changes. And now my confidence interval has changed. And so this is a very easy way to do confidence intervals. And it's something that you would normally do in a traditional statistics class where you would look up this z star value for your different confidence level and do a calculation. But it's important to note that this style of doing confidence intervals assumes that your data is normally distributed and that it is sufficiently large enough to do this type of statistical analysis on it because it is following the central limit theorem, which we talked about earlier in the lesson.