R/v_cramer.R

Defines functions v_cramer

Documented in v_cramer

# V de Cramér de una tabla de contingencia.
v_cramer <- function(tabla) {
  tabla <- as.matrix(tabla)
  chi2 <- suppressWarnings(
    stats::chisq.test(tabla, correct = FALSE)$statistic
  )
  k <- min(dim(tabla))
  unname(sqrt(chi2 / (sum(tabla) * (k - 1))))
}

Try the agroestadistica package in your browser

Any scripts or data that you put into this service are public.

agroestadistica documentation built on Nov. 29, 2026, 5:07 p.m.