 We are studying in provincial statistics where we are talking about testing hypothesis. So far we've done a t-test and then one way and over where we were dealing with the one independent variable which was categorical and one continuous dependent variable. In real life when we are studying the phenomena and the variables, variables are not simply one-to-one connected but there are many other variables which are at play. For example, if we want to study what are the effects of studying t-hours in a day on the GPA or the final grades of the students, we cannot only take into account the studying hours. There are many other variables which are at play for example, home environment, for example, the mental or cognitive ability of the individual who is preparing for the exams and so and so forth. There are many other variables. So two way analysis of variants or factorial analysis of variants allow us to add more variables into the data. As I said that in real life variables rarely exist in isolation or without linking to other variables. For example, if I want to study that how much I can reduce my weight while doing exercise only, there may be some effect of exercise on weight reduction. And then another girl who is just doing a diet control to reduce the weight, that has another. But there are variables like if we combine exercise and diet control together there will be a hugely different impact on the weight loss or the dependent variable. So today we will talk about two way analysis of variants where we have more than one independent variable. So in the search study examines ANOVA having two factors or two independent variables, it is called two way ANOVA. Two way ANOVA means groups are defined by two independent variables. For example, if I want to study the performance of the students on the stage, I want to study what is the effect of the audience and what is the effect of the self esteem. So I have two independent variables like the self esteem of the individual and then audience present or not present on the final outcome of the performance or the errors that are made on the stage. So there we have like two variables. In factorial ANOVA we can add more variables and they are different levels but today's lecture we will be talking only about two way analysis of variants with the two independent variables. So in the two factor two way independent variables we called two factors like one independent variable as factor A and the second independent variable as factor B. The goal of factorial design study is to evaluate the mean differences as we did in the ANOVA and as we did in t-test that we want to know the mean differences between the groups. In t-test we had one independent variable with the two groups. In one way ANOVA we had one independent variable with the more than two groups but in two way ANOVA we have two independent variables with at least two levels for each independent variable and we are studying the differences or mean differences across groups. So study the mean differences that may be produced by either of the factors acting independently or by the two factors acting together. So the best and the most interesting thing about two way ANOVA is that it doesn't only tell us the main effect of the one independent variable and the second independent variable but it also tells us that how the two variables are interacting with each other and how combinedly they are affecting the dependent variable. As I just said that exercise and diet with exercise you may lose 2 kg with diet control you may lose 2 kg but when we are doing both how exercise and diet control are interacting together to make a huge impact on the weight loss. So this is an example of the two where we usually we call it a factorial ANOVA because in ANOVA one way or two way or T test independent variable is always categorical like we have groups for that for the measurement level we have a nominal level measurement for the independent variable. So here we have an example of the two way ANOVA so there are two variables one is the audience present or no present so presence of audience is one variable with the two levels and then the self esteem of the participants with the two levels that is low and high. So it will make two into two like two into two means that there are two variables and both have two levels or two groups within that and we have a dependent variable which is always continuous and that is performance on the stage in terms of errors they make. So this is an example taken from the gravator. So here in the two way ANOVA we calculate main effects like for example I will be calculating the main effect of the audience which is in the columns and then we have the second variable which is the self esteem which is in the rows so we have a rows and columns for both the independent variables and we not only calculate the main effects but also interaction effect of both variables. So this is what I have told already that the real advantage of combining two vectors within the same study is the ability to examine not only the main effects but also the unique effects caused by an interaction of the two variables. The concept of an interaction can be defined in terms of the pattern displayed in the graph. So mostly when we calculate two way ANOVA and we do it in SPSS then mostly the interaction pattern of the graph tells us about how the interaction is occurring. For example this is an example which I have told you that what will be the effect of the self esteem or audience presence on the performance. So you can see for this graph we have one variable on the axis axis and the separate lines they are indicating the second variable. So here you can see that there is no interaction effect. How do we know the interaction effect is not there because usually when the lines can cross each other then this line and this line will cross at some point. So for this we do have an interaction effect and for this graph we don't have an interaction effect. And here you can see that for example in no audience the low and high self esteem are relatively low. These are the number of errors. If you see when the audience is present then the low esteem has a lot of errors as compared to the person who has a high self esteem. So this means that performance is not only you can see in terms of self esteem or in terms of audience but when we combine both together it gives us very interesting and unique results that yes audience and self esteem are important. But they are more important when there is audience and the person is with a low self esteem that will be making more errors. We will make a hypothesis just like we made it in one way, in T test. We always start with the null hypothesis then we move to the research hypothesis. So simplest way of making a hypothesis is that we will be in two ways for factor A and factor B. The main effect hypothesis will be that there is no main effect of factor A. And the research hypothesis will be that there exists a main effect of factor A. Similarly for the factor B or the second independent variable again we will be saying for the null hypothesis that there is no effect but for the research hypothesis we will start with that there exists a main effect of the factor B. And the third hypothesis will be about the interaction that there exists an interaction between factor A and factor B. One of the things that is important in ANOVA is the degrees of freedom which we calculated in ANOVA in one way. But for the two way ANOVA degrees of freedom is quite kind of you have to calculate three kinds of degrees of freedom. So one is between group degrees of freedom means that our factor one for group one if we have a self esteem then if we have two levels then k is the groups and minus one we have always talked about before that is for degrees of freedom. So for self esteem if we have two levels then 2 minus 1 would be 1 that is the degrees of freedom for first variable then similarly second independent variable is our audience also has two levels so k minus 1 again for the factor B and then there is a interaction or interaction k liye hum degrees of freedom for A and degrees of freedom of B ko multiply karenge. So this is between groups must have naga degrees of freedom for A humaree one aaye hai aur degrees of freedom for B b one aaye hai to one into one humaree interaction k liye one degrees of freedom ho jayegi. Ashi tara humaree within group degrees of freedom hoti aur within group degrees of freedom humaree n minus k hai. For example agar humaree pass ye chaar columns bane hai aur chaar ho columns me humaree pass paanch paanch students hai total 20 hai to 20 minus 4 hum karke humaree 16 degrees of freedom ban jayenge for within group variants ya within group treatments ke liye aur total degrees of freedom hume nikal nahin patati hai that is always n minus one which is simple 20 minus one is 19. Ye aapko idea ho na chayegi hum har sel mein degrees of freedom ka concept hum ne pehle detail mein discuss kiya waya lakin in SPSS you don't need to calculate by hand actually it gives you the column of sum of squared yaani difference and then degrees of freedom and then mean square and then finally f value. One way Nova me humne baat ki thi hum kis tara se sum of square calculate karthe hain aur hum kis tara se degrees of freedom calculate karthe hain aur f value hum kisey calculate karthe hain. So the reason and assumptions are all the same behind it but we just will do it in SPSS that is easy and smarter way of doing it. Ek aur baat jo hum baat karthe testing hypothesis mein that before running any test you need to confirm the assumptions of that test before we run it in SPSS or in Nova Kander we know that assumptions are almost the same jo hum ne pehle baat ki thi number one observation within each sample must be independent yaani group one group two jaisa abhi humne four ka matrix banaya tha toh four sare boxes ke under individuals are different that is independent. So humari jo observations ya sample ya individuals hain they will be different across each box. So independence ki humari assumption hain. Phe rake humari population jise hum sample draw kiya hain that must be normally distributed aur uska humne baat ki thi ki we will check for normality through QQTP plot aur colmo group semiriden of test ke zariye bhi hum uski normality ki assumption chek kar sakta hain and then the population from which the sampaza selected must have equal variances. Homogeneity of variance ki humari assumption hoti hain humeisha one way mein bhi humne baat ki levin's test hum test karthe hain ki humari groups ke under jo variability hai wo that is equal yaani already groups ke under ko bohot huge difference nahi hain. So we will start in the next doing us in two way nova in ASPSF.