From e9e400cc99a55285012e2daf6dfa06e3751f3942 Mon Sep 17 00:00:00 2001
From: Samuel Mondy <samuel.mondy@inra.fr>
Date: Wed, 8 Feb 2023 14:36:15 +0100
Subject: [PATCH] Deleted Chi_square test.r

---
 Chi_square test.r | 55 -----------------------------------------------
 1 file changed, 55 deletions(-)
 delete mode 100644 Chi_square test.r

diff --git a/Chi_square test.r b/Chi_square test.r
deleted file mode 100644
index 6a865e5..0000000
--- a/Chi_square test.r	
+++ /dev/null
@@ -1,55 +0,0 @@
-#########################################
-#Perform a chi-squared test
-#########################################
-
-
-#b must be a matrix containing the sums of the occurences of the OTUs for each variable with variables as columns
-
-#you should use the aggregate() function as done afterwards in the script of the function ensemble(a,b,name,OTUnumber)
-
-###chi square test with only 2 variables
-
-chi_sam<-function(b,seuil=0.05)
-  #########################################
-#########################################
-{
-  t<-apply(b,1,sum)
-  selec<-which(t>0)
-  b<-b[selec,]
-  t<-apply(b,2,sum)
-  selec<-which(t>0)
-  b<-b[,selec]
-  y<-chisq.test(b)
-  print(y)
-  print(y$expected)
-  print(y$observed)
-  print (y$p.value)
-  if(y$p.value<seuil)
-  {
-    if(dim(b)[2]>2)
-    {
-      z<-combn(dim(b)[2],2)
-      for(i in 1:dim(z)[2])
-      {
-        r<-b[,c(z[1,i],z[2,i])]
-        s<-apply(r,1,sum)
-        selec<-which(s>0)
-        r<-r[selec,]
-        x<-chisq.test(r)
-        #print(paste(colnames(b)[z[1,i]],colnames(b)[z[2,i]],sep=" vs "))
-        #print(x$expected)
-        #print(x$observed)
-        if(x$p.value<(seuil/dim(z)[2]))
-        {
-          print(paste(colnames(b)[z[1,i]],colnames(b)[z[2,i]],sep=" vs "))
-          print(x$p.value)
-        }
-      }
-      print(paste("corrected p-value ",(seuil/dim(z)[2]),sep=""))
-    }
-    else
-    {
-      print (y$p.value)
-    }
-  }
-}
-- 
GitLab