# Statistics – Introduction to Confidence Intervals | Margin of Error | Standard Error | Proportions

Hi this is Christopher Ferbrache and I’m going to review confidence intervals and t distributions Okay we’ll get started so this section it covers the t distribution and confidence intervals and they are frequently put together and that’s um because of a couple reasons but we’ll go over it um we’ll go over in the notes primarily it’s because we are to the phase in statistics where we’re now starting to look at other similar distributions to the z distribution when we have let’s say data that is not necessarily as normalized or we’re a little bit unsure about but with certain types of adjustments we can still apply some decision making to it and one way that we can do that is with confidence intervals so with confidence intervals it’s one way that we can look at a range of the what the uh mean should be or you know the the probability that the mean will be around a certain number and that’s what a confidence interval essentially is and we’ll talk about it more Okay so this says uh the student’s t distribution okay the t distribution takes its name from Will William C Lee Gossett in his 1908 paper Biometrica pinned under the pseudo named student so the deal was he was a um I believe he’s a oh here it says he worked in a brewery well he um he did a lot of sampling in the brewery and he figured out this this t-distribution but he didn’t want to get in trouble so he wrote this paper under the name of student and later they figured out who wrote it but that’s why it’s labeled student it was a way of being anonymous so here’s the the some of the main parts of why we use the t-distribution and it says the t-distribution is used when the population standard deviation is un unknown or so the population standard deviation is unknown okay so right off the bat so we’re unsure about the population standard deviation so we’re going to have to make some some adjustments and we’re going to probably lose some precision just based on that statement then the other one is the sample size is small meaning less than 30. Okay so it’s less than 30 as we’ve taught as we we’ve we described before in uh one of my other uh ones that let’s see with sampling distributions we talked about normalized data and how usually around 30 um the data is considered normalized to that point now 30 isn’t the magic number cut off 100 but it’s a number where it’s around the range where people believe that the data is normalized like I said in the other video if it was if the sample size was 29 that might not be a problem either it’s just 30 is is the the point where most people have decided that it’s probably normalized at that point and then the third one it is unknown if the sample uh comes from a normalized distribution. So one of the the um the deals uh with the sampling distribution and we talked about the theorems and and some of the rules there it was if the sample comes from a normalized distribution then we assume that the sample is normalized and those are the those are probably the the general rules so in this case the t-distribution it is essentially what I would say all of the reasons why we would use the t-distribution and not the z-distribution so the t-distribution is the the uh the prime of that it’s all of the the other times when we don’t use the z we use the t and that’s um that’s kind of the way way this is so it says characteristics of the t distribution so it says it has fat tails so if you take a look at this it says the red curve in the image on the left is a t distribution compared to the normal distribution in blue so what happens is um if you think about a normal distribution we have um it’s technically a perfect normal distribution would be very pointy so the data would be very grouped towards the middle and it makes sense because with everything with the frequency of the data it’s going to group towards the middle and very rare events end up being on the far edges the the tails so when we are less sure if the the data is normalized then um what happens is the the point

