These are draft notes extracted from subtitles. Feel free to improve them. Contributions are most welcome. Thank you!
Please check the wiki guide for some tips on wiki editing.
In this short unit, I want to address the magic number that came up in the last unit.Do you remember which one the magic number was?
And of course, it wasn't Ď or e--it was 1.96.
So we defined the confidence interval to be mean±1.96 of the observed standard deviation over the data said size.So the question is where did the 1.96 come from? Remember the Central Limit Theorem?Remember what it said? For large sample sizes N, the mean outcome of the sum of Nindependently drawn excised becomes more and more normal.Now it turns out the Central Limit Theorem is directly related to the value of 1.96and it isn't entirely obvious so I didn't make it a quiz.
With the Central Limit Theorem, things become really easy.Take a coin flip. There is a true probability p for the coin.Now we know that we sampled the coin N times and compute from itour empirical mean using the formula you well know.That it's well true that it could easily happen that p doesn't end from µand that's because flipping the coin number of times is a stress and estimate of a true probability p.Now whole likely our estimates, so suppose this is a true p and I gave you three possible µ.This one, this one, and one out here, and I put a little check marks underneath.Check the box that is the most likely µ you might observed,if p is a true probability using our statistical estimator.And of course, it's near this one.If it the most likely one will repeat itself and the further out you are,the less likely is to have a sample that it gets you this far out.And now, we'll be using the Central Limit Theorem.For large N, say N large N=30, we know that the distribution of µ you might observe is Gaussian.For any value here, let's call this one a. The chances that we observed in µ that's smaller than ais the same as the surface area and then the Gaussian over here.There's a trick you haven't seen but the probability is driving any µis at least in the limit given by the height of this Gaussian.So for any value a, we can compute a probability that µ becomes smaller than a.And by symmetry, for any value of b, it's is equally away from p as a as on the left side of p,they can do exactly the same thing.Now, where does the 1.96 come from? and here's the trick, 1.96 marks the 95% confidence interval.So we plug in the observed μ instead of the p which we don't knowunder the Central Limit Theorem, we get the same Gaussianand then we compute the x which μ-x or μ+x give us these decision boundariessuch as the total area in these two tails over here is exactly 0.05. That's the same as 5%.In fact, you placed half of this on the left side and half of it on the right side.When that's the case, the confidence interval itself carries 95% of all possible values for p,so the chances that p lies outside the green confidence interval is 5%,hence, we call it a 95% confidence interval.Let me ask you a quiz. Suppose you go from 95% to 90%,does this make x smaller, larger, or will there be no change. Which one is it?
I would argue it makes it smaller and here is why.Now, you can afford placing 5% on each side or 0.05 and that shrinks the size ofthe confidence interval, hence, the smaller x.
What if we go to 99%? Let's provide the answer now.
And it was right, it's larger.If you only allow it half of this end on each side, the confidence interval becomes noticeably larger.
A typical confidence is from 90% to 99%, you can find these values in tables.They are called quantiles. There might be numbers like 2.58, 1.64, 1.96.In this quiz, I just want you to tell me which of these numbers corresponds to what confidence intervalsand I'll give you that to correct each of those match exactly one of those over here.So check exactly three boxes.
And here we go, we already know 95% is 1.96.We know as you want to increase our confidence,we have to go outbound which means a larger value.So it's 2.58 as the only choice for larger value,then it's 1.64 the final choice for the 90% confidence interval.
Let me ask you a trick question. This is always correct.Say you have a sample, you run a statistic, you plug in one of these factors,will you always get the correct answer when finishing them up?If you listened very carefully I already told you--yes or no.
And the answer is no.There's many reasons but the reason I've given you as I said before we need a large sample of this study.
So here's it a T-Table. That apply to statistics estimates for fewer than 30 samples. And the way to read this is on the left you see the degrees of freedom, which is the number of samples minus one. So if you have 10 samples, that would be 9. For 15 samples it would be 14. At the top you see one minus the confidence levels, so if you want 95% confidence, you go to 0.05. If you want 98% confidence, you go to 0.02. Now there's a slightly distinction in here. There is one tail and 2 tails. So far we talked about 2 tails were we always cut left and right of our confidence interval. There are occasions, we will talk about that later, we wish to cut off just one side and these often occur in the context of testing hypothesis. But for the time being, let's just talk about the 2 tails numbers over here [points to the second line from the top] in this table. Ok? So, let's just make sure that now you know how to read this table. Suppose you havesamples and you want 90% confidence, what number would you find on this table to be the magic number?
And the answer is 90% translates to 0.1, so it's going to be over here in this column.N=8 translates to 7--I told you data point minus 1.So this will be the correct number over here, 1.895.
Let's ask you another question, suppose you care about 95% probability confidenceand you want a factor that is no larger than 2.145.How many data points do you have to collect at a minimumto reach a factor that isn't larger than 2.145? You can read this off the table.
And again the answer is simple 95 means you're going to look into this column over here.2.145 happens to be the value over here, which translates to 14.Now, we do know that the number of data points is the number degrees of freedom plus 1.So 15 is the correct answer, not 14.
Let's now apply what we just learned in the context of computing an actual confidence interval.Suppose I care about 90% confidence and from my coin flips,I get a data sequence of 5 elements 11000 and let's for now assume you're going to use the T table.This might not be the world's most accurate method but for now we do this.Now we've computed the variance many times. I'm just going to give it to you.This 0.24 and if I knew this five takes the square root of the variance over n is about 0.219.You compute this so many times, these are just the numbers, but I want you to give meis the confidence intervals, which is the mean plus or minus the term on the right.
Obviously you can do this by using our table over here.Remember to use the two the tail not the one tail and by multiplying in the appropriate magic number.The mean is easy. It's 0.4 and this thing over here, we'll find the appropriate element in the table.For any puts five, we're going to look at the row four and for 90% we look at the 0.92 tails,this one over here and they intersect at 2.132 and if we multiply this to 0.219,we get 0.467 approximately--would have been the correct answer.