I am doing a one way analysis of variance to test whether the mean of an observation varies across groups. I'm using R's oneway.test
rather than anova
because I have thousands of groups and oneway.test is faster. How can I measure the effect size? Is there a way to calculate the $\eta^2$ using the output of oneway.test?
This is how I am doing my test:
oneway.test(o ~ g,
data=data.frame(o=rep(c(1:100),10)+rnorm(1000,sd=0.1),g=rep(c(1:100),10)),
var.equal = T)
I have 8500 groups, and each group has a different number of members, say between 3 and 10. Obviously with these many groups, I expect to get a very significant p-value. That's why I want to find the effect size, because for a large N, even a very small non-zero effect will give a significant pvalue.
Best Answer
In the absence of library function, one can manually calculate the $\eta^2. $Suppose the data is as follows:
I am computing the oneway test as
If I use
aov
, I can calculate $\eta^2$ as follows using thelsr
package:Now, I will calculate the $\eta^2$ manually.
which is the same as that calculated by the
lsr
package.