CrossTable(x, y, digits=3, max.width = 5, expected=FALSE, prop.r=TRUE, prop.c=TRUE,
prop.t=TRUE, prop.chisq=TRUE, chisq = FALSE, fisher=FALSE, mcnemar=FALSE,
resid=FALSE, sresid=FALSE, asresid=FALSE,
missing.include=FALSE,
format=c("SAS","SPSS"), dnn = NULL, ...)TRUE, chisq will be set to TRUE and
expected cell counts from the $\chi^2$ will be
includedTRUE, row proportions will be includedTRUE, column proportions will be includedTRUE, table proportions will be includedTRUE, chi-square contribution of each cell will be includedTRUE, the results of a chi-square test will
be includedTRUE, the results of a Fisher Exact test will
be includedTRUE, the results of a McNemar test will
be includedTRUE, residual (Pearson) will be includedTRUE, standardized residual will be includedTRUE, adjusted standardized residual will be includedTRUE, then remove any unused factor levelsTRUE.xtabs,
table,
prop.table# Simple cross tabulation of education versus prior induced abortions
# using infertility data
data(infert, package = "datasets")
CrossTable(infert$education, infert$induced, expected = TRUE)
CrossTable(infert$education, infert$induced, expected = TRUE, format="SAS")
CrossTable(infert$education, infert$induced, expected = TRUE, format="SPSS")
CrossTable(warpbreaks$wool, warpbreaks$tension, dnn = c("Wool", "Tension"))Run the code above in your browser using DataLab