cramers_v_ci: Bootstrap confidence interval for Cramer's V

View source: R/bootstrap_ci.R

cramers_v_ciR Documentation

Bootstrap confidence interval for Cramer's V

Description

Percentile bootstrap for the association strength in a contingency table. The table is expanded back to individual observations, which are resampled jointly. For a 2 by 2 table the statistic equals phi.

Usage

cramers_v_ci(tab, R = 2000, conf.level = 0.95, seed = NULL)

Arguments

tab

A contingency table (from table()) or a matrix of counts.

R

Integer. Number of bootstrap resamples. Defaults to 2000.

conf.level

Confidence level. Defaults to 0.95.

seed

Integer or NULL. When supplied, sets the random seed.

Value

A named numeric vector: estimate, lower, upper. The bounds are NA when the table holds fewer than 3 observations.

See Also

bootstrap_ci()

Examples

cramers_v_ci(table(mtcars$am, mtcars$cyl), seed = 42)

surveyframe documentation built on July 25, 2026, 1:07 a.m.