 Hello and welcome back in today's lectures we will be looking at hypothesis testing. So we will be defining different types of hypothesis and how to handle different problem statements post the questions raised in the problem statements in form of suitable hypothesis and then define a test statistic use the appropriate statistical distribution find the probability and based on the probability we make certain conclusions. So the references for this topic are the books written by Ramachandran and so course mathematical statistics with the applications from academic press and the prescribed textbook by Montgomery and Runger applied statistics and probability for engineers fifth edition from Wiley India. So where do we apply this hypothesis testing procedures it is an important tool in decision making the person making a decision may be the manager it may be the owner of a company or it may be even a researcher what decision does a researcher make he performs experiments finds the response as a function of the variables he changed during the course of experimentation and the decision he makes are which of the variables are important and which of them do not have a bearing on the response of the process. So there can be different types of decision makers. So statistical inference involves hypothesis testing I really have not told you what is meant by a hypothesis I will do so shortly and parameter estimation a random sample is taken from the population and suitable statistics are obtained again we are going to use the random sample since the random sample is being used in so many places in so many different ways it is important that we ensure that the sample we have taken is indeed random and the sample elements are independent of one another and follow the same probability distribution again we have to emphasize that we do not know the parameters of the population we do not even know the nature of the population whether it is having a normal distribution or it is having a skewed distribution the random sample is used to make decisions on the sample distributions of the means the sample distribution of the variances and so on we have seen that the normal distribution the t distribution may be used in the tests carried out on the mean the enquiries made on the population parameter mu we use the chi squared and the f distributions to make enquiries regarding the variances of the population and also the ratio of variances. So the sample statistics in the form of sample mean and sample variance have a lot of significance another important thing is even though we are using the sample information we are always querying about the population parameters. So the sample information is used to make decisions on the parameters of an unknown population we do not know the mu and sigma squared and so we use the sample information as point estimates of the population parameters and then we make certain decisions how we make the decisions we will see shortly. Obviously this impractical to use the entire population for decision making. So we are forced to resort to sampling and use a sample information to arrive at a decision usually only one sample is taken from a given population. So I was just introducing the term hypothesis testing what is really meant by a hypothesis. If you look at the dictionary some of the synonyms of hypothesis are guess assumption speculation suggestion and initial conjecture. Basically a hypothesis expresses a statement it concerns with the probability distribution of a random variable and its associated parameters. So the hypothesis deals with the population parameters either mu or sigma squared. Again I am emphasizing when you are writing down a hypothesis or a statement you are involving the population mean or the population variance you are not using the sample mean and sample variance when writing down the hypothesis. Roughly you can see that hypothesis will involve mu or sigma squared it will not involve x bar and s squared in the hypothesis statement. Even though further analysis will be done with the sample mean and the sample variance the x bar and s squared do not find a mention in the hypothesis statements. So I said hypothesis statement and then I am saying hypothesis statements the reason for that is there are two hypothesis statements okay and neither of them involve x bar or s squared both of them involve either mu or sigma squared right. So doubt that may be in everybody's mind is we know alright hypothesis is a statement or a guess or a speculation but it does not mean that all the people would make the same kind of hypothesis statements. Well the hypothesis statement is usually binary guilty or not guilty. It is having a population mean value of 50 units say 50% marks or it is either greater than 50% or less than 50%. So the hypothesis statements are rather simple. So you can go ahead and make a hypothesis statement without bothering too much and if the sample data does not support your initial speculation or initial hypothesis then the hypothesis statement stands to be refuted or rejected. Then you can always go back and look at the problem history and problem data and come up with a new hypothesis. The preliminary hypothesis test you carried out will give you valuable clue as to what should have been the proper hypothesis statement. So the hypothesis testing involves procedures which help us to decide whether the original hypothesis made may be accepted or rejected based on the information provided by the sample. So you are using the information given or available in the sample to make decision whether the original hypothesis statement is correct or not correct. So we look at the difference between our assumptions and the evidence from the sample and then to decide whether the differences are statistically significant to warrant the rejection of the original hypothesis. For example you may be thinking that the nuclear reactor supplied by a company is going to give you a mean power output of 2.3 gigawatts. But the plant is actually giving a mean power output of only 2 gigawatts okay. So you are having 2.3 gigawatts as the population parameter mu whereas X bar is telling you it is only 2 gigawatts. So the difference is – 0.3 gigawatts. And whether this difference is statistically significant enough to conclusively say whether the mean output from the reactor is 2.3 gigawatts is an incorrect statement or it is a correct statement. So coming again we look at the difference between the X bar and mu. X bar is 2 gigawatts and mu is 2.3 gigawatts. So the difference is – 0.3 gigawatts. So we can see whether this difference of – 0.3 gigawatts is statistically significant enough through hypothesis testing procedures. If it is statistically significant enough then we can say that okay look this reactor which the company has supplied cannot give a mean power output of 2.3 gigawatts as originally claimed. However, if the test shows it is statistically insignificant then what we say is based on the data which is available to me I cannot really conclude that the reactor supplied by this company XYZ company is not supplying average power output of 2.3 gigawatts as claimed okay. There is insufficient evidence for me to actually reject the company's claim that the mean power output is 2.3 gigawatts. Again I will like to emphasize that hypothesis testing concerns with the parameters of the probability distribution of the population and not with the sample. However, it relies on the data from the sample from the population of interest. Always please remember that the hypothesis testing is all is subject to some uncertainty. Unless we examine the entire population we cannot conclude anything about the population with 100% accuracy or certainty. Since we are using samples to make inference upon the probability distribution of the population we cannot be certain about our conclusions regarding the population parameters made using hypothesis testing. There is a small typo here I will correct it okay. Since we are using samples to make inference upon the probability distribution of the population we cannot be certain about our conclusions regarding the population parameters made during hypothesis testing. We are speculating on the parameters of the population. Can the mean value be this much? Can the variance be this much? And these are the population parameter values. So after we take the information or evidence provided by the sample we do some test procedures and then we make a conclusion. Based on the evidence provided by the sample I cannot conclude that this population parameter mean can be 50 units or I can say that right based on the evidence provided by the sample I can conclude or accept the original problem statement that the mean is indeed 50. So you are making a decision based on the evidence provided by the sample but this decision cannot be considered to be conclusive or 100% fail proof. Hence we agree that there is a certain uncertainty in our hypothesis testing and we quantify it. So whenever we are speculating on the population parameter the mean of the population can be this much or the variance of the population can be this much. On what basis we are doing the speculation? We make these estimates or assumptions regarding the population parameters from prior knowledge or experience, from prior experiments and now we check whether the process parameter has changed. Suppose we are having a machine which is operating at a certain power other settings of the machine are also fixed. It is giving a average particle size of 50 millimeters. So we are using the machine for a long time and it has been working very well and so the average is very very close to 50 millimeters. So we can say that mean is equal to 50 millimeters. Suppose some modifications have been made to the machine maybe it went for maintenance check or some part was replaced then again the machine is grinding the raw materials and providing particle sizes. Now we want to know whether the previous mean value of 50 millimeters is again met by the machine or because of the process modifications it is producing particles which are lower than the original mean value or greater in size than the original mean value. So we know from prior knowledge or experience from prior experiments we have collected or accumulated large amount of data and after some modifications we want to see whether the process parameter has changed. Also the parameter may be set based on a mathematical theory or a model and we want to verify whether the data agrees with the model predictions. A parameter is proposed from engineering or design specifications or contractual applications and we have to find whether the current data supports the parameter. For example the XYZ company was guaranteeing 2.3 gigawatts from its nuclear reactors as the average power output. So that is based on contractual applications or design specifications and then we actually monitor the reactors performance and take random sample and find the mean power output we can check whether the mean power output of the reactor is actually 2.3 gigawatts or lower. So what is the procedure involved in hypothesis testing? We first take a random sample from the population of interest. Again this is a most crucial step. Sometimes its importance is underestimated. You cannot blame the final decision or the final outcome if the sampling was done properly. Compute the relevant test statistic from the sample. The relevant test statistic we are familiar with so far are the sample mean and the sample variance. We really have not looked into any other test statistic but the sample mean and sample variance would do just fine for us including our analysis of design of experiments. Well you must be curious what are we doing here now? I mean where is it going to tie up with design of experiments. I am eager to learn design of experiments. I would suggest you to be a bit more patient. We will be definitely looking at design of experiments very shortly and you will really appreciate all the concepts we have learnt so far when you see them being applied in design of experiments. Use the test statistic to make a decision about the original or null hypothesis. So I have introduced the new term original or null hypothesis. Let us now get into the defining of original or null hypothesis. So many real life problems encountered in engineering may be formulated in terms of hypothesis testing problems. Hypothesis testing forms the foundation of more advanced experimental design techniques. That is what I told you just a short while back that whatever we are learning now hypothesis testing the t-distribution, chi-square distribution, the f-distribution will find immediate applications in the design of experiments. In design of experiments as well as in linear regression tools we will be extensively seeing the application of the t-test, the f-test and also the 95% confidence intervals. So hypothesis testing and confidence interval estimation of parameters are fundamental tools applied at the data analysis stage in comparative experimentation. There are two types of hypothesis. One cannot exist without the other. The first hypothesis which is usually made or initially made is the null hypothesis and the second hypothesis is its contradiction the alternate hypothesis. In defining two hypothesis we imply that the rejection of the null means automatic acceptance of its alternate. So why do we make the two hypothesis statements? So any null original or initial statement or hypothesis is a speculation. So we cannot claim that it is 100% accurate to allow for the existence of an alternative to the original statement we have made. We propose or state the alternate hypothesis. There are different ways of disagreeing. The one way is a kind of neutral manner saying that I do not agree with you. The second way of saying is what you are saying is not correct. Actually the performance is better than what you are saying and the third way of rejecting the original statement or rebutting the original statement is the performance is lower than what you are claiming. So there are different ways to disagree. One is simply saying it is different or being bit more specific saying it is greater than or less than. So normally we are not talking here of philosophical arguments. We are talking about entities that may be quantified into numbers and mathematical formulae. So there are two hypothesis. One is the initial original or the null hypothesis and the second is the alternate hypothesis which is so stated that it contradicts the null hypothesis. How do you propose the null hypothesis? This is a very interesting issue here. You are going to a company after finishing your B-tech or M-tech. You are very enthusiastic and bubbling with energy and you find a process being done in the industry and you feel look this process is not being done correctly. If I make this modification the process will run much more smoothly or much more efficiently. Then you go and tell it to the management. The management of course welcomes new ideas but that would mean also a lot of commitment from their side in terms of manpower, time, money and they also do not know how the customers or the client would react to it. So the management would be rather inclined to let things continue as they were probably not as efficiently as you are considering but there is no immediate shutting down of the plant or revamping of the process. So things will continue to run as usual. So you have to provide a strong convincing evidence for them to stop everything and make the process modification. Even when you are doing experiments in the laboratory for your MS or PhD research program you have to be skeptical. You have to assume that none of the variables you are investigating is going to affect your process response. Well this is sort of in contradiction or opposition to our aim of doing the experiments. We want to clearly show that some of the variables or all the variables we are investigating is impacting the process in a strong manner but a true researcher will always be a skeptic. He will have to say initially that there is no change or status quo is being maintained. Even if you change the variables it is not going to affect the response. Of course this may not be true because obviously when you change something there is going to be a effect on the response. Judge sitting in the court may have to make the most important decision of all whether to allow a person to continue to live or to be sent to the gallows because he has apparently committed a crime. So the judges initial attitude will be look this person is innocent. The prosecution has to provide evidence beyond a reasonable doubt so that person may be convicted. So the null hypothesis is sort of a stabilizing one. It keeps us grounded and is based on the concept that there is no change or status quo is being maintained. And guideline for choosing a null hypothesis is when a new claim is being made the nullification of the claim is taken as the null hypothesis. According to Ramachandran and Sokars the nullification or the contradiction of the claim is taken as the null hypothesis. So the claim is I am going to increase the plant performance by 10% thereby making you a profit of 1 million dollars per annum. So that is a new claim being made. The management is cool to the idea and say that look your claim is not going to make a difference the plant will continue to run as before. So null hypothesis is always the nullification or the neutralization of the claim that is being made. Anyway we cannot live in speculation we have to try out different ideas and then we have to come to a conclusion. After hypothesis testing we conclude that the null hypothesis cannot be true then we reject it in favor of the alternate hypothesis. If the alternate hypothesis is not true then it means that we cannot reject the original hypothesis. We are not making an absolute statement that the null hypothesis is correct. We have to say perhaps in legal terminology that enough evidence was not provided to establish beyond reasonable doubt that the null hypothesis is wrong. I am repeating enough evidence that could establish beyond reasonable doubt that the null hypothesis is wrong was not provided. Hence there is no sufficient evidence to reject the null hypothesis. We are not claiming or we are not stating that the null hypothesis is true. We are only saying that sufficient evidence was not provided to reject the null hypothesis. We use the sample data and identify a test statistic which is a function of the sample measurements using which we try to establish the null hypothesis or its alternate and subsequently make a decision. So far we have seen what is meant by a null hypothesis and what may be the forms that may be taken by the alternate hypothesis. Now we have to see how to actually go about carrying out the hypothesis test procedure. So when you formulate the hypothesis statements we can take an example from the legal side. So as I said previously the null hypothesis is the person is innocent. The prosecution vehemently wants to prove the case and send the charged person to jail. They have to come up with suitable and clinching evidence. So they are working towards the rejection of the null hypothesis. The management is making a null hypothesis that the process modification is not going to make a difference. Whereas you the originator of the idea will be actively looking for suitable evidence to indeed prove that your concept is correct and the null hypothesis can be rejected. So if the prosecution is unable to provide evidence beyond reasonable doubt that the person is guilty then the person is released on the grounds of insufficient evidence to prove his guilt rather than the firm statement of his innocence. It is indeed probable that the person was guilty but the prosecution simply could not establish his guilt. So there can be different types of alternate hypothesis. If the alternate hypothesis contradicts the null hypothesis by saying that the parameter under test is not equal to what was proposed in the null hypothesis. It is called as a two-sided alternative hypothesis. The null hypothesis proposes a statement that the population parameter is equal to a certain value. The alternate hypothesis considers the possibility that based on the evidence provided the population parameter may be less than the proposed value or greater than the proposed value. Because we are talking about random phenomena when there is a negative deviation on one occasion. On another occasion there may be a positive deviation. So in order to account for such kind of deviations we are using the alternative hypothesis in terms of not equal to. The original null hypothesis may say that the population mean value is 50. The alternate hypothesis may be the population mean value mu is not equal to 50. Under such situations we allow for the possibility that the population mean may be greater than 50 or less than 50. So we are allowing for the two-sided possibility. So it is called as a two-sided alternative hypothesis. If the alternate hypothesis claims that the parameter is either greater than or lesser than what was claimed in the original hypothesis it is termed as a one-sided alternative hypothesis. For example in the nuclear reactor case you are having a null hypothesis of mu is equal to 2.3 gigawatts. The sample mean is showing you a value of 2 gigawatts. So the company or the industry which is using that reactor sees red and claims that no no no the parameter value of mu of 2.3 gigawatts is not correct. The actual average power output from the reactor is less than 2.3 gigawatts. It will not even consider the possibility that the mu average power output can be greater than 2.3 gigawatts. It will say it will be less than 2.3 gigawatts. So this is a one-sided alternative hypothesis using the less than sign in the alternate hypothesis statement. Alright. What about the alternate hypothesis involving greater than? For example you are monitoring the air quality in a particular place where recently there has been lot of industrial activity. So the null hypothesis which the new industrial companies will be interested in is that there is no change in the pollution levels. The average pollution levels are the same as they were originally before the industrial activities started. I am using the advanced or state of the art pollution control measures. So I am not letting out really any toxic gases to the atmosphere. So the mean population levels of the pollutants in the ambient air is the same. It is unchanged. But the pollution monitoring agency may be more interested in proving that the mean value cannot be what was originally it has indeed gone up. In which case you are going to use the greater than sign in the alternate hypothesis. So the null hypothesis will be mu is equal to mu not the original or the baseline value. The alternate hypothesis for the industrial pollution problem is mu greater than mu not. So after the industrial activity has started there has been an increase in the pollution levels. That is what the environmental pollution agency will be looking for. It is really not going to be interested in the possibility mu less than mu not. It is interested only in mu greater than mu not. So again we will be going in for a one sided alternative hypothesis and that would involve the sign of greater than in the present case. So after the judge has passed a decision regarding the innocence of the accused either way he may have found him not guilty or may have found him guilty. So there will be always question did I release the person wrongly or did I send an innocent person to the prison. So these kind of doubts will always be there. So whenever we have made a decision with the best of intentions we still may have the doubt that our decision was not correct. So how to quantify these kind of errors in decision making. From a common sense point of view we make a decision after giving a suitable margin so that we do not make the wrong decision. The margin may be quite lenient. For example if students are writing an exam our expectation would be the student should get at least 60% marks to pass the course. For example the exam is so easy in my opinion they should get at least 60% if they have really understood something from this course and then pass it. But we set a pass mark of 40% just to be on the safe side so that no person who has reasonably understood the course is failed. So the errors in decision making are wrongly accepting the alternate hypothesis. So the null hypothesis in fact was correct but you have accepted the alternate hypothesis wrongly. The second one may be failing to reject the null hypothesis by rejecting its alternate. Which of these two is a more serious error? Let us again take the court case and the first error wrongly accepting the alternate hypothesis would mean the person was in fact innocent but the judge based on the evidence presented to him wrongly accepted the prosecution's arguments and send the innocent person to jail. That is a very serious issue or the management got carried away by your technical presentation and accepted your idea spent lot of money and unfortunately the idea did not really work okay. That was not any significant or noticeable improvement in the process after the modifications were carried out okay. The second error is to fail to reject the null hypothesis by rejecting its alternate. So what it really means is the person was indeed guilty but the judge released him okay. So what really happened was the guilty person got away free. When you compare the two types of errors the first one is pretty serious okay. The second one is also an error but it is not as serious as the first error. The first error an innocent person was sent to jail or he was hanged or whatever and in the second case the guilty person got away. So which of these two is more serious you yourself will be able to answer. So our decisions are associated with uncertainty. There are also probabilities associated with the wrong decisions. The probability of rejecting the null hypothesis when it is in fact true is called as the type 1 error and it is termed as alpha. We have seen alpha earlier when we were constructing the confidence intervals. The probability of accepting H0 when it is in fact false is the type 2 error and it is termed as beta. So probability of rejecting H0 when it is true is called as the type 1 error and it is denoted by alpha. The probability of accepting H0 when it is in fact false is called as the type 2 error and it is termed as beta. Maybe I should write the probability of failing to reject H0 when it is in fact false is called as type 2 error. So when we come back after a small break we will be looking at this table and we will see after a few minutes.