chi_test_sum<-function(a,b,aname=NULL,bname=NULL){
  chi<-chisq.test(table(a,b))
  
  lst<-list(matrix(chi$observed,nrow=2,byrow = FALSE,dimnames = list(levels(factor(a)),levels(factor(b)))),chi$p.value)
  names(lst)<-c(paste("observed,",aname,"vs",bname),"pval^")
  return(lst)
}


       