Learn R Programming

rcompanion (version 1.13.2)

epsilonSquared: Epsilon-squared

Description

Calculates epsilon-squared for a table with one ordinal variable and one nominal variable.

Usage

epsilonSquared(x, g = NULL, group = "row", digits = 3, ...)

Arguments

x

Either a two-way table or a two-way matrix. Can also be a vector of observations of an ordinal variable.

g

If x is a vector, g is the vector of observations for the grouping, nominal variable.

group

If x is a table or matrix, group indicates whether the "row" or the "column" variable is the nominal, grouping variable.

digits

The number of significant digits in the output.

...

Additional arguments passed to the kruskal.test function.

Value

A single statistic, epsilon-squared

Details

Epsilon-squared is used as a measure of association for the Kruskal-Wallis test or for a two-way table with one ordinal and one nominal variable.

Currently, the function makes no provisions for NA values in the data. It is recommended that NAs be removed beforehand.

References

http://rcompanion.org/handbook/H_11.html

See Also

freemanTheta

Examples

Run this code
# NOT RUN {
data(Breakfast)
library(coin)
chisq_test(Breakfast, scores = list("Breakfast" = c(-2, -1, 0, 1, 2)))
epsilonSquared(Breakfast)

data(PoohPiglet)
kruskal.test(Likert ~ Speaker, data = PoohPiglet)
epsilonSquared(x = PoohPiglet$Likert, g = PoohPiglet$Speaker)

# }

Run the code above in your browser using DataLab