 Okay, continuing with our example involving 3 factors in the 2 power 3 factorial design first we will calculate the error sum of squares. We have to calculate the total sum of squares first and then we subtract from the total sum of squares the sum of squares of all the effects. So the total sum of squares is 30.018 with the grand mean equals 3.5 i is equal to 1 to a the index i running from the levels of a here we are having only 2 levels and j is equal to 1 to b is representing the 2 levels for b and k equals 1 to c will represent the levels of c obviously a is equal to b is equal to c is equal to 2 and n represents the number of repeats. So that is given by the index l, l running from 1 to n. So you have y ijkl i for factor a index j for factor b index k for factor c index and n corresponding to the repeat index this is the overall mean and when we carry out these computations we get 30.018 and this represents the total sum of squares and the sum of squares due to the effects would be 29.890 from a b, a b interaction, a c interaction, b c interaction how did we calculate the effects sum of squares we have this formulae which I had shown you earlier. So using these formulae we can calculate the respect to sum of squares for the different effects and with this we get the error sum of squares which is rather small when you subtract 29.89 from 30.018 we get 0.128 and for carrying out the analysis of variance we first of all calculate the critical f value which is f.05 where 0.05 represents alpha which is the level of significance 1 numerator degree of freedom because each effect has 1 degree of freedom and 16 represents the degrees of freedom in the denominator it also represents the degrees of freedom for the error and the degrees of freedom for the error would be a b c into n-1 a b c would be 2 x 2 x 2 which is 8 n-1 would be 3-1 which is 2 so 8 x 2 would be 16 so that is why you have 16 degrees of freedom in the denominator. And hence we can divide the ANOVA table into source of variation degrees of freedom sum of squares mean square f not as before and you can see that the degrees of freedom are the same for all the effects and the interactions error I just told you as 16 degrees of freedom the sum of squares due to a would be 14.727 b is 1.233 c is 10.881 error is 0.128 and the mean square is obtained by dividing the sum of squares by the degrees of freedom. Here it is quite simple 14.727 divided by 1 is the same value 1.233 divided by 1 is 10.233 10.881 divided by 1 is 10.881 again but here it is 0.128 divided by 16 which comes to a value of 0.008 and this total is 26.969 and once you have the mean square you can divide it by the mean square error to get the f value. The f values are pretty large at 1841, 154 and 1360 the f values I repeat are obtained by dividing the mean square of that particular effect or the interaction with the mean square error. So we have the numerator degrees of freedom corresponding to degrees of freedom for the source of variation which we are considering and the denominator degrees of freedom corresponding to the degrees of freedom of for the error and similarly you can do for the binary interactions and the ternary interaction and we get these values. And interestingly the critical f value if you recollect was 4.49 these values considerably exceed this 4.49 and hence they lie in the rejection region. The critical f value was 4.49 the actual f value is much higher than the critical f value. So these lie in the rejection region and hence these indicate that a, b, c are important factors and hence the null hypothesis which says that those factors are insignificant should be rejected. Similarly you have a, b interaction to be quite significant it is much higher than 4.49. However interestingly b, c interaction is negligible because it is lying in the acceptance region the f value is lying in the acceptance region the critical value was 4.49 but this f value is only 3.34 and hence you can reject the other hypothesis null hypothesis. But for this case b, c you accept the null hypothesis that the factor b, c or the interaction between factors b and c is negligible. Now when you look at the a, b, c interaction again the f naught value is 0.12 which is considerably lower than 4.49 and hence we also accept the null hypothesis that the a, b, c interaction is not having any effect on the process. So this completes on our table but we can also find the p values, p values are very useful it tells us that by what margin the effect was considered to be significant or it was considered to be insignificant. What I really mean here is that the effect a for example or factor a for example became significant narrowly it just squeaked through or it was a very dominating factor okay. If the p value is very small then that particular factor or that particular interaction is strongly significant it is lying well in the rejection region. If the p value is let us say 10 power-3, 10 power-4 that indicates that the f statistic was lying firmly in the rejection region and you can reject the null hypothesis comfortably. But if the p value is 0.049 or 0.501 it is a marginal case it is hovering between rejection and acceptance okay. So it tells us the p values are a better indicator of how much we were able to reject the null hypothesis or accept the null hypothesis. Usually p values of 0.049 or 0.501 are unusual the p values are usually in the order of 10 power-3, 10 power-4 for cases where you reject the null hypothesis or you get rather high p values like 0.46 or 0.35 or even 0.10 when you accept the null hypothesis okay. But the p values here are very useful okay it tells us whether the effects were rejected by a comfortable margin or they narrowly got rejected. So instead of finding out f alpha effect degree of freedom and error degree of freedom you find fp effect degree of freedom and error degree of freedom okay with the associated mean square error ratio you find the probability associated with that ratio okay. So mean square effect by mean square error gives you the value and you find the probability associated with that particular value okay. So this is inverse of what we did earlier we just had the f value computed the critical value and compared the actual f value the critical value and then said whether we accepted or rejected but here we are given the f value and then you are also given the degrees of freedom you have to find the probability associated with that f value and this probability we compare it with 0.05 if it is much lower than 0.05 we reject the null hypothesis if the computed p value is greater than 0.05 we accept the null hypothesis. So when you look at these p values corresponding to abc you find these values are pretty small and so you can comfortably reject the null hypothesis saying that these effects are useless. So you have to say with lot of confidence that abc effects are significant but when you look at bc the p value is 0.086 which is greater than 0.05 and hence bc is a insignificant interaction in the process whereas abc is having a p value of 0.734 which is quite huge and hence you can reject the null hypothesis sorry you can accept the null hypothesis that abc effect is insignificant. The same conclusion we saw earlier also we did not consider bc and abc to be significant let us go back to that particular table bc 3.34 was smaller than 4.49 abc 0.12 was again smaller than 4.49 and hence we considered bc and abc to be insignificant. Significant factors will have high p values and significant factors or significant interactions will have very low p values please remember this. From the analysis it may be concluded that temperature, sturdier speed and rpm influence the extraction all the binary interactions except those between sturdier speed and particle diameter are significant a ternary interaction between temperature, sturdier speed and particle diameter is not significant. So we have the data the most important analysis after the experiments are carried out when the model has been developed is to analyze the residuals. We have seen the analysis of variance table from which we can detect the important effects. Another way to detect the important effects which I have not indicated so far is the use of the normal probability plots. The different factors and their interactions are plotted in the normal probability plot and we can find out which of the effects are significant. So in this plot we can see that abc and bc are lying close to the solid line whereas c, ac, b, ab and a are lying quite further apart. This means that the effects corresponding to factors c, ac, b, ab and a are significant whereas bc and abc are insignificant. The next important concept in design of experiments is to analyze the residuals. The residuals are defined as the difference between the actual experimental value and the prediction from the model. So you can see that eijkl this is the residual corresponding to a single point. There is a difference between two values. The first value is the response corresponding to the ith setting of factor a, jth setting of factor b and kth setting for factor c because now we are looking at 3 factors and l corresponds to one of the repeats corresponding to the setting of i, j and k and this is the predicted value. The difference between the two would be defined as the residual. Now ideally we would like the residual to be 0 but in a real world there will always be some random error component. We want to see whether the difference between the actual experimental data and the model predicted value corresponds to random behavior. The difference is the residual and we want to see how random the behavior of the residual is. Similarly we calculate the residuals for all other experimental data points. So we may say the residual as the leftover effect after all the model the main effects in the interactions have been accounted for. So the experimentalist wants to see whether the model he has developed is adequate or additional terms are necessary. So we will be looking at a lack of fit concept in regression where more would be said about the adequacy of the proposed model. So what do we do with the residuals? We want to see whether the residuals are normally distributed, whether the residuals are independent and whether the residuals are having constant variance. We know that the basic assumption in the model development, in the linear model development was the error terms where independent and identically distributed in a normal distribution with zero mean and constant variance sigma square. By looking at the residuals trend or how they pan out, we can check these assumptions whether the residuals are normally distributed, whether they have constant variance, whether they are independent from one another. So the residuals may be plotted in a normal plot that is one option. The residuals may also be plotted in the time order in the sequence in which the experiments were carried out. The residuals may be plotted against predicted values and the residuals may be plotted against each of the factor levels to see the spread of the residuals at each factor level. So if the residuals are normally distributed, they will fall on the straight line on the normal probability plot. So as far as this experiment is concerned where we considered the three factorial design given the yield of the medicinal compound, we see that the residuals are behaving reasonably well. They are falling on a straight line more or less. We do not see any gross deviation of the residual from the straight line. The next check would be to inspect the pattern formation of the residuals. The residuals are ideally speaking impartial quantities. They do not really depend upon the sequence of the experimentation. They do not depend upon the fitted value depending on the experimental setting. So when you look at the spread or pattern of the residuals, you should really see no distinct trend. If the residuals are plotted against the fitted value and they show up a definite trend then something is amiss or something is not correct. If the residuals when plotted against the fitted value show a funnel kind of pattern. So they are spread over a smaller distance at low value of the fitted value and if the residuals spread out when the fitted value increases then something is not correct. So this indicates that the residuals increase with the fitted value and the error variance is not constant. That means it is not homogeneous and residuals are more broadly scattered when the fitted value increases. For example when the instrument error is proportional to the reading measured then the residuals are going to increase with the increase in value of the fitted value. Hence the residuals may not be normally distributed and they come from skewed distributions. In such cases you may have to go in for a stabilizing transformation for the variance and you may instead of using y directly may want to consider log y or root y. So the residual analysis is subject on its own and a fascinating one at that and because of lack of time we cannot go or dwell deeper into this subject. On the other hand there are some excellent books on residual analysis. One is the book by Draper and Smith and the next one is the one by Montgomery. They have been cited in the references. So when you look at the residuals as the against the fitted value you can see that they are pretty much scattered uniformly. You do not see any kind of funneling arrangement. For example you do not get a kind of diverging residuals. The next check is to see whether the residuals are independent of one another. So the residuals are plotted against run order and we have to see whether there is a systematic trend of positive residuals and negative residuals. What I am trying to say here is whether the residuals are over a certain time period increasing continuously and over the another time period they are decreasing continuously. This also means that the randomization is not properly done and the experimental response was affected by other unaccounted factors. For example if the temperature was not controlled properly or there was a sudden shoot up in the temperature then the sequence of residuals may show a continuously increasing trend or there may be some other unaccounted factor. So over a sequence of experimental runs the residual values may be continuously declining. So this shows that the randomization was not proper and there were unaccounted factors which affected the experiment in a certain systematic manner. When you look at this particular plot you can see that you do not find any sort of residuals showing a continuously declining trend over a significantly long time interval or along the order of observations. You can see that it is declining here but then it is increasing and here also it is increasing decreasing. So you do not really get 4 or 5 consecutive positive values or 4 or 5 consecutive negative values. So you do not see a systematic trend of sequences of positive or negative values as given here. And another important thing is the errors are having constant variance sigma squared. So are the residuals showing more or less the same variance is about the mean in this case 0. The residuals are plotted for different settings of a given factor and if the spreads are not unusually different even though some inequalities may exist then we may say that the assumption of constant variance is not bad. So here we have plotted the residuals as function of the 2 different settings of the temperature in the coded format and you can see that the spread is reasonably uniform around the origin. So the variance does not really change drastically from one setting to another setting. You have another case here, well you can see that this variance is smaller than this variance but in real data we cannot exactly get a uniform spread and so on. So unless there is a gross deviation we can assume the residuals are behaving in a reasonable fashion. For example if the residuals are clumped over a very narrow region here and the residuals are occurring over a broad region here then the assumption of constant variance may not be true but here the spread is comparable I would not say exactly identical but it is comparable and hence we can live with the assumption of constant variance. And another important thing is the presence of outliers, outliers are unusual data points. They may be thought of by the experimenter as rogue data point or rebellious data point, something which is not following the general trend, this lying way out of the general trend. The reasons for outliers may be pretty simple, measurement error or a calibration error of the instrument, some careless mistake or the settings were not noted properly. Usually the experimenter gets into a routine and he does not make these kind of elementary mistakes even though they are possible and if you find any outliers it is very important that you do not brush them under the carpet but pay closer attention to the reasons for the occurrence of such outliers or outlying data. They may tell you something different, something unusual is going on which is not accounted for in your approach to the experimentation. For example if there is a condition at which the data point shows an unusually high yield obviously that is going to be profitable to the company if it is true and the experimenter may like to inspect the data point more closely. Now coming to example 3, the problem statement goes like this, greenhouse gas is removed in a packed absorber, the variables studied are gas flow rate, solvent flow rate, solvent type and packing type. The experiments are repeated and the results are shown in the table below. Looking at the background for this example we know that carbon dioxide is a greenhouse gas and its emissions are very harmful to the environment leading to global warming and so on. So one way to reduce the emissions is to absorb the carbon dioxide in using a certain solvent. The solvent may be monoethanol amine or diethanol amine and the equipment in which the gases are removed by absorbing or putting it crudely, dissolving them in the liquid solvent is called as the absorber and if you put packings in them it becomes a packed bed absorber and we want to make the process quite effective and we want to see what variables are significant. So the variables studied are the gas flow rate, the solvent flow rate, solvent type and packing type, the experiments are repeated and the results are given below. This company apparently running these tests wants to keep the details confidential so the levels are expressed in the coded format. Since there are 4 variables you have 2 power 4 that is 16 runs and if you want to do at least 2 repeats per setting that would mean 16 into 232 runs. Pilot scale studies are quite expensive and hence the management may feel those 32 runs are quite a lot in terms of investment time and power and so on. So it may even consider telling to you what would happen if you do a fraction of those runs and see what results we get and then we decide to move on from there. Factorial designs of experiments are so structured that it is indeed possible to construct a fraction design and implement it. So the main thing is to how will it go about carrying out these tests and how may the results be interpreted and reported. So a full set comprises of 16 experiments so we can start with one half fraction of the full 2 power 4 design and we have 2 half fractions. Since there are totally 16 experiments one half fraction would involve 8 runs which would correspond to a 2 power 3 design but here you may ask wait a minute you are having 4 variables you are having a 2 power 3 design by making a 2 power 3 design I will be able to handle only 3 variables what about the 4th variable it does not seem to be there. So the answer to the question is even the 2 power 3 design we are considering all the 4 variables the only thing is we are not doing the full set of possible experiments as envisaged in the 2 power 4 design we are only having a 2 power 3 design and we are investigating all the 4 variables with the truncated design. So this means that while we are gaining on the effort in experimentation we are losing out on some information whether the losing out of the information is serious or not the results will tell us. So we are losing on information when trying to save on experimental effort. So how do you go about doing the design you are having 4 factors you are considering all the 4 factors so now let us look at the highest possible interaction among the 4 factors it is very simple it is A, B, C, D. Now when you look at the design matrix of an experimental design you will find that it has a set of columns each column containing some pluses and some minuses the number of pluses would equal to the number of minuses. And so in a 2 power 4 full design you will have 8 pluses and 8 minuses in every column the column may be A, B, C, D, A, B, A, C, B, C, B, D and so on. So it will have 8 pluses and 8 minuses. So look at the column corresponding to A, B, C, D all the pluses will constitute one set all the minuses will constitute another set please consider the experimental settings corresponding to the pluses that will be the first fraction. So the table of contrast comprises of 8 pluses 1 and 8 minuses 1 we use the set of 8 pluses 1 in the A, B, C, D column to define the first fraction and the remaining set of 8 minuses 1 in the A, B, C, D column into the second fraction. So all the pluses will be corresponding to one fraction all the minuses will be corresponding to the next fraction. So we define a design generator I is equal to A, B, C, D and use this to set up the 2 fractions. Once we define a design generator I is equal to A, B, C, D and use this for setting up the 2 fractions. So you can see that the design matrix is set up you see some of them are blue and some of them are red what is the reason for this it is quite simple. We take the A, B, C, D column whatever is 1 we label it as color coded as blue and whatever is minus 1 we color coded as minus 1. The experimental data were coded into plus 1 and minus 1 for the sake of convenience now I am color coding the plus ones with blue and the minus ones with red. So we collect all the plus ones and you can see that the experimental settings are also color coded according to whether A, B, C, D is 1 or minus 1. So this one represents a case where all the factors are at their low levels A, B, C and D are their low levels A is the setting corresponding to A at a higher level, B is the setting corresponding to B at a higher level. In such cases all other factors would be at their low levels. If you have A, B then both A and B are their high levels and all other remaining factors C and D would be at their low levels. Anyway this we have already seen I am just bringing it to your attention in case you have a doubt you just go back and then see this table things will become clear A is plus 1 here and A is minus 1 but B is plus 1. So that is quite simple but we do not look at these we look at A, B, C, D and we look at the color codes and we collect all the ones together then we collect all the minus ones for the second fraction and once we do that we will get the 2 fractions and we can now look at the design generator I is equal to A, B, C, D to find the aliases. You can see that A is equal to B, C, D here B is equal to A, C, D, C is equal to ABD and D is equal to ABC. So main factors are aliased with only 3 factor interactions. So even though the A and B, C, D are coming together B, C, D interactions are usually negligible. So the full effect of A is felt in even in the partial factorial design that is because the higher order interactions like third order interactions are usually not important that is very good. But sometimes in addition to the main factors the interactions are also quite significant or quite important but unfortunately in this design the 2 factor interactions are aliased with one another as you can see here AB is aliased with CD, AC is aliased with BD and AD is aliased with BC. That means when the information is presented we are unable to uniquely determine the interaction due to AB and interaction due to CD both of them are felt together. So A, C and BD are felt together and AD and BC are also felt together but whether that causes serious issues depends upon the responses and depends upon the particular experiment we are considering and let us look at the results and see what really happened. So the first fraction you have one AD, AB, AC, AD okay you can go in the sequence AB, AC, AD, BC, BD and then CD, AB, CD so that is what you have as the first fraction and if you look at it it is one AB, AC, AD, BC, BD, CD and AB, CD so we are having the first fraction and since we are done 2 repeats you have the same settings repeated twice and you have the experimental observations presented up to 2 decimals under the column percentage extraction. So I have given you the design table once again for the purpose of calculating the effects. The effect of factor A is decided by just go to A so it is minus 1 plus AB plus AC, minus 1 plus AB plus AC, minus BC plus AD, minus BC plus AD, minus BD, minus CD, plus AB, CD so minus BD, minus CD, minus BD, minus CD plus AB, CD so we are using the contrast in exactly the same way we did for the full factorial design. However even though you are doing it under A it is also having the aliasing with the BCD so will BCD have the same entries in its column when compared to that of A the answer is yes because A is aliased with BCD you cannot really distinguish between A and BCD because their column entries are identical. So let us verify this if you look at this BCD it also has minus 1 plus AB plus AC minus BC so let me write it down so that there is no ambiguity. So we are looking at BCD minus 1 plus AB plus AC minus BC minus 1 plus AB plus AC minus BC plus AD minus BD minus BD minus CD AB CD and earlier for A also it was minus 1 plus AB let me write it down so minus 1 plus AB plus AC minus BC plus AD minus BD minus CD AB CD. So when you look at the entries for A and also for BCD they are identical and when you are calculating the effect of A you are also finding the effect of BCD in addition. So the same idea will also apply for factor B which is aliased with ACD and for factor C which is aliased with ABD and factor D which is aliased with ABC. If you want you may take any main factor and it is ternary alias and see whether the column entries are matching it is a good idea to do this to verify so that we have set up the design matrix correctly. Similarly the 2 factor interactions are also aliased with one another so you can easily find that for example AB would have the same column entries like with CD okay and BC would have the same column entries as AD. So when you are finding the effect of A even though you write the linear contrast for A as LA it is actually having both effects of A and BCD in it and you have plus 4 entries and minus 4 entries so you divided by 1 by 4 for averaging purposes. So just as I showed on the board the effect of factor BCD is identical to that of factor A. Since there are 4 positive and 4 negative entries we take the average with respect to 4 that means we divide by 4 and you are also having 2 repeats. So we effectively divide the contrast by 8, 4 for the averaging and N for the number of repeats. So using this formula we can calculate numerically the effect of A and we find that A value is 5.25 so the entries are given here. So this is minus 1 and that the value is 19.22 plus 17.52 it is minus of 1. So 1 value is 19.22 and 17.52 so minus 1 would correspond to minus of 19.22 and minus of 17.52. Similarly you can find the values corresponding to the other settings please note that we are doing repeats and so for each setting there will be 2 values or 2 responses. So effect of B is effectively given by 6.56 that includes both B as well as ACD. So let me make that correction so again you have minus 1 and so again you have minus of 19.22 plus 17.52 and then plus AB 38.28 and 39.59. And let us just check it just 1 38.28 and 39.59 AB 38.28 and 39.59. So we are on the correct track and so others can also be written down in the similar fashion and we calculate the effect of B as 52.48 divided by 8 as 6.56. Similarly you can find the other effects so take care to divide the linear contrast by 8 to account for both the averaging and also for the repeating. The next important step is to calculate the sum of squares. Once you have the contrast calculating the sum of squares is also a piece of cake and the sum of squares is given by 1 by n into 2 power k into contrast squared and let us see how to calculate the sum of squares. The effect was given by contrast by n into 2 power k minus 1. Here k is equal to 3 because we are only looking at a 2 power 3 design 1 half fraction of a 2 power 4 design. So we put k is equal to 3 so 3 minus 1 is 2 2 power 2 is 4 2 repeats 4 into 2 8 and that is what we did when we divided the effects we divided the contrast by 8. So that is an order and hence we can calculate the contrast as effect into n power 2 power k minus 1 or effect into 8 will give you the contrast. Once you get the contrast you can square the contrast and divide by a suitable number to get the sum of squares. So contrast is 8 times the effect for contrast a you first find the effect of factor a and effect of a and then multiply by 8 and then you get back 42. This 42 corresponded to the 42 you had calculated earlier when finding the effect of a. And once you have the contrast then you divided by n into 2 power k. So contrast square is 8 times the effect and that becomes 64 times the effect squared divided by n into 2 power k which is n into or 2 into 2 power 3. So you get 64 effect squared by 16 or 4 effect squared. Sum of squares of a is 1 by 16 into 42 squared n is equal to 2 into 8 is 16 contrast we just now saw for a as 42. So you get 42 squared by 16 which is 110.25. Likewise we can find the contrast for b based on the effect of b and then square the contrast divided by 16 n into 2 power k and get the value for b. Similarly you can get for c, d, a, b, a, c and a, d. So using all these information we can construct the ANOVA table. The error sum of squares for doing so first we have to calculate the total sum of squares and the total sum of squares is given by this huge relationship y ijkl-y bar triple dot. So we are finding the total sum of squares now we are subtracting each experimental data observation with the grand total not the grand total the grand average add up all the numbers in the matrix divided by the total number of entries you will get the grand average and that grand average is subtracted from each and every individual observation and that will give you the difference which is squared and when combined or added completely gives you the total sum of squares. To make sure that you have understood this correctly please do the calculation on your own and see whether you get the correct number because more than the correct calculation it is the understanding of the procedure which is more important you have to implement the procedure in the correct manner. We have found the sum of squares due to the various effects by using the contrast squared and dividing it by the n into 2 power k okay I seem to forget it all the time. So that is 16 in our case so we calculated the sum of squares for all these effects and once that is done you also have the total sum of squares with you the sum of squares from all the effects are calculated and so you can find out the error sum of squares. So total sum of squares is equal to sum of squares of effects plus error sum of squares which comes to 583.2067 equals 580.2674 which is sum of squares of all the effects plus sum of square of error the sum of squares of error comes to only 2.9397. The next step would be to construct the mean squares and find the f values and see whether the f values are lying in the rejection region or not based on the critical f value. So we will continue with this example in the next lecture. Please revise the portions discussed in this slide discussed in this lecture rather and make sure that you have understood the important concepts make sure that you have understood how to form the different fractions because the understanding here will help you when you are actually carrying out the experiments. Please pay particular attention to the calculations of the errors how to account for errors in your experimental data and analysis okay the residual analysis is also very important. We will continue with this example in the coming lecture. Thank you.