srh.effsize: SRH with effect sizes for two-factor designs

View source: R/srh.effsize.R

srh.effsizeR Documentation

SRH with effect sizes for two-factor designs

Description

Extends rcompanion::scheirerRayHare() by adding popular rank-based effect sizes for each SRH term: eta^2_H and epsilon^2_H, and stores the original function call.

Usage

srh.effsize(formula, data, clamp0 = TRUE, ...)

Arguments

formula

A formula of the form y ~ A + B.

data

A data.frame containing all variables in formula.

clamp0

Logical; if TRUE (default), negative eta^2_H is truncated to 0 and epsilon^2_H truncated to the interval [0, 1].

...

Passed to rcompanion::scheirerRayHare().

Details

Let H be the SRH H-statistic for a given term, n the sample size used by SRH (complete cases on y and factors), and k the number of groups compared by that term (for interactions, the number of observed combinations).

Effect sizes computed:

  • Eta^2_H: (H - k + 1) / (n - k).

  • Epsilon^2_H (KW-like): H * (n + 1) / (n^2 - 1).

The original call is stored as an attribute and can be retrieved with getCall().

Value

A data.frame (classed as c("srh_with_call","anova","data.frame")) with the SRH table extended by columns: k, n, eta2H, eps2H.

Examples

data(mimicry, package = "factorH")
res <- srh.effsize(liking ~ gender + condition, data = mimicry)
res
getCall(res)


factorH documentation built on Sept. 11, 2025, 9:09 a.m.