Learn R Programming

misty (version 0.4.5)

eta.sq: Eta Squared

Description

This function computes eta squared for one or more outcome variables in combination with one or more grouping variables.

Usage

eta.sq(x, group, digits = 2, as.na = NULL, check = TRUE, output = TRUE)

Arguments

x

a numeric vector, matrix or data frame with numeric vectors for the outcome variables.

group

a vector, matrix or data frame with integer vectors, character vectors or factors for the grouping variables.

digits

an integer value indicating the number of decimal places to be used for displaying eta squared.

as.na

a numeric vector indicating user-defined missing values, i.e. these values are converted to NA before conducting the analysis. Note that as.na() function is only applied to the argument x.

check

logical: if TRUE, argument specification is checked.

output

logical: if TRUE, output is shown on the console.

Value

Returns an object of class misty.object, which is a list with following entries: function call (call), matrix or data frame specified in x (data), specification of function arguments (args), and list with results (result).

References

Rasch, D., Kubinger, K. D., & Yanagida, T. (2011). Statistics in psychology - Using R and SPSS. New York: John Wiley & Sons.

See Also

cohens.d, cor.cont, cor.matrix, cor.cramer, cor.phi

Examples

Run this code
# NOT RUN {
dat <- data.frame(x1 = c(1, 1, 1, 1, 2, 2, 2, 2, 2),
                  x2 = c(1, 1, 1, 2, 2, 2, 3, 3, 3),
                  y1 = c(3, 2, 4, 5, 6, 4, 7, 5, 7),
                  y2 = c(2, 4, 1, 5, 3, 3, 4, 6, 7))

# Eta squared for y1 explained by x1
eta.sq(dat$y1, group = dat$x1)

# Eta squared for y1 and y2 explained by x1 and x2
eta.sq(dat[, c("y1", "y2")], group = dat[, c("x1", "x2")])
# }

Run the code above in your browser using DataLab