Learn R Programming

rosetta (version 0.3.12)

crossTab: Cross tables

Description

This function produces a cross table, computes Chi Square, and computes the point estimate and confidence interval for Cramer's V.

Usage

crossTab(x, y = NULL, conf.level = 0.95, digits = 2, pValueDigits = 3, ...)

# S3 method for crossTab print(x, digits = x$input$digits, pValueDigits = x$input$pValueDigits, ...)

# S3 method for crossTab pander(x, digits = x$input$digits, pValueDigits = x$input$pValueDigits, ...)

Value

The results of ufs::confIntV(), but also prints the cross table and the chi square test results.

Arguments

x

Either a crosstable to analyse, or one of two vectors to use to generate that crosstable. The vector should be a factor, i.e. a categorical variable identified as such by the 'factor' class).

y

If x is a crosstable, y can (and should) be empty. If x is a vector, y must also be a vector.

conf.level

Level of confidence for the confidence interval.

digits

Minimum number of digits after the decimal point to show in the result.

pValueDigits

Minimum number of digits after the decimal point to show in the Chi Square p value in the result.

...

Extra arguments to crossTab are passed on to ufs::confIntV().

Examples

Run this code

crossTab(infert$education, infert$induced, samples=50);

Run the code above in your browser using DataLab