Learn R Programming

vcd (version 1.4-13)

table2d_summary: Summary of a 2-way Table

Description

Prints a 2-way contingency table along with percentages, marginal, and conditional distributions.

Usage

table2d_summary(object, margins = TRUE, percentages = FALSE,
  conditionals = c("none", "row", "column"), chisq.test = TRUE, ...)

Value

Returns invisibly a \(r \times c \times k\)

table, \(k\) depending on the amount of choices (at most 3).

Arguments

object

a \(r \times c\)-contingency table

margins

if TRUE, marginal distributions are computed.

percentages

if TRUE, relative frequencies are computed.

conditionals

if not "none", the conditional distributions, given the row/column factor, are computed.

chisq.test

if TRUE, a chi-squared test of independence is carried out.

...

currently not used.

Author

David Meyer David.Meyer@R-project.org

See Also

mar_table, prop.table, independence_table

Examples

Run this code
data("UCBAdmissions")
table2d_summary(margin.table(UCBAdmissions, 1:2))

Run the code above in your browser using DataLab