This function creates a two-way and three-way cross tabulation with absolute frequencies and row-wise, column-wise and total percentages.
crosstab(x, print = c("no", "all", "row", "col", "total"), freq = TRUE,
split = FALSE, na.omit = TRUE, digits = 2, as.na = NULL,
write = NULL, check = TRUE, output = TRUE)
Returns an object of class misty.object
, which is a list with following
entries:
call
function call
type
type of analysis
data
matrix or data frame specified in x
args
specification of function arguments
result
list with result tables, i.e., crosstab
for the
cross tabulation, freq.a
for the absolute frequencies,
perc.r
for the row-wise percentages, perc.c
for the column-wise percentages, perc.t
for the total
percentages
a matrix or data frame with two or three columns.
a character string or character vector indicating which
percentage(s) to be printed on the console, i.e., no percentages
("no"
) (default), all percentages ("all"
),
row-wise percentages ("row"
), column-wise percentages
("col"
), and total percentages ("total"
).
logical: if TRUE
, absolute frequencies will be included
in the cross tabulation.
logical: if TRUE
, output table is split in absolute
frequencies and percentage(s).
logical: if TRUE
, incomplete cases are removed before
conducting the analysis (i.e., listwise deletion).
an integer indicating the number of decimal places digits to be used for displaying percentages.
a numeric vector indicating user-defined missing values,
i.e. these values are converted to NA
before conducting
the analysis.
a character string for writing the results into a Excel file
naming a file with or without file extension '.xlsx', e.g.,
"Results.xlsx"
or "Results"
.
logical: if TRUE
, argument specification is checked.
logical: if TRUE
, output is printed on the console.
Takuya Yanagida takuya.yanagida@univie.ac.at
write.result
, freq
, descript
,
multilevel.descript
, na.descript
.
Rasch, D., Kubinger, K. D., & Yanagida, T. (2011). Statistics in psychology - Using R and SPSS. John Wiley & Sons.