Omega squared for measure of effect in R? 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.
thanks!
 A: 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)
    return(W2)
}

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]

    return(output)
}

A: 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}]
    partOmegas
}

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.
A: I found an omega squared function in somebody's .Rprofile that they made available online:
http://www.estudiosfonicos.cchs.csic.es/metodolo/1/.Rprofile
A: 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.
A: 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: 
https://cran.r-project.org/web/packages/sjstats/vignettes/anova-statistics.html
install.packages("sjstats")
library(sjstats)

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

anova_stats(mod1)

