Learn R Programming

effectsize (version 0.3.2)

phi: Effect size for contingency tables

Description

Compute Cramer's V and phi (\(\phi\)) from contingency tables.

Usage

phi(x, y = NULL, CI = 0.95, adjust = FALSE, ...)

cramers_v(x, y = NULL, CI = 0.95, adjust = FALSE, ...)

Arguments

x

a numeric vector or matrix. x and y can also both be factors.

y

a numeric vector; ignored if x is a matrix. If x is a factor, y should be a factor of the same length.

CI

Confidence Interval (CI) level

adjust

Should the effect size be bias-corrected? Defaults to FALSE.

...

Ignored.

Value

A data frame with the effect size(s) between 0-1, and confidence interval(s).

See Also

chisq_to_phi() for details regarding estimation and CIs.

Examples

Run this code
# NOT RUN {
contingency_table <- as.table(rbind(c(762, 327, 468), c(484, 239, 477), c(484, 239, 477)))

phi(contingency_table)

cramers_v(contingency_table)

# }

Run the code above in your browser using DataLab