CrossTabs.RdCrossTables with margins and either overall, row or column percentages.
CrossTabs(fac1, fac2 = NULL, TYPE = "ALL", NOZEROS = T, DIGITS = 1, PVALUE = F, VARNAME = F, LONGNAME = NULL, ALL = NULL)
| fac1 | factor or variable convertible to factor |
|---|---|
| fac2 | = NULL factor or variable convertible to factor. If not provided a dummy factor is generated. |
| TYPE | = "ALL" chooses between "ALL", "ROW", "COL" |
| NOZEROS | = T Option to discard factor levels which do not occur |
| DIGITS | = 1 Number of decimals for percentages |
| PVALUE | = F p-value from Chi2-test |
| VARNAME | = F Option to add a column on the left with the varname of fac1 |
| LONGNAME | = NULL alternative to varname derived from function call |
| ALL | = NULL If ALL=NULL 'All' columns on the right, if ALL=T on the left and if ALL=F omitted |
CrossTable as data.frame with Counts and Percentages intercalated.