of the distribution meaning the and this is the red one the point will come down and the tails get wider and that’s because some of the probability that our our uh our actual in this case our actual say mean of the um the point that we’re looking at that comes from say a population but in this case because we don’t have as good of information it ends up that some of that probability of where that point lies can end up in the tail and so the tails get larger and that’s just that’s I guess the side effect of of uh of the distribution and what it stands for and it stands for um something that’s that’s very similar to the z distribution but it is a little bit more distributed throughout the distribution and it’s not quite as um it’s not quite as centralized in its grouping it’s not as tight in its grouping and um that’s one of the precision issues of uh of the t distribution it’s not as precise in the way that we can do some of our measurements with it we can still come up to conclusions but it but it’s quite possibly not not as accurate because of these things such as the population standard deviation is unknown the sample size is small it’s unknown if the sample comes from a normalized distribution. Okay the next point so um a lot of things I said there but uh if you take a look at this the red line that is the t distribution curve that’s what that represents so t distributions have fatter tails and then as the sample size increases it becomes closer to the z distribution and that’s because as our samples get close larger we actually have better data to work off and it’s a it’s a way that the distribution works that it gets closer um and then the more real let’s see oh the t distribution is more realistic since true population means are rare so I’ve mentioned it a couple times in this course especially when we first started doing continuous distribution calculations the the continuous distribution calculation is not as uh realistic of an example and it’s because we don’t have population data all the time so once we start looking at the sampling distribution and then we start looking at the t distribution the t distribution is really practical because anybody can kind of go out and do this where you don’t always have the population standard deviation if you think about it in your life as you’ll see in this you can go and you can you can do the t-distribution studies a little bit easier than you can the population the population distribution the z-distribution type of studies because we don’t have population standard deviations usually let’s see this other other one down here is used to compare extremes in sample means okay so we can use this to compare extremes and sample means. Okay will be used in a large number of calculations including confidence intervals and hypothesis testing so as I mentioned we’re going to talk about confidence intervals and this actually will be the first part of this video will be the theory and then it will go into the application the application of the these types of calculations with the confidence intervals they’re not they’re not complicated um they’re they’re I always say at all but they’re they’re they’re pretty much not complicated at all compared to some of the things we do so we don’t do hypothesis testing in this video but we will um next week when I make that video Okay so the big deal here to today is we’re going to learn a new table it’s the t t distribution um which has a table and the table is quite a bit different than the z distribution so let’s see the t distribution consists of a distribution of curves so there are many many t distribution curves and that’s the big part of why we have a table like this it says the individual curves relate to the degrees of freedom so um and the degrees of freedom are usually represented as in minus one now um I’ll discuss it next but the reason why we have the minus 1 is because we have an inaccuracy in inherent in this calculation that we’re going to do and because we are estimating

the population standard deviation we have to go and account for that and theoretically the best way to account for that is decreasing the n value by one and so it’s an adjustment because of an inaccuracy built into it okay discuss next and the significance okay says for t distribution confidence level calculations use the two-tailed t-test and select the significance the significance level from the table um that added to the confidence level equals one okay um oh so this is how yeah this works the confidence level is is the beta plus the two-tailed test of significance which is alpha equals one okay so example uh calculating the 98 confidence interval for the t distribution requires one to find the t score if the sample size is eight meaning n equals eight and a two percent significance level uh for the two-tailed distribution will be used as well as the appropriate degrees of freedom to locate the related score from the table okay so for this we have to know the sample size so before we can use this t table we have to look at the sample size and we have to know the significance level now before we were looking at um we’ve looked at the uh essentially we’ve looked at the percentages and the way that um well we haven’t gotten into it too much yet so for for these uh two percent significance level is essentially and this is what it talks about up here the inverse of it is um we’re looking for the 98 area on the inside of the curve so when we say two percent significance level what we’re actually doing is we’re looking at two percent out on the edges and 98 in between the edges or the tail and that’s how that works if it was a two-tailed distribution let’s see and then we have to um look it up with the degrees of freedom okay so we have the degrees of freedom and our n in this case is eight so we’re going to have eight subtract one so we have right here 8 subtract 1 equals 7. so our degrees of freedom are going to be 7 and then this is a little way that we write out the what the inputs are that goes into the uh the numbers that make up the the t uh the t score and so we write them down here like like subscript so it’s like t um two percent and then seven so that’s the two percent significance level and the um the seven for the degrees of freedom and so we look at about on the table we have to have both of these so what we do is we come down here and this is a little little snapshot of what the table at least the table that I use in my classes looks like is um we go down to the degrees of freedom and make sure you remember it’s degrees of freedom not just the n value so it’s seven and then you go over and if we’re looking for the two-tailed test you have to find the right one right here it says two-tailed test two percent and then we go and we take a look at where these intersect and it says 2.998 this is our t-score from the table let’s see it is not a probability it is just like the z-score for the normal distribution so the big deal here is that we use this table to find t scores which are just like z scores so if we think about this where with the z distribution we go and we look up with a z score and we get this area under the curve value so the the actual t table does not give us an area under the curve value the t distribution table putting in those inputs gets us to the t score so it’s it’s different than the z distribution table the z distribution table actually is very dynamic and there’s about three different ways to use it and i haven’t shown them all yet but the big deal here is is the the t table we put in the degrees of freedom and then our significance level based on whether we’re doing a two-tail or one-tail test

