Learn R Programming

ufs (version 0.1.0)

cramersV: Cramer's V and its confidence interval

Description

These functions compute the point estimate and confidence interval for Cramer's V.

Usage

cramersV(x, y = NULL, digits = 2)

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

confIntV(x, y = NULL, conf.level = 0.95, samples = 500, digits = 2, method = c("bootstrap", "fisher"), storeBootstrappingData = FALSE)

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

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.

digits

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

Any additional arguments are passed on to the `print` function.

conf.level

Level of confidence for the confidence interval.

samples

Number of samples to generate when bootstrapping.

method

Whether to use Fisher's Z or bootstrapping to compute the confidence interval.

storeBootstrappingData

Whether to store (or discard) the data generating during the bootstrapping procedure.

Value

A point estimate or a confidence interval for Cramer's V, an effect size to describe the association between two categorical variables.

Examples

Run this code
# NOT RUN {
### Get confidence interval for Cramer's V
### Note that by using 'table', and so removing the raw data, inhibits
### bootstrapping, which could otherwise take a while.
confIntV(table(infert$education, infert$induced));

# }

Run the code above in your browser using DataLab