Welcome to clinical data management program using SAS. In this video we will be discussing about two way ANOVA. So, what is to win over two way ANOVA is a technique which requires one continuous variable and two categorical variables were the categorical variables has got greater than equal to two categories or greater than equal to two levels and using two way ANOVA there is a major difference between two way ANOVA and one way ANOVA basically into one over we additionally check the interaction effect along with the individual impact and in one way ANOVA we always used to check the individual impact so into whenever we also check the interaction effect that is to when or requires one continuous variable and two categorical variables. The categorical variables must have more than two categories using proven or we check that whether any of the categorical variable is individually creating impact on the dependent variable or whether there is any interaction effect.
That is whether the categorical variables are jointly creating impact on the dependent variable. So what The hypothesis for the two way ANOVA hypothesis for the two way ANOVA is h notice the categorical variable is creating an significant impact on the dependent variable. It's not as basically categorical variable is not having a significant impact on the dependent variable. And each one is categorical variable is having a significant impact on the dependent variable. So now let's move to the case studies that we'll be doing in SAS for two way ANOVA that is, here are the types of treatments given to the patients the types of diseases they are suffering from are given that is TRP. And type is given these two are the categorical variables, we need to check that whether p r is creating an impact on employment changes and changes is a continuous variable or Titus creating impact on the haemoglobin changes.
These two have individual impact or whether they are jointly creating impact on employment changes. There is a GVC so whether TRT and typer, jointly creating impact on them living changes, certainly to solve this case study. Let's move to SAS, we have to again run the lignum statement where Right lignin the name of the library and the purpose of the data sets is there so let's run the signum statements. To see this the CDM library you have the data over here we'll be using the data called a gbd s. So, this is my data set that we are going to be using this is the treatment and this is the type patient number of demographic changes treatment are of basically two types, that is act and PVO act means experimental treatment and PbO means treatment which is only creating psychological impact. It is not creating any physical impact and type is the type of diseases that the patients are suffering from see means they are suffering from cervical sorts of diseases, they are suffering from cervical diseases, it means they are suffering from prostate diseases and are means they're suffering from colorectal diseases.
So first, let me change this type variable that is here. semen cervical payments, prostitutes are really colorectal disease. So let me replace this C by cervical prostrate p by prostate and RB correct. So let us manipulate our dataset a bit so for that we are going to use the concept of proc format proc format, then semi colon, then value let's give a false name that is dollar sign j using dollars and because our format is a character format, dollar type so proc format value dollar tip FMT, this is my format name within double quotes will give c because C will be replaced by cervical then B will be replaced by four stripped and odd will be replaced by color actor and then semicolon. Now let's run this code comment is only procedure which does not is another it's not the only procedure consists one of the procedures which does not generate any result viewers so your picture the log to check whether your format is properly executed or not to see it's properly executed.
Now the applicate result of procurement you will understand when you apply the user defined format or the format that you have created over here in your data set or a new result viewer so we will be creating a new data set called Data egb directory creating data sitting work then set CDM doc my data Sydney original data set name is egbdf then we'll be doing format this is a format name. For the format name we have to also write the variable name where we have to use the format so my data set is given over here and this is my variable name type variable to apply the format select the copy the variable name. This is first format variable name then the format name and then dot semicolon. I hope you understood that we have used for dollars and before the formatting because it's the case to comment and then run so let's run this code before I open the data set or check the output of explaining on the code I have created a new data set called age a GB inside my work library as I did not specify any library name say gbd doesn't work library okay so now let's open the work library inside which my AGP data set is created to see now see is replaced by cervical P is repressed by prostrate and r is replaced by co-director.
So this is my data set HDB on which I'm going to apply the concept of to win so in order to apply the concept of proven will be again using the same procedure called proc ANOVA data. So that is proc ANOVA. Data equals my data set is there in work so I'm just reading a gv my categorical variables after stressful using Google Last categorical variable names that treat and type treat other types of treatment given to the patient that is a CT and PbO a CT means experiment treatment PbO is treatment which creates psychological impact. So, class treatment type then let's give the model statement that is modern my dependent variable is he bch. So, model he bch equals treat first and then type These are my ag bch is the dependent variable treat and type these independent variables are categorical variables first treat and then type and then treat start like so, basically using two way ANOVA we are going to first check the individual impact of trade that is whether trade is really impact on hemoglobin changes or type including pattern of living changes or whether they book treated diaper jaunty, creating background The hemoglobin changes and then run and after that quit so before I run this code let me first explain you all the code we have used the procedure proc and over data on our GP data set which is located inside work that's where I did not specify any library name then I have specified the categorical variables using the class to put letters class for each type, then model, my dependent variable is modeling changes ag vch.
Now I'm checking whether three is really important the dependent variable type is reading part of a dependent variable, or whether they're jointly creating the dependent variable. So then run and then quit. Now, let's run this code. Does this matter what procedure so see here the level of significance is or the P values are given for treat it is 0.0491 it is nearly 0.05 but still it is bit less than 0.05 whereas 0.05 is the level of significance here I will be rejecting may not be practices so it will accept alternative hypotheses that is treat is creating Back then for type also the 0.0 370s It is very much less than 0.05. So, I will be again rejecting my null hypothesis I will accept my alternative hypothesis that is my type is also creating impact on my dependent variable, but when I see the impact with 0.70 money very much greater than my level of significance that is treatment type there come the combination of both and not at impact on my dependent variable as maybe where is greater than my level of significance, I accept the null hypothesis for treat startac that is for the joint impact and for the individual impact in case of freedom.
So, you have to accept the null hypothesis you have to accept the alternative hypothesis and reject null hypothesis as the p value is less than level of significance in case of type also the p value says the level of level of significance So, treat and typer individually creating impact on the dependent variable. Now, there is another part of two way ANOVA it's very important that is let's do the post hoc analysis for to whenever we have now come to know that treat has is create individually creating impact another dependent variable type is industry. Due to creating impact on the dependent variable, now which level of treatise creating impact on the dependent variable, and which level of type is creating impact on on the dependent variable that we need to do? So for that, we'll be doing the post hoc analysis and posting analysis into whenever is done using Takis test.
So, for that again, we are going to use the same procedure called proc and over data. So proc n over data equals my data set name will be GB semi colon I, since my data set is created engine work library, so I did not specify the library name then class treat and then take these make up these these among categorical variables and then model a Jew bch that is haemoglobin changes UPC H equals two. My significant variables are treat and type that is also the individually significant. They're individually creating impacts from writing them individually. So model the dependent variable equal to treat and type operating impact semicolon then we will do the talk he says that his wheelchair Takis means to means we are checking with respect to the variable Street and tight because these are only individually creating impact. Then slash will write khaki is a key word for de Heesters semicolon and then drum and then quit.
Now let's run this code. So this is the turkeys means. This is for treat. So for treat, see, for the for the category act mighta. He means a great mood. Then the category preview that means experiment treatment or ACH categories creating more impact on a dependent variable and living changes, say experimental treatment is creating more impact on glowing changes or we can say experimental as a result of the experimental treatment there are more common living changes.
Next in case of type There are three types type that is prostrate, cervical and corrective. So, out of them we see that prostate is having the maximum value of tacky means, so, that means pastured patients who are suffering from prostate diseases they are more creating impact on the haemoglobin changes or maybe you can also draw this here they are having more hemoglobin changes so those patients from patients from foster diseases are having more hemoglobin changes that is they're creating more impactful changes which are made dependent variable and over here in case treat patients who are treated with experimental treatment that is act they're having maximum caffeine sets with their trading more efficient. On the home of living changes are patients who are treated with experimental treatment they're having they are creating more homogeneous living changes for the patients. So this is all about two way ANOVA so we'll be ending this video here.
Before I move to the next video I just want to your to understand or recap the concept of proven over and over and over we have basically check the individual significance and overall significance and after checking which of the variables within that whether the variables are individually creating impact, or Priam, or whether it is God creating impact. We have also done the post hoc analysis to check which level of the variable is creating impact. In this case, the variables that are individually creating impacts we have also found out which category of that particular categorical variable is creating impact on the dependent variable in my odd using post hoc analysis, how to use it in my Takis test or using my hockey sticks. In the this video we'll be ending over here in my next video, we'll be discussing about the concepts of linear regression. Thank you Goodbye.
See her for the next video.