temp.data<-data.frame(a=rnorm(100)>0,b=rnorm(100)>0,gender=rep(c("male","female"),50))
#a vs. b stratified by gender
tab<-contingency.tables(a,b,gender,data=temp.data)
tab
##add in chi-squared tests
tab<-add.chi.squared(tab)
tab
Run the code above in your browser using DataLab