ordinalEtaSquared | R Documentation |
Calculates eta-squared as an effect size statistic, following a Kruskal-Wallis test, or for a table with one ordinal variable and one nominal variable; confidence intervals by bootstrap.
ordinalEtaSquared(
x,
g = NULL,
group = "row",
ci = FALSE,
conf = 0.95,
type = "perc",
R = 1000,
histogram = FALSE,
digits = 3,
reportIncomplete = FALSE,
...
)
x |
Either a two-way table or a two-way matrix. Can also be a vector of observations of an ordinal variable. |
g |
If |
group |
If |
ci |
If |
conf |
The level for the confidence interval. |
type |
The type of confidence interval to use.
Can be any of " |
R |
The number of replications to use for bootstrap. |
histogram |
If |
digits |
The number of significant digits in the output. |
reportIncomplete |
If |
... |
Additional arguments passed to the |
Eta-squared is used as a measure of association for the Kruskal-Wallis test or for a two-way table with one ordinal and one nominal variable.
Currently, the function makes no provisions for NA
values in the data. It is recommended that NA
s be removed
beforehand.
Because eta-squared is always positive,
if type="perc"
, the confidence interval will
never cross zero, and should not
be used for statistical inference.
However, if type="norm"
, the confidence interval
may cross zero.
When eta-squared is close to 0 or very large, or with small counts in some cells, the confidence intervals determined by this method may not be reliable, or the procedure may fail.
A single statistic, eta-squared. Or a small data frame consisting of eta-squared, and the lower and upper confidence limits.
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
Cohen, B.H. 2013. Explaining Psychological Statistics, 4th ed. Wiley.
https://rcompanion.org/handbook/F_08.html
freemanTheta
,
epsilonSquared
data(Breakfast)
library(coin)
chisq_test(Breakfast, scores = list("Breakfast" = c(-2, -1, 0, 1, 2)))
ordinalEtaSquared(Breakfast)
data(PoohPiglet)
kruskal.test(Likert ~ Speaker, data = PoohPiglet)
ordinalEtaSquared(x = PoohPiglet$Likert, g = PoohPiglet$Speaker)
### Same data, as matrix of counts
data(PoohPiglet)
XT = xtabs( ~ Speaker + Likert , data = PoohPiglet)
ordinalEtaSquared(XT)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.