and we get the t-score okay and we’ll pull up the full t-table in a little bit let’s see so this talks about the degrees of freedom and the main thing which i spoke about is um when we have an inaccuracy there’s a couple different ways to look at this thing fundamentally the issue is because we are estimating our population parameter because we don’t have a population the population parameter meaning the population standard deviation because we don’t have a population standard deviation we’re estimating it and because we’re estimating it we are introducing some inaccuracy and lack of precision into our calculations so we have to decrease our in by one and that is essentially one of the ways of explaining why we subtract why we have n minus one and if you look at the standard deviation calculations you’ll see the n minus one so it’s the same exact thing and it’s the same reason because with the um sample standard db when we do the sample standard deviations we are introducing a little bit of a lack of precision in the calculation confidence intervals okay so in inferential statistics we have two primary um uh methods of coming to a conclusion type of thing or or uh making decisions one of them is hypothesis testing and that that is a it produces a point estimate so with a hypothesis test we say if we were to do something what is the likelihood that something will be greater than or less than or equal to something and that’s the single point part and with confidence intervals um it says confidence intervals resulting in a large in a uh not large resulting in a range of values above and below the population parameter so with the confidence interval what we’re saying is we are coming to a conclusion or we’re trying to figure out what the probability is based on we say what is this interval what would be the interval um to a certain degree of certainty that the actual population mean lies within um you know accuracy of of uh say five percent type of thing and so we have and then we get these numbers and so it’s based on trying to come up with a range of where that actual mean is that’s what confidence intervals are people confuse that but it’s it’s our confidence level of a range of um of where the actual mean is and that’s what it is now we’re either wrong or where we’re right so either the confidence interval falls within that range or it doesn’t but it’s not it’s not both so that’s that’s something to think about um this is a lot of the ways this is laid out you’ll see that a lot of this we’ve already seen so um let’s see student t distribution confidence interval related so this is sample mean formulas i say sample mean because we have proportions too okay confidence interval for mu with the standard deviation population standard deviation unknown so we use the t distribution so you’ll start to see this where i say you know is we we’re looking for mu but we have an unknown population standard deviation or you’ll see the size of the sample and then it will say whether the sigma is known or unknown and so in this case unknown population standard deviation and we’re looking for mu so we’re going to use the t distribution and this is the formula for this for the confidence interval and so this shouldn’t look too bad you know we’ve already done this this right here we’ve changed up maybe the values just slightly because before we actually had the standard deviation up here that was the population one in this case I’m gonna I’m gonna zoom in just a little bit in this case we have a sample standard deviation up here so it’s the x bar plus and minus we see plus and minus it means we run we we produce the calculation for it being plus and then we run it for it being minus and then this is our t score

