Okay for a Time Square test is to use to compare the relationship between our two categorical variables. So now hypothesis mean that two categorical variables have no relationship, alternate hypothesis mean that our two categorical variables have relationship okay. So for Python programming we can use something like this. Ah, so observation equal NP array then 10 2040 Okay, so you can take the code here okay there we can base it somewhere here. Okay, so NP array, so we can print observation. Then we print the chi square statistic Either statistics or the Ty square statistics okay let me see ah I two Okay.
There we can bring the p value okay we K and str p MBK bring the audio audio F stands for degree of freedom. So D is the agree always are all fine then at his freedom okay then we can do something like this okay then we can run the code is only get a steady state is 2.5 Say send a p value is 2.277 degree of freedom is two. So this is MP da Rae okay then we can do as a result so, for chi square test, now hypothesis is that our two variables are independent alternate hypothesis is that two variables are not independent. So, P value is 0.2775 phi has p value is more than 0.05 which is our alpha value. Now hypotheses is our fail to reject So, we cannot reject this null hypothesis hypotheses. So, the two variables are independent okay