azin.df<-data.frame(sex=c("f","f","f","m","m","m"), dose=as.factor(c(0,10,40,0,10,40)), count=c(363,157,219,103,99,83)) crosstabs(count~sex+dose,data=azin.df) +----------+ |N | |N/RowTotal| |N/ColTotal| |N/Total | +----------+ sex |dose |0 |10 |40 |RowTotl| -------+-------+-------+-------+-------+ f |363 |157 |219 |739 | |0.491 |0.212 |0.296 |0.72 | |0.779 |0.613 |0.725 | | |0.354 |0.153 |0.214 | | -------+-------+-------+-------+-------+ m |103 | 99 | 83 |285 | |0.361 |0.347 |0.291 |0.28 | |0.221 |0.387 |0.275 | | |0.101 |0.097 |0.081 | | -------+-------+-------+-------+-------+ ColTotl|466 |256 |302 |997 | |0.47 |0.25 |0.29 | | -------+-------+-------+-------+-------+ Test for independence of all factors Chi^2 = 22.60909 d.f.= 2 (p=1.23168e-05) Yates' correction not used