that we’re going to get from the table and it’s the t score multiplied by the sample standard deviation over the root of n and that’s that’s all it is these calculations like I said are not bad the standard error which is when the um the population standard deviation is unknown this is the standard error part and this is what this what this does and the standard error is essentially saying that is an estimation of the population standard deviation and then the margin of error for mu with an unknown standard deviation population standard deviation this is the actual margin of error value right there to actually write out the margin then you would um you would actually do the the plus or minus what whatever the x bar is but this is actually the margin of error so you would take this value and you would add it or subtract it to get that margin to actually get the the interval range let’s see for the z distribution very similar it says confidence interval for mu with standard deviation known so in this case we do the same type of setup except we have a z-score and then we have the standard deviation over uh the root of n and then very similar except right here it is the population standard deviation over the root of n and then same thing down here margin of error for mu with population standard deviation known so same type of scenario so we see that z that’s just the z score. Okay and then for proportions same type of scenario we’ve already done these so some of these have the little squiggly lines I think in some of my notes I had the the p bar same it’s the same type of deal it’s um if it’s a different different hat don’t worry about that with this so the same type of deal we have the proportion and then in this case plus or minus and then the z times times this and then uh standard error it’s this whole part and then margin of error is the z times this part and we’ll look at how this works Okay this is the background theory of the confidence intervals and talks about you know that we do confidence intervals to provide an answer of how to deal with uncertainty and it says results derive from data that are randomly selected a subset of population due to the possibility of misunderstanding where the actual population parameter lies the proper method of describing the interval is widely debated so people don’t say you don’t supposed to say the confidence interval there is a 95 technically you also say there’s 95 percent um there’s the uh ninety-five percent of the time it’s between a certain range what you say is um within a ninety-five percent level of certainty it’s within this data what that means is five percent of times you have a five percent chance you’re just not in there and that’s the way it works and this is a little diagram that shows it says um if you look at these different ranges of where a value is um some of these confidence intervals are not going to be where mu actually is and that’s that’s what this is representing um so it says the after all if one calculates the 95 percent interval approximately five percent of the of our time the ninety-five percent interval will be um will be wrong so one hundred percent so um five percent of time our ninety-five percent confidence interval will just be wrong and that’s because that’s the way this works it talks about also like sampling distributions the larger the sample the closer one will be to the actual population value in regards to confidence intervals the larger the sample the narrower the confidence interval will be so the larger our our sample of data the more accurate we can be to how how wide that interval is or how narrow the interval is when we don’t have much data that interval has to be really wide because we are not as sure as we would be if we had a lot of data and it makes it makes sense we’ll we’ll look at that too

um let’s see I think I okay I think I mentioned a little bit of this if one is to calculate the plus or minus z value for the calculation one must find the correct z score by dividing the confidence interval level uh desire desired by two the result will be half the probability of the confidence interval for normal distribution when the probability probability values from zero to point one is okay okay we’ll look at this and this is the way this works as we um as we increase our confidence interval the actual interval the um the likelihood that we are wrong so as we increase the beta value part which is our confidence intervals as they get larger the what happens is as they get larger our actual confidence level will decrease and that it’ll be more precise now the issue is if we said oh we want a confidence interval down to um you know 99 confidence interval that we’re going to be right between a certain ratio it’s going to be really wide and in the when I said the 99 um so the the the beta part will be the 99 and then the alpha part will be the the um the essentially 0.5 on each side but that actual level will be really wide and that’s how this works mathematically the relationship for the confidence interval is one minus alpha for example the significance level of 10 alpha equals 0.1 is the opposite of 1 subtract 0.1 which equals 90 confidence interval while this relationship exists between confidence intervals and significance levels they are used differently what is important is that one understands how they are related okay okay to make it even easier an annotated z table is included um with these notes too so many of the common values are available let’s see the annotations link the value to the z table probability under the curve to the context of which they are frequently used and examples listed below I’m going to zoom in but i will show you how this works so what it is is if somebody said okay i want a confidence interval and this is this is all z score confidence interval because with the t distribution it’s much easier but when when we say um we want a 90 confidence interval then you would go and you would say oh well if we just take a look at this blue one right here it says confidence interval ninety percent and then we get a z score of 1.65 and that’s the confidence interval for that and it shows what the actual values and under the curve um go into making that 1.65 and and and what it would be um and then we have the one tail hypo test that’s not we’re not going to have to use this for for this video in the two-tail hypotest okay and the hypothesis is what that means um so there’s one of these for each one and I’ll show you how this works of of course there are only certain ones that I chose to make this for because these are the more common ones that come up I said this is only the z distribution part like i said the t table is much easier okay so this is the z table let’s see it says find the z score for 95 confidence interval calculation well this example shows the procedure for obtaining the z score it is similar to other confidence interval calculations um let’s see 95 divided by two so confidence intervals always have two sides so with hypothesis testing they don’t but with confidence interval it’s an interval it’s plus or minus so we have two sides um with the mean being in the middle so we have 95 divided by two equals .475 so this is how we would do this normally just with a table um like i said most of the time this is going to be easier because you’re going to use that little annotated box i gave you so it says okay 95 divided by 2 equals 0.475 now we look up using the z table the probability value from 0 to 0.5 on the table and we’re actually looking for this one right here 0.475 so it says