The statistics book I am reading recommends omega squared to measure the effects of my experiments. I have already proven using a split plot design (mix of within-subjects and between-subjects design) that my within-subjects factors are statistically significant with p<0.001 and F=17.

Now I'm looking to see how big is the difference... is there an implementation of omega squared somewhere for R (or python? I know... one can dream ;) Searching on the internet for R-related stuff is a pain the *, I don't know how I manage to find stuff with C.


  • 3
    $\begingroup$ I'm not aware of such a function, but perhaps someone could look at the formulas in Olejnik and Algina (2003) cps.nova.edu/marker/olejnik2003.pdf and write a function $\endgroup$ Commented Sep 22, 2010 at 5:34
  • 3
    $\begingroup$ @Jeromy Nice reference! This one is worth looking too: Recommended effect size statistics for repeated measures designs (BRM 2005 37(3)), j.mp/cT9uEQ $\endgroup$
    – chl
    Commented Sep 22, 2010 at 6:56
  • 2
    $\begingroup$ @chl Thanks. Apparently, ezANOVA() in the ez package in R reports generalised eta squared. $\endgroup$ Commented Sep 22, 2010 at 7:49

6 Answers 6


A function to compute omega squared is straightforward to write. This function takes the object returned by the aov test, and calculates and returns and omega squared:

omega_sq <- function(aovm){
    sum_stats <- summary(aovm)[[1]]
    SSm <- sum_stats[["Sum Sq"]][1]
    SSr <- sum_stats[["Sum Sq"]][2]
    DFm <- sum_stats[["Df"]][1]
    MSr <- sum_stats[["Mean Sq"]][2]
    W2 <- (SSm-DFm*MSr)/(SSm+SSr+MSr)

edit: updated function for n-way aov models:

omega_sq <- function(aov_in, neg2zero=T){
    aovtab <- summary(aov_in)[[1]]
    n_terms <- length(aovtab[["Sum Sq"]]) - 1
    output <- rep(-1, n_terms)
    SSr <- aovtab[["Sum Sq"]][n_terms + 1]
    MSr <- aovtab[["Mean Sq"]][n_terms + 1]
    SSt <- sum(aovtab[["Sum Sq"]])
    for(i in 1:n_terms){
        SSm <- aovtab[["Sum Sq"]][i]
        DFm <- aovtab[["Df"]][i]
        output[i] <- (SSm-DFm*MSr)/(SSt+MSr)
        if(neg2zero & output[i] < 0){output[i] <- 0}
    names(output) <- rownames(aovtab)[1:n_terms]


I had to recently report an $\omega^2$.

partialOmegas <- function(mod){
    aovMod <- mod
    if(!any(class(aovMod) %in% 'aov')) aovMod <- aov(mod)
    sumAov     <- summary(aovMod)[[1]]
    residRow   <- nrow(sumAov)
    dfError    <- sumAov[residRow,1]
    msError    <- sumAov[residRow,3]
    nTotal     <- nrow(model.frame(aovMod))
    dfEffects  <- sumAov[1:{residRow-1},1]
    ssEffects  <- sumAov[1:{residRow-1},2]
    msEffects  <- sumAov[1:{residRow-1},3]
    partOmegas <- abs((dfEffects*(msEffects-msError)) /
                  (ssEffects + (nTotal -dfEffects)*msError))
    names(partOmegas) <- rownames(sumAov)[1:{residRow-1}]

It is a messy function that can easily be cleaned up. It computes the partial $\omega^2$, and should probably only be used on between-subjects factorial designs.


I found an omega squared function in somebody's .Rprofile that they made available online:



I'd suggest that generalized eta square is considered (ref, ref) a more appropriate measure of effect size. It is included in the ANOVA output in the ez package for R.

  • 5
    $\begingroup$ Actually, eta-squared is a highly positively biased statistic. It is, therefore, much worse in this situation than omega-squared, though because of its simplicity, it is more popular. $\endgroup$
    – user95417
    Commented Nov 17, 2015 at 19:04
  • $\begingroup$ I agree with user above. Here's a link to back it up. daniellakens.blogspot.nl/2015/06/… $\endgroup$ Commented Mar 15, 2018 at 4:57

Daniel "strengejacke" Lüdecke's package sjstats can not do omega-squared, partial-omega-squared etc for ANOVA models. Check it out.

Here is a vignette that demonstrates that:



mod1 <- aov(y~x, data= d.frame)


R package effectsize can compute (partial) Eta^2, Omega^2, and Epsilon^2. See vignette: https://cran.r-project.org/web/packages/effectsize/vignettes/anovaES.html


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.