Learn R Programming

factorH (version 0.5.0)

srh.effsize: 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, ...)

Value

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

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().

Examples

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

Run the code above in your browser using DataLab