eta: Eta coefficient for nominal/interval data.

Description Usage Arguments Value Author(s) Examples

Description

Eta coefficient for nominal/interval data.

Usage

1
eta(x, y, breaks = NULL, na.rm = FALSE)

Arguments

x

Independent nominal variable (factor or numeric).

y

Dependent interval variable (numeric).

breaks

If x is interval data the breaks argument can be specified to classify the data. breaks is passed on to the function cut.

na.rm

Logical. Indicating if NA values are removed.

Value

Eta coefficient

Author(s)

Mark Heckmann

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
attach(d.eta)     # using d.eta dataset
eta(x1, y)

# removing missing data
eta(c(x1, 2), c(NA, y), na.rm=TRUE)   # NA added to y to show NA behaviour

# classify interval data x
eta(x, y, breaks=c(1, 4, 7,10))
# visualize classication
plot(x, y)
abline(v=c(1, 4, 7,10))

# setting number of breaks for classification
eta(x, y, breaks=7)

Example output

[1] 0.6681451
[1] 0.0569353
[1] 0.6696627
[1] 0.8613785

ryouready documentation built on May 1, 2019, 8:39 p.m.