eta.sq: Eta Squared

View source: R/eta.sq.R

eta.sqR Documentation

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:

call

function call

type

type of analysis

data

list with the input specified in x and group

args

specification of function arguments

result

numeric vector with results

Author(s)

Takuya Yanagida takuya.yanagida@univie.ac.at

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

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")])

misty documentation built on Nov. 15, 2023, 1:06 a.m.

Related to eta.sq in misty...