#Biostatistics 440 #2X2 CONTINGENCY TABLES ZAR=read.table("ZarEX23.2R.txt") ZAR attach(ZAR) Y=count A=handedness B=sex #CROSS-TABULATION IN R: X=xtabs(Y~A+B) X #USING CHI-SQUARE STATISTIC: chisq.test(X,correct=F) #USING YATE'S CORRECTED STATISTIC: chisq.test(X,correct=T) #DATA KEYED INTO MATRIX BY ROW #USING CONCATENATION FUNCTION c() AND MATRIX FUNCTION matrix(): X=matrix(c(6,12,28,24),nrow=2,byrow=T) X