 Good evening. So here we are today continuing with CL202. I am trying to make this video lecture and please feel free to give me feedback. Essentially it is based on module 6 that I have already uploaded on Moodle and you probably have access to that. So in my last class I had finished up to, we started with interval estimates and in today's class we will continue with interval estimates. So the broad area is statistical inferencing and in this broad area we were going to look at three topics. One topic was point estimates. So the idea is that you have samples, you have n samples coming from a population and from these n samples you want to be able to find out a parameter of the population which is in fact a parameter of the underlying probability density. So the idea is that you have an underlying probability density which has described the probabilistic distribution of the samples but you don't know what is the parameter of that density. So the question therefore is can you use those n samples to find out what the unknown parameters are? So one is you give me a point estimate of that unknown parameter and the typical unknown parameter that I look at is the mean and the variance. So we are talking about the population mean and the population variance. So one way is to give me a point estimate which is what the maximum likelihood estimation did. It gave me theta hat but remember that theta is a deterministic parameter in my setting and theta hat is a random variable which is an estimate of theta. So that was the point estimate. Then we started looking at interval estimates. So in this case I should be able to give you an estimate of mu and sigma square in terms of an interval. So I should be able to give you a set and be able to tell you that mu lies in that interval and I will describe to that interval a certain confidence level. So we will call them confidence intervals. Finally the next module will be about hypothesis testing which is another way of looking at the same question which you are looking at using interval estimation. So that's the storyline. Now I have started recording. So let me now try to get my desktop in. So now we are going to talk about interval estimation and I have already started this in the last class and we have already solved item number one. That is if my samples x1 to xn belong to a normal distribution and let us say I have this very special circumstance where I don't know the mean of the population mean but I have the population variance available with me. Then can you give me an interval with a certain confidence level about for mu? The second item will be which we will subsequently do will be where both the mean and the variance are unknown the pencil. So these two are going to look at an estimate for mu. In one case the variance the population variance is known in the other case the population variance is unknown. What you will know you will collect a sample and what you will have is a sample mean which we have been calling it as x bar. So this will be available to you but this is not what we are interested in. We are interested in the true population mean which we will try to provide as an interval. The third problem is about finding the estimate for a for variance. So we will try to find out what is an interval for a variance. So this is also a case where both the mean and the variance are unknown. The fourth case we have a situation where you have two different populations. So this could happen so these are known as two population statistics. So it's not just one distribution there are two distributions and for example you have a case where the mean is the mean and the variance of a particular treatment. So let's say you have nowadays in this times of the virus you can say that there is a treatment A and there is a treatment B. So the treatment A gives you belongs you know leads to a certain population with a certain mean mu A and sigma A square and a certain mean and variance mu B and sigma B square and you would like to have an idea about which treatment is better. So those kind of questions you can answer using the last two aspects over here and this of course is when you have a binomial distribution you would like to know an idea about or from let us say doing a poll would like to know a proportion or the probability of success as we called it in the binomial distribution and in all these cases we will talk about it in form of a sample. All right so let me start. So let's start with this or this I've already done I'm going to recap really quickly as to how can you give me an interval for mean mu when sigma square is known. So this is really an unusual situation where you don't know the population mean but for some you know you know the population variance so it is in a more unusual situation but it cannot be discounted completely for example let us say that there is a process and you have made a change in the process where you think that the variance of the new after making the shift is same as the previous variance. So there is no spread in there is no change in the way that your samples spread but there is a change only in the center or the mean of that so for example you have some distribution like this this is let us say old you made some change the same curve is lifted and put somewhere else okay next to it. So the variance of both these distributions could be same but the means are different and so this is that situation where you don't know the mean but you know the variance. Now the setting is as we said all our samples come from a known distribution and we already know that the sample mean is distributed in this particular fashion even if x I do not belong to the normal distribution we can appeal to the central limit theorem and see that the sample mean is roughly normal in under certain circumstances. So the way we proceed is we can standardize that variable by subtracting out the mean and dividing by the standard deviation and we know that this therefore belongs to a normal distribution with mean 0 and variance 1. So let's see how we can proceed one more level of nomenclature for you to recall is that we will keep referring to this as the as the 100 into 1 minus alpha percentile point okay so z alpha or we'll call it as a quantile okay so we will refer to it as a quantile. So when we say that this is z alpha it means that the probability if you go mark that point on that axis then the probability to the right of it it is the right tail probability is equal to alpha and therefore the on the the probability or the area on the left will be 1 minus alpha. So this is a very general notation if you give me any distribution let me try to draw something really funny here and say that this distribution has the 100 into 1 minus alpha percentile point let me call it v is the dummy variable so v alpha means that the probability on this side is equal to alpha and therefore by corollary the probability over here is 1 minus alpha okay then this becomes v alpha or I will call it as a 100 into 1 minus alpha percentile point of that distribution is how we could refer to it all right so let's start by talking about how we could find out that interval again this is a recap I've already done it in the class and in the way that we started was we said that we can start by talking about the random variable x bar we know its distribution by saying that the probability of x bar lying between a lower limit and an upper limit u is equal to 1 minus alpha unfortunately this is not a standard distribution and so we could make it into a standard distribution by subtracting out the mean on both sides and dividing by the standard deviation of x bar which is sigma by root n and since you know sigma you can actually calculate you know you could actually go ahead and process this information so if I can show it on the board just to recap here so I want I think I'll have to blow up the video and not forget to there you go yeah so if you want a 100 into 1 minus alpha percent interval you will put the uncertainty which is alpha on either tails of that interval this is only the two sided interval okay all right and then you can say you can start off by saying so if I have shown on the board the left hand side can be written as that percentile point z of 1 minus alpha by 2 because the probability on the right side of this point of this point is 1 minus alpha by 2 okay however it turns out that because this is symmetric then uh z of 1 minus alpha by 2 is same as uh minus of z alpha by 2 okay so this is same as this number over here and that is just because it is uh symmetric this is not true in every case so so now you can see from the derivation on the board that what you get here is 1 minus alpha for a 9 for 1 minus alpha being 90.95 which corresponds to a 95 percent confidence interval we can we know that this value is nothing but z of 0.025 is 1.96 and so when we substitute that value we can write it as such so this is the probability that this random standardized unit normal or standardized normal variable lies between minus 1.96 plus 1.96 you know that roughly 95 percent of the probability lies between plus minus 2 sigma so you can see that about 95 percent of the probability lies between not plus minus 2 sigma but in some sense plus minus 1.96 sigma that is more accurate and this is just a statement is only a reflection of that so just to remind ourselves what is it that we were trying to get we were trying to find out what is an interval estimate for mu when sigma square is known so while we have stated here quite the obvious we still do not have that so let us move on to the next page and you will see that you could do algebraic manipulations and you would be able to write this statement as follows only the moment you write this statement you realize that mu is a deterministic quantity and you cannot be claiming that this is a probability for mu because mu does not have any probability associated with it so I will not stop calling this as a probability and call it as a 95 percent confidence interval instead so there you have it this is the 95 percent confidence interval that we have so far so I hope that is clear now this is an example where supposing that you had a signal that you were transmitting from location a and it was being received at location b what you were transmitting was mu but at b you were receiving it as mu plus n where n was a normal variable with mean 0 and variance 4 so there you have it you know the variance of this distribution so the mean of mu plus n is therefore mu which is the unknown being transmitted from a and the variance of mu plus n is therefore just 4 now you send that same value of mu 9 times but every time you send it you get a different number on at location b and you can see that you have a number as small as 5 and the same mu has sometimes appeared as 15 the question that you have is to construct a 95 percent confidence interval for mu so in this case you could easily find out the sample mean but sample mean is not what we are interested in we want an estimate for mu the population mean and then we could go ahead and build this estimate if you do it you find that the estimate the sample estimate is 7 points between 7.69 and 10.31 so these are the two confidence limits the lower limit of the 95 percent confidence interval and the upper limit so you should realize that in a confidence in an interval estimate we do not give you a point value instead we would give you a an interval and ascribe a confidence with that interval okay so I hope that is clear so the question is what does a 95 percent confidence interval mean and the way that you can interpret it is that if you were to do 100 experiments and in each experiments you had those nine observations so you would be able to generate 100 different confidence intervals so a 95 percent confidence interval means you would be able to generate 100 of those 95 percent confidence intervals so a 95 percent confidence interval means that 95 of those 100 95 percent confidence intervals would have the true mean embedded in them okay so you can see that these are 1 2 3 4 5 different values and you can see that some of those confidence intervals you did those nine values you collected and you generated a confidence interval but it did not have the mean so remember this is the mean mu but you have a confidence interval which did not have the mu in it okay the true value of mu in it so that is the interpretation of a 95 percent confidence interval that in the long run 95 percent of these intervals will contain the true population mean that you were trying to see all right so this is what a two-sided confidence interval is you can also you will also agree that without knowing sigma you would not have been able to calculate this particular confidence interval so because in order to do that you needed the value of sigma so so this is a sample mean but this is so this is a sample mean but this is the value that you would need now in addition to having a two-sided confidence interval very often a one-sided confidence interval is also used so in this case we think of of the uncertainty alpha we put completely on one side of that distribution so when you talk about an upper one-sided confidence interval we decide to put that entire uncertainty on the right side okay and when you talk about a lower one-sided confidence interval we decide to put the entire uncertainty on the left side so again you can draw a graph of a distribution put alpha and write down the probability and very easily obtain this maybe I can show that to you on the board so let me blow this up so I will draw a distribution and I will put all the uncertainty on the right side okay now you can start off by saying that that the probability of x bar is less than a I use standardized the variable by suppressing the mean and dividing by the standard deviation and that probability should be one minus alpha so I put here as one minus alpha so from here this is the probability but what you can try to obtain is the confidence interval and so you will be able to show that that mu belongs to this particular interval okay so that will be 100 into 1 minus alpha percent upper confidence interval so notice that in an upper confidence interval you have the lower bound okay this is the lower bound that means the mu exists somewhere in this in this interval so it is definitely greater than the lower bound and in the lower one-sided confidence interval you have an upper bound for the mean okay so if you are wondering in what circumstances you would use such let me check if I have minimized my so if you are wondering under what circumstances do you use such a lower bound and upper bound then think about a manufacturer let's say of a mobile phone who wants to be able to claim that the mean life of the mobile phone instrument is greater than five years okay so he will he or she will try to show that the mean the population mean therefore belongs to this upper one-sided confidence interval saying it is anyway greater than five years if there is an regulating agency that is trying to check the truth of in the advertisement will again buy let us say 10 or 15 mobile phones of that particular manufacturer and then try to calculate the lower one-sided confidence interval to show that that the mean is at most this value so note that this becomes therefore an upper bound okay so it is really a two-player game if you were manufacturing some food item in which there was some toxic element then you would show that the toxic element is below a particular limit so then you would try to prove you would try to show this bound like there was an FDA that wanted to check whether what you say is true would take samples and try to therefore use the upper confidence interval so depending on the situation you have to be able to decide whether it makes sense to use an upper confidence interval or a lower confidence interval or a two-sided confidence interval so again we go back to our problem of where mu was transmitted from from a from location a to location b and you want to now you already found out the two-sided confidence interval it was this but you would like to find out the upper 95 percent confidence interval so it is 7.903 to infinity okay so here you can claim that the mean value of mu which was being transmitted from location a is with 95 percent confidence you can say that it is greater than 7.903 okay and with a 95 percent confidence uh confidence you can claim that that mu value is less than 10.097 okay and the two-sided confidence interval is what we already looked calculated so you know how to calculate these upper and lower confidence intervals using these formulas that we just discussed all right now another interesting issue that develops is when you would like to give a range to your 95 percent confidence interval let us say you did a mobile phone 95 percent confidence interval and you got that it lies anywhere between the two-sided confidence interval and you got it could be anywhere the mean life could be between two years and 10 years so such a confidence interval does not inspire too much confidence because you say oh you know it would break after two years or it could survive up to 10 years and you're not very sure and so you would like to give a confidence which is more meaningful okay so in order to do that so the question is that if you think about your confidence interval then the range or the size of that confidence interval is is uh two times x bar minus mu okay so it is the upper confidence limit minus the lower confidence limit turns out to be this but you don't want it to be going from two years to 10 years you want it you're okay if you say it goes from four and a half half years to five and a half years so how can you accomplish this one way of accomplishing this is by finding out how many what should be the size of the sample if you want it to be ever desired range of that confidence okay so you could just do simple algebraic manipulations and show that if your range given range to you is two times x bar minus mu then n should be should be this okay so this tells you that for a given range that is x bar minus mu or captured by x bar minus mu and known variance sigma and if you choose your alpha to be 0.05 in case of a 95 percent confidence interval how many samples should you have so that you get this range okay so it has to it has been shown very nicely over here this is the lower limit over here this is the upper limit okay and you want some some uh you want some kind of a control on how wide this is and using this particular formula you could find out how many samples you should have so if you want this to be narrower you need to be able to have more samples and this you can see it and is inversely related to square of x bar minus mu okay so smaller x bar minus mu you know n will increase in that proportion again if you so you will need more samples if the normal spread as of that population sigma is large so if you want x bar minus mu is fixed and but sigma is large then you will have to pay a penalty by choosing more number of samples in the same way if you want uh instead of a 95 percent confidence you want 99 percent confidence then also you your number of samples will have to go up in order to provide you with the same range okay that is quite clear from here that as z of alpha by 2 increases as alpha decreases so when you have 95 percent then what is the value of alpha it is 0.05 and if you choose 99 percent then what is the value of alpha it is 0.01 so as alpha decreases that means the confidence in the the 100 into 1 minus alpha percent confidence interval uh you have a higher confidence interval then the number of samples will have to increase in order to give you the same uh range or span of that confidence two sided confidence interval okay and so you can use this figure to be able to make that uh assessment that as 1 minus alpha goes up alpha comes down and so your z of alpha by 2 is getting pushed more and more to the right over here okay so let's come to the more usual case where you neither know mu nor do you know what is the variance sigma square so in this case like we did before you can no longer use this and why is that because you don't know what is sigma so an obvious intuitive choice is to replace sigma with s okay so when you use sigma your you could we could show that this was the underlying distribution when x i were normal x i belong to the normal distribution the samples okay but if you replace sigma with if the sample variance uh or sample standard deviation it turns out that this is no longer normal in fact we can show that this belongs to a t distribution or a student's t distribution which is um which is uh you know can be written as a ratio of a normal variable and the mean average of a chi square variable so we have z which is the unit normal divided by a chi square variable uh with n minus 1 degrees of freedom in this case because it is t n minus 1 and it is divided with its own degrees of freedom so that is your p variable okay it's known as a student's t distribution just like chi square is a distribution we had seen the form of the distribution we plotted it in r in the same way this is a standard distribution you can write it right down the equation and you can plot it so here are some more details so as i discussed with you that it is a ratio of the unit normal and a chi square mean chi square distribution why i call it a mean is because i divided by the degrees of freedom n inside that square root and so this is known as a t distribution with n degrees of freedom now this distribution looks very similar to let me check with i minimized my own video yes you can see the desktop so in this case you have it looks very similar to a normal distribution except that it has heavier tails okay and now t distribution is it depends on the degrees of freedom so this is t2 is one density t3 is another density so as the number of variables change we keep getting a new curve for that particular density so shown to you are a few of those curves when n was two when and for us the degrees of freedom really relate to the observations the number of observations you can see that when you had only two then you had this distribution which was compared to the unit normal which is the red curve is more heavy tailed so you can see this is n is equal to two and this is the normal distribution so as you increase you go from two to number of observations becoming five you will see that this has gone closer to the unit normal okay so as the number of samples or the degrees of freedom keep on increasing you keep approaching the unit normal in fact you get the unit normal distribution as n tends to infinity in fact when n is about equal to 30 you can hardly distinguish in the first few decimals between the normal distribution and the t distribution okay so the difference that you find is that a normal distribution is is a narrower whereas a t distribution has a heavier tail and you should be able to rationalize that in a t distribution the only difference was that you replace the true population variance or standard deviation with a sample population standard deviation so whenever you go from here to here you have more uncertainty associated with it and where does that uncertainty reflect it reflects in the heavier tails of this so if your sample you have calculated based on larger and larger number of samples it becomes more and more like a unit normal okay so an aside that the students t distribution was actually proposed by Gossett and but he never used his own name in his publication and he used a pen name which was student so people thought there was some one student whose name was mr student or dr student mr student most likely who had proposed this distribution it is thought that you know it was he's it was his idea of lifelong learning that he chose that pen name other reason why people say that he used this distribute this pen name is to hide his own identity he worked at a brewery and he didn't want they didn't want their competitors to know that they were probably using some kind of statistical test to make sure that their quality is is is maintained consistently so something some more information about a t distribution like the unit normal the mean of a t distribution is zero and for n greater than two you can see that the variance one can easily calculate using the standard definition of variance as n over n minus two so you can see from here also that as n becomes larger and larger this quantity tends towards one which is the variance of that unit normal towards which towards which the density tends to like we discussed before we have a quantile point that we will refer to now here the quantile point is t of alpha comma n and that says that the probability on the right side of t of alpha comma n is equal to alpha so if i go back over here and on this blue curve i make then this value over here is going to be t of alpha which is this comma two because this is based on degrees of freedom two so this tells me that the curve between this and if i were to trace out the blue line this area is alpha and the area in the remaining part is one minus alpha okay so that will be t of alpha by two how do you get it you can get it from a table okay or you can get it from a code i have set a software such as r like in case of the unit standard normal you find that t of one minus alpha is equal to minus t of alpha minus by alpha because of symmetry so again if i go here then i know that by the definition this value should be t of one minus alpha but this value of t of one minus alpha is equal to minus of t alpha and that is because this metric around zero all right so the next question is okay now that we have defined what is the underlying density of the standardized variable which is this in the case where i don't know what is the variance of the population how do i find that confidence interval and you do the same exercise again so you start off by saying that the probability of x bar lying between a lower limit and an upper limit is one minus alpha okay and the next step for you to try is you center it by subtracting out the mean and you divide it by the sample variance which is s by root n and if you do that you can then find out what is the you know and so you will be able to write it in this particular fashion as i said again that you do algebraic manipulations so that you have only mu in the middle and then you stop calling this a probability and instead you call it a 100 into 1 minus alpha percent confidence interval so that's the two sided 100 into 1 minus alpha percent confidence interval when both mu and sigma square are unknown so you'll see that the only difference is that in that in the previous case when sigma square was known we had used the unit normal distribution okay and in this case we are using a t distribution because that is the distribution to which the standardized variable belongs to once you divide it using the sample standard deviation okay so similarly you can define an upper one sided interval and a lower one sided interval i hope you will you can see the the connection with the case with the previous case when sigma square was known now one thing you might want to take note is that we have used the capital x bar and the capital s over here and here we have used the lower case x bar and lower this s so in case where we want to refer to this as a random variable we use the upper case and when we are substituting the realization of that variable so this is a numerical value we have used the lower case let's go back to our original problem of finding out the value of a term or a value of mu which however was obtained on location b not as mu but is corrupted with a noise being mu plus n and in this case you neither know the mean you neither know the value of mu nor do you know the variance of this particular variable so what is the mean of this variable is mu what is its variance is sigma square and both of them are unknown so all you have are these nine realizations which are the same values the minimum value being 5 the maximum being 15 and you are told to give our 95 percent confidence interval for that population mean mu so like we discussed you calculate the sample mean you calculate the sample standard deviation and then we use our 95 percent confidence interval what you will need is this okay and where will you get this from you can get this from a table or you can get it from r for example I think I have something open here so the name of the distribution is t when I use it in r and so I want the quantile information so I say qt the probability I want on my right side is what was the probability it was 0.025 on the right side so this typically gives you the probability distribution which is the left side probability if you recall the definition of a distribution the degrees of freedom are n minus 1 so I will put an 8 here and but since I want a right side I can say tail dot lower is equal to force I am assuming it is I have used this correctly qt I made some error somewhere so p is 0.025 8 I want to say lower tail is equal to false and is 2.3 okay so you can see this 2.306 so it's this t distribution with a heavy tail and if you say that the probability on the right side is 0.025 it has told me that this number over here is 2.306 I don't have to calculate this because I know by symmetry this is minus 2.306 and so I use from that simple evaluation interestingly now the interval has become 6.63 into 11.37 so it has increased so so when we had used a z distribution where we said that the variance is known our interval was much smaller in in its range it was from 7.46 to 10.54 whereas in the present case it has increased so there's more uncertainty so now you can agree or you can realize that since when we were using a z distribution we had a narrower density and when we are using a t distribution we have a wider density so this value the t of 0.025 is much larger than the z of 0.025 over here okay and this is why so so this was 1.96 so z of 0.025 was z was 1.96 whereas t with eight degrees of freedom turned out to be 2.306 and that is why you get a much larger range of that two-sided confidence interval okay so now let's move on and go to the next case which is finding out the confidence interval for the variance so while the confidence intervals of mean are very commonly used there are cases where you would like to know the confidence interval of a variance for example let us say you have a you have a process so let me think of let us say you are making a product which has and the customer gives you a target it tells I will buy the product only if the target is this okay now since you know that there is a lot of variability in your process and there is a large variability so you try to make much superior than the customer's target so that even with poorly formed products you can still meet the customer's specification so an example we have done is that if you don't meet the specification the customer will not pay you but in order to make sure that you get paid by the customer you have ended up trying to make far superior product okay so let us say you and that is because your variance is large so let us say you make a change in your process and you say that with this change process I can give you a product I can give you a process with far lower variability so let's say I can make it like this if I do this then I have to make you know because remember that when you're making a far superior product the customer is paying you only for the quality that he's or her target is specifying so if you can make a product which is very tightly or the variance of your process is very tightly aligned with the target value given to you by the customer then you need not waste so much of your money so your margin of profit will increase so this is a case where you would like to test for variance you want to make sure or you want to find out what is the confidence interval for the variance okay so when I say test for the variance I really meant estimate the variance in form of an interval let us say 95 percent confidence interval for my variance so it's the same old trick we have samples which are coming from a normal distribution like for x bar you knew what was the underlying distribution so now for the sample variance I will need to find out what is the underlying distribution we had seen this before and we had seen that you could write this as a chi-square distribution with n minus 1 degrees of freedom okay so the moment that the distribution becomes known I can now start finding out the confidence intervals in this case the chi-square distribution and we have plotted the chi-square distribution in R and we had seen that as you have higher degrees of freedom which for me really means higher the number of observations it becomes less and less skewed so this is a highly skewed distribution over here and as your number of degrees of freedom increase it becomes less in the skewed we had also seen that this was related to the gamma function in fact we have written down the entire density for chi-square now unlike the z distribution the t distribution which was symmetric because of the presence of the skew in a chi-square this is no longer symmetric so when you will try to find out the confidence a two-sided confidence interval you should take care that if you're finding out let us say 90 percent confidence interval so you are saying that I'm going to put five percent of the uncertainty in the right tail a five percent uncertainty in the left tail and you will no longer have that same property that you enjoyed in the previous two cases where they were symmetric so now a chi-square 0.05 will mean that this is 18.31 so remember that a chi-square distribution only starts from zero so you don't have a negative value so there's no question of being symmetric around the origin and a chi-square 0.95 is not equal to so there's no notion of a minus chi-square okay or minus 18.31 because it starts only from zero okay so you have to be able to find out both these percentile or quantile points okay so you do the same trick that we have been doing okay maybe I will just do it on the board so I blow this up so I can use this so I will draw I will draw the chi-square I will put alpha by 2 on one side alpha by 2 on the other side and then I should be able to write down the probability statement from where I can obtain the the confidence interval for a square okay and now you can you can you know convert it to a standardized variable and after converting it to a standardized variable before I forget I should minimize this otherwise you will not see any of the screen so now you should be able to see my desktop so so then by standardizing it you will be able to write the probability statement for the standardized case and then you will convert it using algebraic manipulation and note that sigma square is no longer a random variable so I will not write it as a probability but instant call it a confidence interval so the two-sided 101 minus alpha percent confidence interval is given by this as we discussed before you have a lower and an upper confidence intervals as well so I will urge you to think about situations where you would use a lower confidence interval and upper confidence intervals and also situations where you would want a two-sided confidence intervals okay so when we solve problems hopefully some of these will become clear so let's take an example where the company that produces washers and these washers have a thickness and the thickness is found to be to be the following in inches as they have given over here so it's if the process is very tight is very good then you will keep getting consistent performance and if the customer has said that I want washers of let's say 0.12 inches and your process is very tight then you will not have to spend so much material because when you're making a washer with 0.133 thickness you're giving more material that product costs you more but the customer pays you only for 0.12 so you would like a tight variance on it that is why you want to have a confidence interval on the population variance okay so again we calculate s square and we can find out what is the sky square point okay again you have a table I will urge you to go to the table because an exam assuming you're going to give an exam okay you will have to use a table okay but in this case I can for example calculate what is chi square 0.05 with 9 degrees of freedom and 0.95 in R so let me just do one of them chi square and what I need is q chi square with the 0.05 or my degrees of freedom were 9 and I will make lower dot tail as equal to false and you can see that this is the quantile point and that is 16.917 as we as you know 918 or 919 in my case and which is 0.917 is written over here so this is probably you know so you I will urge you to solve this using a table maybe in my next lecture I will show you the table because the table does not have so many points where you can interpolate it very finely so in the while solving problems you should know how to interpolate when you're using a table in any case this is a confidence interval so it tells you that the standard deviation lies between 2.7 if I can call it a milli inch and 6.1 milli inches okay which is pretty tight but then you can make a change in your process and see whether I have been able to make more consistent delivery of washers in the changed process okay so some tricks that you have to remember when we looked at a sample we knew that we could relate it we could standardize it like this when we looked at the sample mean we could standardize it like this and when we look at a sample variance we standardize it like this so that you could relate it to known distributions okay so if xi belongs to the normal distribution then this is the unit normal this also is can be connected to the unit normal and this is connected to the chi square distribution with n minus 1 degrees of freedom okay so as I discussed in the beginning that so far we have looked at at one population so they were washers they were belonging to one population when we talked about you know transmitting that mu to the location b it was a single population but very often confidence intervals and statistical inferencing is desirable when you have two different populations and often the question is whether the mean of one population is higher or lower than the mean of the other population so this is the next problem that we will look at so here you have two populations one is x1 x2 to xn so you have n samples here coming from popular from this population which belongs to mu 1 sigma 1 square and the y's are the samples which are m number of samples different number of samples coming from a separate normally distributed population which is have mean mu 2 and sigma 2 square so one common question is is mu 1 greater than mu 2 or smaller than mu 2 but you don't know what are the values of mu 1 and mu 2 what you have is only x1 to xn and the m samples from y1 to yn okay and from this you have to be able to make a comment on which population mean is larger or smaller so as I was saying that in these days of the virus let us say that there is somebody who comes with vaccine a and you have x which tell you the days required to recover if a vaccine a is used and you have vaccine b and the samples that you collect correspond to patients who have a administered a vaccine b okay now you want to know if it is time days required to recover from that virus after administration of a particular vaccine you would like to know whether mu a is bigger than mu b or mu a is smaller than mu so the faster you recover you will want to recommend that particular vaccine so you are interested in solving this particular question which one whose population mean is smaller and the one that is smaller will be a preferred treatment so like the previous case we will consider two cases here in one case we will magically assume that sigma 1 and sigma 2 are known that is the population variances are known and in the other case we will assume that they are not known so you put very quickly calculate the sample means coming from population x and the public and the sample mean coming from the other population as x bar and y bar okay now these are also the maximum likelihood estimators or point estimators for mu 1 and mu 2 the question is I would if you have seen we always want like to know what is the underlying distribution so that we can build confidence intervals so if xi and the yi's were normal as claimed over here coming from these two populations then from what we know is that you could find out assuming that xi and yi's are independent you can show that the normal that x bar minus y bar will have also a normal population with the population mean mean mu 1 minus mu 2 the subtraction of the means okay and however their variances will add up because when you and so you can do this on your own with concepts that we have learned so far that if I give you two samples xi's and yi's and you have to add up or you have to subtract in this case then the means will get subtracted but the uncertainties will not get subtracted so subtracting out does not mean in fact the uncertainty will increase because you have the uncertainty in x and you have the uncertainty in y and because they are independent they will just add up in this particular fashion okay so that is the underlying distribution of x bar minus y bar okay so sigma square 1 square by n was the variance of x bar sigma 2 square by m is the variance of y bar so the variance of x bar minus y bar is this and you can verify that even the variance of x bar plus y bar would have been the same okay so we have done this now enough number of times so you know how we will proceed we will we know the underlying distribution so we will subtract out the mean which is mu 1 minus mu 2 and we will divide by the standard deviation then we know that the underlying the standardized variable will belong to the unit normal will be distributed as the unit normal so that is what has been done over here the moment you do that you can write down the probabilities for that standardized variable and as we have done before it turns out to be this and the probability that the standardized variable lies between minus z alpha by 2 in z alpha by 2 is 1 minus alpha so the most important step is this to know what is the probability of the standardized variable okay or what is the distribution the probability distribution of the standardized variable the moment you do this you now do algebraic manipulations like before and get mu 1 minus mu 2 in the middle so you know this is no longer the probability but instead we will call it the confidence interval so again magically you know what is sigma 1 and sigma 2 in that case this gives you the confidence interval which I hope is summarized in my next slide so that is over here so mu 1 minus mu 2 belong to this confidence interval and this is the 100 into 1 minus alpha percent two sided confidence interval okay so if you give me this confidence interval and let us say that the two numbers are minus 5 comma minus 1 so which population mean is smaller than which is a question which you should think and try to answer if it was between minus 5 and plus 5 then what can you say if let us say it was between 1 and 5 then what you can say okay so you should be able to make those interpretations with what we have discussed so far okay so let's quickly look at the example you have two different types of electrical cables cable installations and these have been tested at voltage levels at which failure occurs okay so you have a cable you keep on freezing the voltage and at some point the insulator no longer acts like the insulator so there are two different types of cables there's a type A and this is a type B so I could think of buying these cables from two different companies company A and company B and I do a testing independently in my lab and these are the sample numbers that I have okay now clearly in this case the number of samples are also different so I have bought many more of these than I have bought of type B in this case of course I need to know the variance hence the variance you know somehow I know is 14 for type A and it is 100 for type B so I know that the underlying distribution A of A is much sharper so I but I do not know what the mean is okay so I want to be able to find the 95 person confidence interval for mu A minus mu B so we've already looked at this previously so I can find out x bar I can find out y bar I know what a sigma 1 square is 40 sigma 2 square is 100 and I can calculate the number count the number of samples and I plug it in to be able to give me that interval so you have 14 samples of A and 12 samples of B okay and you get a value of minus 19.6 and minus 6.5 so if you have been able to understand everything that we have discussed in this class you should be able to interpret this I think interpretation is more important than just knowing the tools of how to achieve or arrive at this at this interval so clearly I should be able to say that the that mu 2 has is smaller is larger than mu 1 and so the voltage that cables from company B can withstand is much higher than the voltage that cables from company A can withstand so which cable will you buy okay think about it so you'll buy the better cable which can withstand a higher voltage so you will end up buying cables from company B okay let's go to the next case and this is the case where sigma 1 square and sigma 2 square are unknown so as you would imagine in this particular case we would use our intuition and try to replace sigma 1 square with s1 square the sample variance and sigma 2 square with s2 square sample variance unfortunately when you do this this is a very complicated distribution is not like a t distribution or or any other distributions that we have seen and so in this particular case you know we will not proceed further because this distribution is far too complicated so we will make another assumption in the case when sigma 1 square and sigma 2 square are unknown and we will say that sigma 1 square equals sigma 2 square okay so we'll say that the variance in population A equals to the variance in population B in which case I can you know it becomes a simpler problem so I will encourage you to find out what is the term I forget now but data which have different means but same variances have a special term it's called heteroscedastic distribution or heteroscedastic populations which means they have the same variance so for such variances you have you can think of them as a common variance in such a case I can look at the two distributions of s1 square and s2 square and just because they have different number of data points they I can find they belong to different distributions because the degrees of freedom are different but we know that both of them belong to chi square okay so we take information of distribution A distribution 2 which we have in form of this statistic for the two distributions and we pull them up so we say that the net distribution is you can add them up and in you know in the beginning we had seen that if you add up to chi square variables then it is also a chi square variable two independent chi square variables is also a chi square variable where the degrees of freedom and add up so this is a chi square with n minus 1 this is a chi square with m minus 1 so together they become a chi square with n plus m minus 2 okay so in this case I will think of this pooled variance belonging to this chi square distribution and I will call it as sp the pooled sample variance okay so essentially what I've done is I have I assuming that I know that the two variances are equal I have added up information from the two variances together in order to come up with a pooled sample variance okay so in this case it turns out that x bar minus y bar is is a is also a normal distribution like we discussed before with the variances being added up but in this but when we do not know what is the underlying distribution we use the information of the pooled variance and this particular variable we can show or this particular standardized variable we can show belongs to a chi square distribution or I'm sorry a t distribution with n plus m minus two degrees of freedom so again why does it belong to a t distribution and you should be able to show that this over here is a z variable okay and this has been divided by a chi square variable and when you do that you get a t distribution and the degrees of freedom depend on the degrees of freedom of the chi square variable which was n plus m minus two so we do the same exercise again we know that x bar minus y bar standardized using the pooled variance in this particular way has a t distribution with degrees of freedom n plus m minus two so we use our old trick again and we write it in this particular way which then allows us to give you know us to write down the confidence interval for mu one minus mu two so if I now rewrite this algebraically I will be able to write that this mu one minus mu two belong to this confidence interval okay so note that we are using a pooled variance a pooled and why are we calling it a pooled variance we're calling it because we are pooling data from from distribution a and distribution b in order to calculate that common variance sigma square that's why we call it a pooled variance okay so let's take an example where you estimate the difference in mean of two normal populations with unknown but same variance it's the same example of testing the cables installation cables but here we will make an underlying assumption that the sigma square in the previous example we are taking it as 40 and 100 but here we'll take that the sigma square is constant okay but unknown so the first step you will do is find out the pooled variance which turns out to be 79 so you can see it is a weighted average the average of the variance of the sample variance of cables in population a and variance of cables in population b and it is weighted with the number of samples that you had okay so again you know now how to use this you can calculate this particular distribution and you will find that this distribution has degrees of freedom 24 because of n plus m minus 2 so it is 12 plus 14 minus 2 so it is 24 and that number turns out to be minus 20.26 and minus 5.83 okay so in so in interest of time let me stop here and I will take off from the last item which is calculating a confidence interval for a population variance this I will do in my next class so let me please stop here and please do not forget to write back in terms of what was your experience if you want to give me any ideas on how I could change my presentation please do write back okay thank you stay safe and until the next time